Skip to content

Panic with incremental compilation: None.unwrap() in rustc_incremental::persist::hash::HashContext::hash #44804

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
Rufflewind opened this issue Sep 24, 2017 · 2 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Rufflewind
Copy link
Contributor

I ran into this with CARGO_INCREMENTAL=1 cargo run --release. Incremental compilation was working just fine for the past few hours, but suddenly it panicked after I refactored a bunch of code from src/bin/X.rs to src/lib.rs.

Unfortunately, I wasn't able to reproduce this panic after calling cargo clean.

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: rustc 1.22.0-nightly (14039a42a 2017-09-22) running on x86_64-unknown-linux-gnu

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

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:538
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:51
  10: rustc_incremental::persist::hash::HashContext::hash
  11: rustc_incremental::persist::load::decode_dep_graph
  12: rustc_incremental::persist::load::load_dep_graph
  13: rustc::ty::context::TyCtxt::create_and_enter
  14: rustc_driver::driver::compile_input
  15: rustc_driver::run_compiler
@Rufflewind Rufflewind changed the title Panic with incremental compilation Panic with incremental compilation: None.unwrap() in rustc_incremental::persist::hash::HashContext::hash Sep 24, 2017
@TimNN TimNN added A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Sep 24, 2017
@michaelwoerister
Copy link
Member

Thanks for the bug report!

As of #44772, which was only merged very recently, the HashContext type is completely gone, but it's possible that a variation of the bug still exists. Would you mind re-testing with the latest nightly?

@Rufflewind
Copy link
Contributor Author

Okay, I'll update my nightly and let you know if I run into a crash again. Thanks!

I guess I may as well close this for now.

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 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants