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

OnDiskCache unwrap() panic #91487

Closed
roshangiyanani opened this issue Dec 3, 2021 · 2 comments
Closed

OnDiskCache unwrap() panic #91487

roshangiyanani opened this issue Dec 3, 2021 · 2 comments
Assignees
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

@roshangiyanani
Copy link

I was running cargo watch -x check -x test -x run on my code when I got this compiler error. I could reproduce it by re-running the cargo commands. Unfortunately, I ran a cargo clean while trying to minimize the bug, which made the error disappear (so maybe not that unfortunate xD). That's why I can't give you a reproducible error, or a full backtrace. I'm not even sure you'll find this useful, but figured I'd file a bug report anyway.

I can tell you I had just stashed some changes, and then was removing re-exports, so I bet the build cache was wacky. And I ran rustup update a few minutes before, so with no knowledge of how the build cache works, maybe something was cached from builds on the old compiler?

Meta

rustc --version --verbose:

✅ roshan@orpheus:rlox% rustc --version --verbose                                                            0:37:50
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: aarch64-apple-darwin
release: 1.57.0
LLVM version: 13.0.0

rustup update (from a few minutes before):

✅ roshan@orpheus:rlox% rustup update                                                                       19:09:43
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2021-12-02, rust version 1.57.0 (f1edd0429 2021-11-29)
info: downloading component 'rust-analysis'
info: downloading component 'rls'
info: downloading component 'rust-src'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
 23.1 MiB /  23.1 MiB (100 %)  13.8 MiB/s in  1s ETA:  0s
info: downloading component 'rustc'
 59.4 MiB /  59.4 MiB (100 %)  12.0 MiB/s in  4s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'rls'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'rust-analysis'
info: installing component 'rls'
info: installing component 'rust-src'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-std'
 23.1 MiB /  23.1 MiB (100 %)  11.3 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 59.4 MiB /  59.4 MiB (100 %)  13.1 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'
info: checking for self-updates

  stable-aarch64-apple-darwin updated - rustc 1.57.0 (f1edd0429 2021-11-29) (from rustc 1.56.1 (59eed8a2a 2021-11-01))

info: cleaning up downloads & tmp directories

Error output

    Checking rlox v0.1.0 (/Users/roshan/projects/rlox)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.57.0 (f1edd0429 2021-11-29) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rlox`
[Finished running. Exit status: 101]
Backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/compiler/rustc_hir/src/definitions.rs:452:14
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: <rustc_query_impl::on_disk_cache::OnDiskCache as rustc_middle::ty::context::OnDiskCache>::def_path_hash_to_def_id
   4: rustc_middle::dep_graph::dep_node::<impl rustc_query_system::dep_graph::dep_node::DepNodeParams<rustc_middle::ty::context::TyCtxt> for rustc_span::def_id::LocalDefId>::recover
   5: rustc_query_impl::query_callbacks::hir_owner::force_from_dep_node
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
   7: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
   8: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  10: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  12: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green
  13: rustc_query_system::query::plumbing::ensure_must_run
  14: rustc_query_system::query::plumbing::get_query
  15: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  16: rustc_data_structures::sync::par_for_each_in
  17: rustc_interface::passes::analysis
  18: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  19: rustc_data_structures::stack::ensure_sufficient_stack
  20: rustc_query_system::query::plumbing::try_execute_query
  21: rustc_query_system::query::plumbing::get_query
  22: rustc_interface::passes::QueryContext::enter
  23: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  24: rustc_span::with_source_map
  25: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.57.0 (f1edd0429 2021-11-29) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack

@roshangiyanani roshangiyanani added 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. labels Dec 3, 2021
@cjgillot cjgillot self-assigned this Dec 10, 2021
@cjgillot cjgillot added the A-incr-comp Area: Incremental compilation label Dec 10, 2021
@cjgillot
Copy link
Contributor

Thank you for the report!
Unfortunately, this is a known bug in the incremental compilation framework.
Closing as duplicate of #91696

@kud1ing
Copy link

kud1ing commented Dec 13, 2021

To be fair, this ticket is older, but somehow discussion gravitated around the other ticket. It was not obvious, which of the tickets were covering the same issue already.

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