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

ICE building rustc-benchmarks/syntex-0.42.2-incr-clean #37756

Closed
nnethercote opened this issue Nov 13, 2016 · 6 comments
Closed

ICE building rustc-benchmarks/syntex-0.42.2-incr-clean #37756

nnethercote opened this issue Nov 13, 2016 · 6 comments
Assignees
Labels
A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.

Comments

@nnethercote
Copy link
Contributor

Some time in the last 4 days a regression landed that triggers an ICE building rustc-benchmarks/syntex-0.42.2-incr-clean.

[fjord:~/moz/rustc-benchmarks/syntex-0.42.2-incr-clean] RUST_BACKTRACE=1 make
   Compiling bitflags v0.5.0
   Compiling log v0.3.6
   Compiling syntex_pos v0.42.0
   Compiling kernel32-sys v0.2.2
   Compiling term v0.4.4
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'no entry found for key', src/libcore/option.rs:705
stack backtrace:
   1:     0x7fb00caefc6a - std::sys::imp::backtrace::tracing::imp::write::ha2156e11066602a2
                        at /home/njn/moz/rust0/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x7fb00cb01dcf - std::panicking::default_hook::{{closure}}::h70ebd8ce6bd75731
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:247
   3:     0x7fb00cafe5f3 - std::panicking::default_hook::h5a66a97d9aca6050
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:257
   4:     0x7fb00cafec97 - std::panicking::rust_panic_with_hook::h7b4ed9ff58bb9497
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:451
   5:     0x7fb00cafeb24 - std::panicking::begin_panic::hf257d154c8aadb7f
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:413
   6:     0x7fb00cafea49 - std::panicking::begin_panic_fmt::h35e3973a25c255f0
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:397
   7:     0x7fb00cafe9d7 - rust_begin_unwind
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:373
   8:     0x7fb00cb197fd - core::panicking::panic_fmt::h65ab8084124ed138
                        at /home/njn/moz/rust0/src/libcore/panicking.rs:69
   9:     0x7fb00cb1986d - core::option::expect_failed::h3f88abc90d587e18
                        at /home/njn/moz/rust0/src/libcore/option.rs:705
  10:     0x7fb00b38ba08 - <rustc_incremental::calculate_svh::IncrementalHashesMap as core::ops::Index<&'a rustc::dep_graph::dep_node::DepNode<rustc::hir::def_id::DefId>>>::index::h9f561c02704b6f4a
                        at /home/njn/moz/rust0/src/libcore/option.rs:293
                        at /home/njn/moz/rust0/src/libstd/collections/hash/map.rs:1258
                        at /home/njn/moz/rust0/src/librustc_incremental/calculate_svh/mod.rs:90
  11:     0x7fb00b39a657 - rustc_incremental::persist::hash::HashContext::hash::hd460a12c1685a3c6
                        at /home/njn/moz/rust0/src/librustc_incremental/persist/hash.rs:72
  12:     0x7fb00b3a6783 - rustc_incremental::persist::save::save_dep_graph::h00259af9a2a10815
                        at /home/njn/moz/rust0/src/librustc_incremental/persist/preds.rs:66
                        at /home/njn/moz/rust0/src/libstd/collections/hash/map.rs:1716
                        at /home/njn/moz/rust0/src/librustc_incremental/persist/preds.rs:65
                        at /home/njn/moz/rust0/src/librustc_incremental/persist/save.rs:48
  13:     0x7fb00ce53171 - rustc_driver::driver::phase_4_translate_to_llvm::h65b6f5534c0d8fb0
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:1048
                        at /home/njn/moz/rust0/src/librustc/util/common.rs:38
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:1046
  14:     0x7fb00ce89267 - rustc_driver::driver::compile_input::{{closure}}::hb68cd038e02f12b3
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:206
  15:     0x7fb00ce862e7 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h496227122396fecd
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:994
  16:     0x7fb00ce47089 - rustc_driver::driver::phase_3_run_analysis_passes::hdd58cf84a69fd5d0
                        at /home/njn/moz/rust0/src/librustc/ty/context.rs:1019
                        at /home/njn/moz/rust0/src/libstd/thread/local.rs:245
                        at /home/njn/moz/rust0/src/librustc/ty/context.rs:1016
                        at /home/njn/moz/rust0/src/librustc/ty/context.rs:1003
                        at /home/njn/moz/rust0/src/libstd/thread/local.rs:245
                        at /home/njn/moz/rust0/src/librustc/ty/context.rs:1000
                        at /home/njn/moz/rust0/src/librustc/ty/context.rs:789
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:869
  17:     0x7fb00ce39314 - rustc_driver::driver::compile_input::hcb176206a1acaa32
                        at /home/njn/moz/rust0/src/librustc_driver/driver.rs:173
  18:     0x7fb00ce635b0 - rustc_driver::run_compiler::hc819c965890d033a
                        at /home/njn/moz/rust0/src/librustc_driver/lib.rs:222
  19:     0x7fb00cd9bc88 - std::panicking::try::do_call::ha64b01218316c9fa
                        at /home/njn/moz/rust0/src/librustc_driver/lib.rs:1141
                        at /home/njn/moz/rust0/src/librustc_driver/lib.rs:138
                        at /home/njn/moz/rust0/src/librustc_driver/lib.rs:1075
                        at /home/njn/moz/rust0/src/libstd/panic.rs:295
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:356
  20:     0x7fb00cb09b6a - __rust_maybe_catch_panic
                        at /home/njn/moz/rust0/src/libpanic_unwind/lib.rs:97
  21:     0x7fb00cdbf858 - <F as alloc::boxed::FnBox<A>>::call_box::habf47864505c2e68
                        at /home/njn/moz/rust0/src/libstd/panicking.rs:332
                        at /home/njn/moz/rust0/src/libstd/panic.rs:351
                        at /home/njn/moz/rust0/src/libstd/thread/mod.rs:287
                        at /home/njn/moz/rust0/src/liballoc/boxed.rs:595
  22:     0x7fb00cafd864 - std::sys::imp::thread::Thread::new::thread_start::h874e50b4a500d4b2
                        at /home/njn/moz/rust0/src/liballoc/boxed.rs:605
                        at /home/njn/moz/rust0/src/libstd/sys_common/thread.rs:21
                        at /home/njn/moz/rust0/src/libstd/sys/unix/thread.rs:84
  23:     0x7fb005b3d709 - start_thread
  24:     0x7fb00c7ba82c - clone
  25:                0x0 - <unknown>
@TimNN TimNN added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-incr-comp Area: Incremental compilation labels Nov 14, 2016
@alexcrichton alexcrichton added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Nov 14, 2016
@alexcrichton
Copy link
Member

cc @rust-lang/compiler, a new regression!

@michaelwoerister
Copy link
Member

cc me

@michaelwoerister michaelwoerister self-assigned this Nov 15, 2016
@michaelwoerister
Copy link
Member

I'm pretty sure that the following change is the cause:
872943c#diff-f55f5d2e86bc0e08c341b51fc78b27e4R835
We are encoding MacroDefs in metadata now but we are not computing the ICH of MacroDef HIR. When computing the ICH for a MacroDef metadata, we crash because we can't find the HIR ICH.

@eddyb
Copy link
Member

eddyb commented Nov 15, 2016

cc @jseyfried

bors added a commit that referenced this issue Nov 19, 2016
ICH: Handle MacroDef HIR instances.

As of recently, `hir::MacroDef` instances are exported in crate metadata, which means we also store their ICH when doing incremental compilation. Even though exported macro definitions should not (yet) interact with incremental compilation, the ICH is also used for the general purpose crate hash, where macros should be included.

This PR implements ICH computation for `MacroDef`. In theory, the ICH of these MacroDefs is less stable than that of other HIR items, since I opted to just call the compiler-generated `Hash::hash()` for `Token::Interpolated` variants. `Token::Interpolated` contains AST data structures and it would have been a lot of effort to expand ICH computation to the AST too. Since quasi-quoting is rarely used *and* it would only make a difference if incremental compilation was extended to macros, the simpler implementation seemed like a good idea.

This fixes the problem reported in #37756. The test still fails because of broken codegen-unit support though.

r? @nikomatsakis
@brson brson added the P-high High priority label Dec 1, 2016
@brson
Copy link
Contributor

brson commented Dec 1, 2016

@mw Is this fixed by #37787?

@brson
Copy link
Contributor

brson commented Dec 1, 2016

Looks like it is.

@brson brson closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

No branches or pull requests

6 participants