Skip to content

Building rustc with -g hits LLVM assert #19848

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

Closed
bkoropoff opened this issue Dec 14, 2014 · 4 comments · Fixed by #21970
Closed

Building rustc with -g hits LLVM assert #19848

bkoropoff opened this issue Dec 14, 2014 · 4 comments · Fixed by #21970
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@bkoropoff
Copy link
Contributor

$ RUSTFLAGS="-g" make -j8 rustc-stage1
...
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
rustc: /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/llvm/lib/IR/Instructions.cpp:1086: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.core] Aborted

Backtrace from core file:

#0  0x00007f506ba0a877 in raise () from /lib64/libc.so.6
#1  0x00007f506ba0bf68 in abort () from /lib64/libc.so.6
#2  0x00007f506ba037d6 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007f506ba03882 in __assert_fail () from /lib64/libc.so.6
#4  0x00007f506e118c61 in llvm::StoreInst::AssertOK() ()
#5  0x00007f506d7c6666 in llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateStore(llvm::Value*, llvm::Value*, bool) ()
#6  0x00007f506d261e62 in trans::builder::Builder$LT$$x27a$C$$x20$x27tcx$GT$::store::h30422c6d66c8362fMar ()
#7  0x00007f506d277697 in trans::base::trans_closure::hd73aafc90fa3ac9cVfu ()
#8  0x00007f506d211d82 in trans::expr::trans_rvalue_dps_unadjusted::h9838b52bc02d24d9cgj ()
#9  0x00007f506d20d688 in trans::expr::trans_unadjusted::h7b542949e8fd1f0aUCi ()
#10 0x00007f506d1c736c in trans::expr::trans::h6758cf65ffe4e433IQh ()
#11 0x00007f506d2068c0 in trans::callee::trans_args::h87945a0a00d776c99oh ()
#12 0x00007f506d1cea5d in trans::callee::trans_call_inner::h3407dfe88b63d12913g ()
#13 0x00007f506d20f8ef in trans::expr::trans_rvalue_dps_unadjusted::h9838b52bc02d24d9cgj ()
#14 0x00007f506d1c60f8 in trans::expr::trans_into::h3e5c3cd16b2b4e12WMh ()
#15 0x00007f506d1c6df4 in trans::controlflow::trans_block::hf81d152713271e77FYd ()
#16 0x00007f506d27842f in trans::base::trans_closure::hd73aafc90fa3ac9cVfu ()
#17 0x00007f506d1b94ce in trans::base::trans_fn::h8314c0146f176259cru ()
#18 0x00007f506d1b5007 in trans::base::trans_item::hdac7426481f8746aeMu ()
#19 0x00007f506d279c49 in trans::base::trans_mod::h03145c37fc751d9cJRu ()
#20 0x00007f506d1b4e7f in trans::base::trans_item::hdac7426481f8746aeMu ()
#21 0x00007f506d279c49 in trans::base::trans_mod::h03145c37fc751d9cJRu ()
#22 0x00007f506d27ed07 in trans::base::trans_crate::hff0a239bca25518eoIv ()
#23 0x00007f506cca175d in driver::phase_4_translate_to_llvm::h1d8e5fa121da5744BCa ()
#24 0x00007f506cc88b98 in driver::compile_input::h99875561ae679834pba ()
#25 0x00007f506cd23d38 in run_compiler::h68c8d9fcc09b1d69kYb ()
#26 0x00007f506cd2262c in run::closure.21400 ()
#27 0x00007f506cd33f3b in task::TaskBuilder::try_future::closure.22849 ()
#28 0x00007f506e8e18f3 in task::TaskBuilder::spawn_internal::closure.30601 ()
#29 0x00007f506e8fc732 in task::Task::spawn::closure.5727 ()
#30 0x00007f506e8fee9c in rust_try_inner ()
#31 0x00007f506e8fee86 in rust_try ()
#32 0x00007f506e8fc7d3 in unwind::try::h67138f1a9143bb4fTyc ()
#33 0x00007f506e8fc5dc in task::Task::run::hd7a7ebf54ed491e4fKb ()
#34 0x00007f506e8fc228 in task::Task::spawn::closure.5703 ()
#35 0x00007f506e8fd655 in thread::thread_start::h69086febf2f5cecdw1b ()
#36 0x00007f506c6c3ee5 in start_thread () from /lib64/libpthread.so.0
#37 0x00007f506bac9b8d in clone () from /lib64/libc.so.6

This looks similar to #17257, but I wasn't able to reproduce crashes on some of the examples in there, so I'm opening a separate issue for now.

@jdm jdm added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Dec 14, 2014
@bkoropoff
Copy link
Contributor Author

Log messages prior to the assert seem to point to an interaction between closures and debug info:

DEBUG:rustc_trans::trans::base: new InsnCtxt: closure::load_environment
...
DEBUG:rustc_trans::trans::builder: Store (%closure.2*:%closure.2* %0) -> (%closure.2***:  %__debuginfo_env_ptr = alloca %closure.2**)

@bkoropoff
Copy link
Contributor Author

It looks like this only occurs with the stage0 rustc, and not with stage1. This is probably a bug that was already fixed, and we just need a snapshot.

@michaelwoerister
Copy link
Member

There has been a bug in this area but @luqmana fixed it two weeks ago. This might be the same issue.

@michaelwoerister
Copy link
Member

Update: This very probably fixed but that can't be verified because #20798 also crashes when running RUSTFLAGS=-g make.

bors added a commit that referenced this issue Feb 8, 2015
…brson

Resolves some issues caused by the recent LLVM update (which itself solved some issues).

Closes #19848
Closes #20798
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.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants