Skip to content

rustc assertion failed when building in release mode with -g #31702

@arkpar

Description

@arkpar

rustc fails to build my crate in release mode with debugging symbols.
The crate is located here: https://github.com/ethcore/parity/tree/master/ethcore
It is hard to pinpoint the exact piece of code responsible since the error message gives no such indication.

Running cargo rustc --release -- -g fails with the following message:

Assertion failed: (std::all_of(Expr.begin(), Expr.end(), [](const DIExpression *E) { return E && E->isBitPiece(); }) && "conflicting locations for variable"), function addMMIEntry, file /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h, line 137.

Stack trace:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x1413 of process 78186]
0x00007fff8e42b002 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
(gdb) bt
#0  0x00007fff8e42b002 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff8b7255c5 in pthread_kill () from /usr/lib/system/libsystem_pthread.dylib
#2  0x00000001034e04d6 in abort () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#3  0x00000001034e04b1 in __assert_rtn () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#4  0x0000000102b76f49 in llvm::DbgVariable::addMMIEntry(llvm::DbgVariable const&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#5  0x0000000102b76d38 in llvm::DwarfFile::addScopeVariable(llvm::LexicalScope*, llvm::DbgVariable*) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#6  0x0000000102b63d2c in llvm::DwarfDebug::collectVariableInfoFromMMITable(llvm::DenseSet<std::__1::pair<llvm::DILocalVariable const*, llvm::DILocation const*>, llvm::DenseMapInfo<std::__1::pair<llvm::DILocalVariable const*, llvm::DILocation const*> > >&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#7  0x0000000102b64e75 in llvm::DwarfDebug::collectVariableInfo(llvm::DwarfCompileUnit&, llvm::DISubprogram const*, llvm::DenseSet<std::__1::pair<llvm::DILocalVariable const*, llvm::DILocation const*>, llvm::DenseMapInfo<std::__1::pair<llvm::DILocalVariable const*, llvm::DILocation const*> > >&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#8  0x0000000102b669df in llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#9  0x0000000102b3e7b6 in llvm::AsmPrinter::EmitFunctionBody() () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#10 0x00000001027f342c in llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#11 0x0000000102c799fd in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#12 0x000000010344190c in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#13 0x0000000103441b6b in llvm::FPPassManager::runOnModule(llvm::Module&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#14 0x0000000103441fb6 in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#15 0x00000001034425ad in llvm::legacy::PassManager::run(llvm::Module&) () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#16 0x00000001021ae217 in LLVMRustWriteOutputFile () from /Users/a/.multirust/toolchains/nightly/lib/librustc_llvm-fd663c41.dylib
#17 0x000000010092fa38 in back::write::write_output_file::h8cdf1cd8684c16ddmTc () from /Users/a/.multirust/toolchains/nightly/lib/librustc_trans-fd663c41.dylib
#18 0x00000001009320f5 in back::write::optimize_and_codegen::_$u7b$$u7b$closure$u7d$$u7d$::closure.55532 () from /Users/a/.multirust/toolchains/nightly/lib/librustc_trans-fd663c41.dylib
#19 0x0000000100939e5a in back::write::execute_work_item::hdd6c4255c830b769GOd () from /Users/a/.multirust/toolchains/nightly/lib/librustc_trans-fd663c41.dylib
#20 0x0000000100933350 in back::write::run_passes::h13d1ef292e406e82wAd () from /Users/a/.multirust/toolchains/nightly/lib/librustc_trans-fd663c41.dylib
#21 0x0000000100058d7d in driver::phase_5_run_llvm_passes::h48d3ba608193e436p2a () from /Users/a/.multirust/toolchains/nightly/lib/librustc_driver-fd663c41.dylib
#22 0x00000001000197c4 in driver::compile_input::h54d49124c108da10Bca () from /Users/a/.multirust/toolchains/nightly/lib/librustc_driver-fd663c41.dylib
#23 0x0000000100009442 in run_compiler::h65293143fe622e848Gc () from /Users/a/.multirust/toolchains/nightly/lib/librustc_driver-fd663c41.dylib
#24 0x0000000100006886 in sys_common::unwind::try::try_fn::h7759751279928036373 () from /Users/a/.multirust/toolchains/nightly/lib/librustc_driver-fd663c41.dylib
#25 0x00000001044738cc in __rust_try () from /Users/a/.multirust/toolchains/nightly/lib/libstd-fd663c41.dylib
#26 0x000000010446bd54 in sys_common::unwind::inner_try::he3a51540743a3631D8s () from /Users/a/.multirust/toolchains/nightly/lib/libstd-fd663c41.dylib
#27 0x000000010000713a in boxed::F.FnBox$LT$A$GT$::call_box::h2643543928305581055 () from /Users/a/.multirust/toolchains/nightly/lib/librustc_driver-fd663c41.dylib
#28 0x000000010447d4f0 in sys::thread::Thread::new::thread_start::h26f0f802585e3c80ULx () from /Users/a/.multirust/toolchains/nightly/lib/libstd-fd663c41.dylib
#29 0x00007fff8b723c13 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
#30 0x00007fff8b723b90 in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib
#31 0x00007fff8b721375 in thread_start () from /usr/lib/system/libsystem_pthread.dylib
#32 0x0000000000000000 in ?? ()
$ rustc --version --verbose
rustc 1.8.0-nightly (fae516277 2016-02-13)
binary: rustc
commit-hash: fae516277b6da46b6c1cf568765c90fad2f9ae4b
commit-date: 2016-02-13
host: x86_64-apple-darwin
release: 1.8.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions