Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Enable core dump on Linux, and print their stack trace on segfault. #52333

Merged
merged 1 commit into from
Jul 13, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Jul 13, 2018

No description provided.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2018
@kennytm kennytm changed the title [WIP] CI: Enabled core dump on Linux, and print stack trace on failure. [WIP] CI: Enable core dump on Linux, and print their stack trace on segfault. Jul 13, 2018
@rust-highfive

This comment has been minimized.

@kennytm kennytm changed the title [WIP] CI: Enable core dump on Linux, and print their stack trace on segfault. CI: Enable core dump on Linux, and print their stack trace on segfault. Jul 13, 2018
@kennytm
Copy link
Member Author

kennytm commented Jul 13, 2018

r? @alexcrichton

Sample log where I injected a null pointer exception to LLVMRustInlineAsm(): https://travis-ci.org/kennytm/rust/jobs/403388193 (raw log):

�[0K$ ln -s . checkout && for CORE in obj/cores/core.*; do printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; done || true
travis_fold:start:crashlog
�[31;1mobj/cores/core.26738.!checkout!obj!build!x86_64-unknown-linux-gnu!stage1!bin!rustc�[0m
Source directories searched: /home/travis/build/kennytm/rust/src:$cdir:$cwd
Reading symbols from obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc...(no debugging symbols found)...done.
[New LWP 26738]
[New LWP 26740]
[New LWP 26754]
[New LWP 26739]
[New LWP 26755]

warning: Could not load shared library symbols for 7 libraries, e.g. /lib/x86_64-linux-gnu/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --crate-name comp'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fbb6d720062 in LLVMRustInlineAsm ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#0  0x00007fbb6d720062 in LLVMRustInlineAsm ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007fbb6d5ccbc6 in rustc_codegen_llvm::builder::Builder::inline_asm_call::hd5b7adc0380f375d ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007fbb6d6c0b98 in rustc_codegen_llvm::mir::codegen_mir::ha87840469b084725 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007fbb6d681f5d in rustc_codegen_llvm::base::codegen_instance::h44825d3eff6c6940 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007fbb6d68637d in rustc_codegen_llvm::base::compile_codegen_unit::hcdcfc66572720b3c ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007fbb73e090db in rustc::ty::query::__query_compute::compile_codegen_unit::h0f9ce8100b7ff5a6 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#6  0x00007fbb73caf310 in rustc::ty::query::_$LT$impl$u20$rustc..ty..query..config..QueryAccessors$LT$$u27$tcx$GT$$u20$for$u20$rustc..ty..query..queries..compile_codegen_unit$LT$$u27$tcx$GT$$GT$::compute::h7e22ba9982d925a5 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#7  0x00007fbb73b505b7 in rustc::dep_graph::graph::DepGraph::with_task_impl::hb3730016452990bb ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#8  0x00007fbb73c863ec in rustc::ty::context::tls::with_related_context::hb43053b3f410a3e8 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#9  0x00007fbb73e4a938 in rustc::ty::query::plumbing::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::force_query_with_job::he141ab2af45e4ab3 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#10 0x00007fbb73e87d72 in rustc::ty::query::plumbing::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$gcx$C$$u20$$u27$tcx$GT$$GT$::get_query::h02fee8e3a14c0d70 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#11 0x00007fbb73f6ab20 in rustc::ty::query::_$LT$impl$u20$rustc..ty..context..TyCtxt$LT$$u27$a$C$$u20$$u27$tcx$C$$u20$$u27$lcx$GT$$GT$::compile_codegen_unit::h6e48367a09074cfc ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/../lib/librustc-f3f1ff1495349b05.so
#12 0x00007fbb6d68b0c3 in _$LT$rustc_codegen_llvm..LlvmCodegenBackend$u20$as$u20$rustc_codegen_utils..codegen_backend..CodegenBackend$GT$::codegen_crate::hbf7d20557860ca97 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#13 0x00007fbb77ce4272 in rustc::util::common::time::h460c07afd9d56d76 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#14 0x00007fbb77cdab4d in rustc_driver::driver::phase_4_codegen::hfb9579faf8df738d ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#15 0x00007fbb77d67b22 in rustc_driver::driver::compile_input::_$u7b$$u7b$closure$u7d$$u7d$::h406bd4c7879e0cdf ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#16 0x00007fbb77d5c8ad in rustc::ty::context::tls::enter_context::h6f5860a5d94edc66 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#17 0x00007fbb77d281cb in _$LT$std..thread..local..LocalKey$LT$T$GT$$GT$::with::hb22928489ac8adbf ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#18 0x00007fbb77c90743 in rustc::ty::context::TyCtxt::create_and_enter::h92fbef8f3813fdd0 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#19 0x00007fbb77cd4224 in rustc_driver::driver::compile_input::h6b7337068a7c08c1 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#20 0x00007fbb77d81835 in rustc_driver::run_compiler_with_pool::h3c40e0ed509a9cfd ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#21 0x00007fbb77c797fd in _$LT$scoped_tls..ScopedKey$LT$T$GT$$GT$::set::h27cff114e7d9f4b1 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#22 0x00007fbb77c99331 in syntax::with_globals::hd63973affbb5c299 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#23 0x00007fbb77c77d33 in _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h6feeaf0de83075ae
    ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#24 0x00007fbb779a6a8a in __rust_maybe_catch_panic ()
    at libpanic_unwind/lib.rs:106
#25 0x00007fbb77d7ec14 in rustc_driver::run::hfa9d7b06e2cabddb ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#26 0x00007fbb77d8c63b in rustc_driver::main::h11fc9bfcab7fefa5 ()
   from ./checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc_driver-87a9eb9bcd4d0b65.so
#27 0x0000563838bdbb23 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h46eceef79dd75f0e ()
#28 0x00007fbb7796b683 in {{closure}} () at libstd/rt.rs:59
#29 std::panicking::try::do_call::h76675bc80cd1385c ()
    at libstd/panicking.rs:310
#30 0x00007fbb779a6a8a in __rust_maybe_catch_panic ()
    at libpanic_unwind/lib.rs:106
#31 0x00007fbb77960cc6 in try<i32,closure> () at libstd/panicking.rs:289
#32 catch_unwind<closure,i32> () at libstd/panic.rs:392
#33 std::rt::lang_start_internal::h46076ca304e366db () at libstd/rt.rs:58
#34 0x0000563838bdbb84 in main ()
travis_fold:end:crashlog

@rust-highfive rust-highfive assigned alexcrichton and unassigned aturon Jul 13, 2018
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 13, 2018

📌 Commit 1e1b800 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jul 13, 2018
…hton

CI: Enable core dump on Linux, and print their stack trace on segfault.
bors added a commit that referenced this pull request Jul 13, 2018
Rollup of 17 pull requests

Successful merges:

 - #51962 (Provide llvm-strip in llvm-tools component)
 - #52003 (Implement `Option::replace` in the core library)
 - #52156 (Update std::ascii::ASCIIExt deprecation notes)
 - #52280 (llvm-tools-preview: fix build-manifest)
 - #52290 (Deny bare trait objects in src/librustc_save_analysis)
 - #52293 (Deny bare trait objects in librustc_typeck)
 - #52299 (Deny bare trait objects in src/libserialize)
 - #52300 (Deny bare trait objects in librustc_target and libtest)
 - #52302 (Deny bare trait objects in the rest of rust)
 - #52310 (Backport 1.27.1 release notes to master)
 - #52315 (Resolve FIXME(#27942))
 - #52316 (task: remove wrong comments about non-existent LocalWake trait)
 - #52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade)
 - #52330 (Don't silently ignore invalid data in target spec)
 - #52333 (CI: Enable core dump on Linux, and print their stack trace on segfault. )
 - #52346 (Fix typo in improper_ctypes suggestion)
 - #52350 (Bump bootstrap compiler to 1.28.0-beta.10)

Failed merges:

r? @ghost
@bors bors merged commit 1e1b800 into rust-lang:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants