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 'called Option::unwrap() on a None value', compiler/rustc_metadata/src/rmeta/decoder.rs:975:64 #78236

Open
SimonSapin opened this issue Oct 22, 2020 · 5 comments
Assignees
Labels
A-incr-comp Area: Incremental compilation A-metadata Area: Crate metadata A-visibility Area: Visibility / privacy. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-incr-comp Working group: Incremental compilation

Comments

@SimonSapin
Copy link
Contributor

With this config.toml:

# Includes one of the default files in src/bootstrap/defaults
profile = "compiler"
changelog-seen = 2

[build]
low-priority = true

Running RUST_BACKTRACE=1 ./x.py test on commit 6b9fbf2 without code changes:

[]
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling rustc_serialize v0.0.0 (/home/simon/projects/rust/compiler/rustc_serialize)
   Compiling synstructure v0.12.4
   Compiling tracing-attributes v0.1.11
   Compiling rand_chacha v0.2.2
   Compiling rls-data v0.19.0
   Compiling parking_lot_core v0.6.2
   Compiling crossbeam-deque v0.7.3
   Compiling sha-1 v0.8.2
   Compiling md-5 v0.8.0
   Compiling chrono v0.4.15
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:975:64
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_visibility
   4: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::visibility
   5: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::force_query_impl
   9: rustc_middle::ty::query::force_from_dep_node
  10: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepContext for rustc_middle::ty::context::TyCtxt>::try_force_from_dep_node
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  12: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  14: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read
  15: rustc_query_system::query::plumbing::ensure_query_impl
  16: rustc_passes::check_attr::CheckAttrVisitor::check_attributes
  17: <rustc_passes::check_attr::CheckAttrVisitor as rustc_hir::intravisit::Visitor>::visit_impl_item
  18: rustc_middle::hir::map::Map::visit_item_likes_in_module
  19: rustc_passes::check_attr::check_mod_attrs
  20: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_attrs>::compute
  21: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  22: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  23: rustc_data_structures::stack::ensure_sufficient_stack
  24: rustc_query_system::query::plumbing::get_query_impl
  25: rustc_query_system::query::plumbing::ensure_query_impl
  26: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  27: std::panicking::try
  28: rustc_session::utils::<impl rustc_session::session::Session>::time
  29: rustc_interface::passes::analysis
  30: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  31: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  32: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  33: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  34: rustc_data_structures::stack::ensure_sufficient_stack
  35: rustc_query_system::query::plumbing::get_query_impl
  36: rustc_interface::passes::QueryContext::enter
  37: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  38: rustc_span::with_source_map
  39: rustc_interface::interface::create_compiler_and_run
  40: scoped_tls::ScopedKey<T>::set
  41: rustc_span::with_session_globals
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.49.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C incremental -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib

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

query stack during panic:
#0 [visibility] computing visibility of `indexmap::IndexMap::S`
#1 [check_mod_attrs] checking attributes in module `collection_impls`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rustc_serialize`
@SimonSapin SimonSapin added 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 Oct 22, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 22, 2020

Possibly related to #78077, cc @petrochenkov

@jyn514 jyn514 added A-visibility Area: Visibility / privacy. A-metadata Area: Crate metadata labels Oct 22, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 22, 2020

These are the current compiler defaults; maybe this only pops up with both incremental and a stage 2 build?

# These defaults are meant for contributors to the compiler who do not modify codegen or LLVM
[rust]
# This enables `RUSTC_LOG=debug`, avoiding confusing situations
# where adding `debug!()` appears to do nothing.
# However, it makes running the compiler slightly slower.
debug-logging = true
# This greatly increases the speed of rebuilds, especially when there are only minor changes. However, it makes the initial build slightly slower.
incremental = true

[llvm]
# Will download LLVM from CI if available on your platform (Linux only for now)
# https://github.com/rust-lang/rust/issues/77084 tracks support for more platforms
download-ci-llvm = "if-available"

@jyn514 jyn514 added the A-incr-comp Area: Incremental compilation label Oct 22, 2020
@SimonSapin
Copy link
Contributor Author

The commented lines in config.toml.example say that the default for build.test-stage is 1, but it appears that some tests require building the compiler a second time anyway? It’s that second build that fails.

@jyn514
Copy link
Member

jyn514 commented Oct 22, 2020

Related: #75905. That's weird x.py is building stage 2 though ... I'm not sure what's going on.

@pnkfelix pnkfelix self-assigned this Nov 3, 2020
@pnkfelix pnkfelix added WG-incr-comp Working group: Incremental compilation P-medium Medium priority labels Nov 3, 2020
@Enselic
Copy link
Member

Enselic commented Aug 29, 2023

Triage: Can this still be reproduced on latest master?

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 A-metadata Area: Crate metadata A-visibility Area: Visibility / privacy. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-incr-comp Working group: Incremental compilation
Projects
None yet
Development

No branches or pull requests

4 participants