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

RUSTFLAGS=-g makes rustc segfault #15816

Closed
Zoxc opened this issue Jul 19, 2014 · 4 comments
Closed

RUSTFLAGS=-g makes rustc segfault #15816

Zoxc opened this issue Jul 19, 2014 · 4 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@Zoxc
Copy link
Contributor

Zoxc commented Jul 19, 2014

When building ab61022:

export RUSTFLAGS=-g
./configure --prefix=~/dev/install/rust --enable-ccache
make -j4 rustc-stage1 install

The following command segfaults:

 LD_LIBRARY_PATH=/home/john/dev/rust/x86_64-unknown-linux-gnu/stage0/lib:$LD_LIBRARY_PATH   x86_64-unknown-linux-gnu/stage0/bin/rustc --cfg stage0 -g -O --cfg rtopt --cfg debug -C prefer-dynamic --target=x86_64-unknown-linux-gnu  -W warnings -L "x86_64-unknown-linux-gnu/rt" -L "/home/john/dev/rust/x86_64-unknown-linux-gnu/llvm/Release+Asserts/lib" -L ""  --out-dir x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib -C extra-filename=-4e7c5e5c /home/john/dev/rust/src/libcore/lib.rs`

Backtrace

#0  0x00000000019e9506 in llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) ()
#1  0x000000000120b5cc in llvm::AsmPrinter::EmitFunctionBody() ()
#2  0x00000000010f8019 in llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) ()
#3  0x000000000173267f in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#4  0x00000000017326cb in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#5  0x000000000173222f in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#6  0x0000000000db5b49 in LLVMRustWriteOutputFile (Target=0x7ffff09a8900, PMR=0x7ffff0c9e1a0, M=0x7ffff01cbbd0, path=<optimized out>, FileType=llvm::TargetMachine::CGFT_ObjectFile)
    at /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/rustllvm/PassWrapper.cpp:202
#7  0x0000000000bef5b0 in back::link::write_output_file::h09c0634fd9f03231f5a ()
#8  0x0000000000bf6998 in back::link::write::run_passes::closure.Name$LP$126284$RP$ ()
#9  0x0000000000bf1928 in back::link::write::run_passes::h2b4eb639115e25eaE7a ()
#10 0x0000000000d25b10 in driver::driver::phase_5_run_llvm_passes::closure.Name$LP$133051$RP$ ()
#11 0x0000000000c9a737 in driver::driver::phase_5_run_llvm_passes::hbb488b4183a65d34CPq ()
#12 0x0000000000c92699 in driver::driver::compile_input::ha08134a856c1baf7Mrq ()
#13 0x0000000000d4631f in driver::run_compiler::h16b5ad985e64960ctit ()
#14 0x0000000000d438e5 in driver::main_args::closure.Name$LP$133838$RP$ ()
#15 0x0000000000d57258 in task::TaskBuilder$LT$S$GT$::try_future::closure.Name$LP$134982$RP$ ()
#16 0x0000000000d57162 in task::TaskBuilder$LT$S$GT$::spawn_internal::closure.Name$LP$134959$RP$ ()
#17 0x0000000000472638 in task::spawn_opts::closure.Name$LP$8148$RP$ ()
#18 0x0000000001e2233c in rust_try ()
#19 0x0000000001e1ee37 in unwind::try::h6d2c1fb5576a3094BNd ()
#20 0x0000000001e1ebd7 in task::Task::run::hbe8cdbc4ab2338e9XYc ()
#21 0x00000000004724d6 in task::spawn_opts::closure.Name$LP$8094$RP$ ()
#22 0x0000000001e205e4 in thread::thread_start::ha099f70322a5f123vld ()
#23 0x00007ffff7bc70ca in start_thread (arg=0x7ffff63ff480) at pthread_create.c:309
#24 0x00007ffff6fd906d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
@sfackler
Copy link
Member

cc @michaelwoerister

@huonw
Copy link
Member

huonw commented Jul 20, 2014

Seems similar to #15156 although the backtrace differs.

@michaelwoerister
Copy link
Member

#15156 also fails in DwarfDebug::endFunction, yes. I guess it's the same problem (function inlining corrupting the source code location data). I'll take a closer look on Wednesday.
Thanks for the bug report!

@michaelwoerister
Copy link
Member

The root issue causing these crashes (#15156, #15816, and #16483) is now documented and tracked in #17201. I hope to find the time for a fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

4 participants