Skip to content

RUSTFLAGS=-g makes rustc segfault #15816

Closed
@Zoxc

Description

@Zoxc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions