-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: debuginfo::create_for_loop_var_metadata() #20127
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
Comments
Looks like it was introduced in #20027 |
Minimal script to reproduce // for.rs
fn main() {
for i in range(0, 10i) {}
} $ rustc -g for.rs
for.rs:3:9: 3:10 error: internal compiler error: debuginfo::create_for_loop_var_metadata() - Referenced variable location is not an alloca!
for.rs:3 for i in range(0, 10i) {}
^
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:123
stack backtrace:
1: 0x7f15831987f0 - sys::backtrace::write::hc1f09f1eae19d77aQxt
2: 0x7f15831b9710 - failure::on_fail::h0fb87b850ab6cd900Xz
3: 0x7f15831254a0 - rt::unwind::begin_unwind_inner::habde574b4f76ade20Bz
4: 0x7f157e1c6f00 - rt::unwind::begin_unwind::h16328291673998487577
5: 0x7f157e1c6e80 - diagnostic::SpanHandler::span_bug::hbb7934a78e265d5dSXF
6: 0x7f15810a0350 - session::Session::span_bug::h8e056d7b667a2fcb1on
7: 0x7f15820272a0 - middle::pat_util::pat_bindings::closure.49058
8: 0x7f157e191d50 - ast_util::walk_pat::hab0b8805a667994dlxC
9: 0x7f1581f54f90 - trans::expr::trans_rvalue_stmt_unadjusted::hb3ffc0f604cb73e4l4i
10: 0x7f1581f0f2c0 - trans::expr::trans_into::h71668aa506e1a690uGh
11: 0x7f1581f0fa20 - trans::controlflow::trans_block::hc167a4817215f70d9Zd
12: 0x7f1581fbb310 - trans::base::trans_closure::h0f21c829c37744a86au
13: 0x7f1581f03fd0 - trans::base::trans_fn::h5a95a6b70c2d9335nmu
14: 0x7f1581eff520 - trans::base::trans_item::hf517e1dbb2128044rHu
15: 0x7f1581fc3230 - trans::base::trans_crate::he5a814094c8a4da1HDv
16: 0x7f15836f8f70 - driver::phase_4_translate_to_llvm::hc65b794b160978481Ca
17: 0x7f15836cfe40 - driver::compile_input::hec1a59cac622cf55vba
18: 0x7f1583877220 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h10851168864564136615
19: 0x7f15838758d0 - rt::unwind::try::try_fn::h10692001439554181982
20: 0x7f158321d3f0 - rust_try_inner
21: 0x7f158321d3e0 - rust_try
22: 0x7f1583875c00 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h18028200319240022992
23: 0x7f15831a8f60 - sys::thread::thread_start::hdeb95f039f29863doww
24: 0x7f157d9c9250 - start_thread
25: 0x7f1582ddb219 - clone
26: 0x0 - <unknown> @alexcrichton Don't we run test with debuginfo enabled? I find surprising that bors didn't catch this ICE. |
The introduced issue #20127 seems serious enough that we may want to enqueue a reversion for now. Feel free to beat me with a fix though @michaelwoerister!
I'm looking into right now. While we do have quite a few test cases containing for-loops, none of them seems to be without destructuring, which triggers a slightly different trans path... |
OK, so the problem is that for the non-destructuring case the value of the iteration variable isn't copied out into its own alloca -- instead we just have the result of a I prefer option (2) because it's a bit cleaner and doesn't clutter the IR when debuginfo is enabled. But it's also a bit more work and since bors is already munching on the revert-commit and my wife wants me to be already munching on my dinner, I'll implement the fix tomorrow and make another pull request then... |
No rush @michaelwoerister, thanks for taking the time to investigate! |
The rust compiler introduced [a bug][bug] recently. I'm removing the code that causes the bug so that I can keep working on other things. The bug's already been fixed, so tomorrow's nightly should be good to go, and I can uncomment out the code. [bug]: rust-lang/rust#20127
I don't think that the revert fixed it. I am running off of 34d6800 and am still hitting the ICE. |
@carllerche: I believe that's the commit that merged the bug. It was reverted in 2f3cff6 |
@HeroesGrave Yeah sorry. It seems like I failed at git |
Fixed in #20132. |
how soon is there a new nightly after this fix? (current one still failing for me..) |
@devilbuddy a few hours |
I'm running into this issue as well. |
@heyman Some are archived, see http://www.reddit.com/r/rust/comments/2p9ekl/does_anyone_archive_the_nightly/. Sadly, I didn't find an index |
New Linux nightlies have been released, Windows probably too. |
cargo build stack backtrace: As in the other bug reports, this appears to be related to a FOR loop. Broken in: Fixed in: |
…hton ... really this time `:)` I went for the simpler fix after all since it turned out to become a bit too complicated to extract the current iteration value from its containing `Option` with the different memory layouts it can have. It's also what we already do for match bindings. I also extended the new test case to include the "simple identifier" case. Fixes #20127, fixes #19732
If it helps, I can add my stackstrace:
Rust version is
and the code I'm trying to compile is
|
Sorry, my bad. With the last nightly my error seems solved. |
Happens with the latest commit (34d6800)
The text was updated successfully, but these errors were encountered: