rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.61k stars 12.48k forks source link

ICE at rustc_middle::ty::query::try_load_from_on_disk_cache #82027

Closed scaphe closed 1 year ago

scaphe commented 3 years ago

Code


Lots of code I'm afraid, about 3k loc, 7 modules, with subdirs

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (f0f68778f 2020-12-09)
binary: rustc
commit-hash: f0f68778f798d6d34649745b41770829b17ba5b8
commit-date: 2020-12-09
host: x86_64-pc-windows-gnu
release: 1.50.0-nightly

Error output


dave@FIFTEEN MINGW64 /c/working/rust/miloop (master)
$ cargo test --verbose
       Fresh autocfg v1.0.1
       Fresh unicode-xid v0.2.1
       Fresh cfg-if v1.0.0
       Fresh ppv-lite86 v0.2.10
       Fresh scopeguard v1.1.0
       Fresh itoa v0.4.7
       Fresh lazy_static v1.4.0
       Fresh futures-core v0.3.12
       Fresh futures-sink v0.3.12
       Fresh memalloc v0.1.0
       Fresh either v1.6.1
       Fresh proc-macro2 v1.0.24
       Fresh winapi-x86_64-pc-windows-gnu v0.4.0
       Fresh lock_api v0.4.2
       Fresh winapi v0.3.9
       Fresh getrandom v0.2.2
       Fresh quote v1.0.8
       Fresh libc v0.2.85
       Fresh bitflags v1.2.1
       Fresh ryu v1.0.5
       Fresh spinning_top v0.2.2
       Fresh syn v1.0.60
       Fresh num-traits v0.2.14
       Fresh time v0.1.43
       Fresh rand_core v0.6.1
       Fresh nanorand v0.5.2
       Fresh remove_dir_all v0.5.3
       Fresh uuid v0.8.2
       Fresh midir v0.7.0
       Fresh num-integer v0.1.44
       Fresh serde_derive v1.0.123
       Fresh rand_chacha v0.3.0
       Fresh pin-project-internal v1.0.5
       Fresh chrono v0.4.19
       Fresh serde v1.0.123
       Fresh pin-project v1.0.5
       Fresh rand v0.8.3
       Fresh minalog v0.1.0 (C:\working\rust\minalog)
       Fresh timer v0.2.0
       Fresh tempfile v3.2.0
       Fresh serde_json v1.0.62
       Fresh flume v0.10.2
   Compiling miloop v0.1.0 (C:\working\rust\miloop)
     Running `rustc --crate-name miloop --edition=2018 'src\main.rs' --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=6dc446e2b8bf5e2c -C extra-filename=-6dc446e2b8bf5e2c --out-dir 'C:\working\rust\miloop\target\debug\deps' -C 'incremental=C:\working\rust\miloop\target\debug\incremental' -L 'dependency=C:\working\rust\miloop\target\debug\deps' --extern 'chrono=C:\working\rust\miloop\target\debug\deps\libchrono-58706159c465cca8.rlib' --extern 'either=C:\working\rust\miloop\target\debug\deps\libeither-ea9a994152243437.rlib' --extern 'flume=C:\working\rust\miloop\target\debug\deps\libflume-9a327069e6fabd5d.rlib' --extern 'midir=C:\working\rust\miloop\target\debug\deps\libmidir-6edbaf86fbfb8a74.rlib' --extern 'minalog=C:\working\rust\miloop\target\debug\deps\libminalog-9c21031e9d002305.rlib' --extern 'serde=C:\working\rust\miloop\target\debug\deps\libserde-23b389c7e6076f36.rlib' --extern 'serde_json=C:\working\rust\miloop\target\debug\deps\libserde_json-4b16a51f76e561d1.rlib' --extern 'tempfile=C:\working\rust\miloop\target\debug\deps\libtempfile-00b2878758a7fc2c.rlib' --extern 'timer=C:\working\rust\miloop\target\debug\deps\libtimer-6a2d533cc8262ead.rlib' --extern 'uuid=C:\working\rust\miloop\target\debug\deps\libuuid-6b8d6e4f58093cd9.rlib' -L 'native=C:\Users\dave\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-x86_64-pc-windows-gnu-0.4.0\lib'`
thread 'rustc' panicked at 'Failed to recover key for type_of(232faba9fa9763cb-67a35d6dc40d7ed2) with hash 232faba9fa9763cb-67a35d6dc40d7ed2', compiler\rustc_middle\src\ty\query\mod.rs:235:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\std\src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\std\src/panicking.rs:435:5
   2: rustc_middle::ty::query::try_load_from_on_disk_cache::{{closure}}
   3: rustc_middle::ty::query::try_load_from_on_disk_cache
   4: rustc_query_system::dep_graph::graph::DepGraph<K>::exec_cache_promotions
   5: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   6: rustc_incremental::persist::save::save_in
   7: rustc_data_structures::sync::join
   8: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   9: rustc_incremental::persist::save::save_dep_graph
  10: rustc_codegen_ssa::base::finalize_tcx
  11: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_interface::passes::QueryContext::enter
  14: rustc_interface::queries::Queries::ongoing_codegen
  15: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  16: rustc_span::with_source_map
  17: rustc_interface::interface::create_compiler_and_run
  18: 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.50.0-nightly (f0f68778f 2020-12-09) running on x86_64-pc-windows-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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

query stack during panic:
end of query stack
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `LLVMing`,
 right: `Codegenning`', /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\compiler\rustc_codegen_ssa\src\back\write.rs:1425:21
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\std\src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\core\src/panicking.rs:92:14
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.50.0-nightly (f0f68778f 2020-12-09) running on x86_64-pc-windows-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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

query stack during panic:
end of query stack
error: could not compile `miloop`

Caused by:
  process didn't exit successfully: `rustc --crate-name miloop --edition=2018 'src\main.rs' --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=6dc446e2b8bf5e2c -C extra-filename=-6dc446e2b8bf5e2c --out-dir 'C:\working\rust\miloop\target\debug\deps' -C 'incremental=C:\working\rust\miloop\target\debug\incremental' -L 'dependency=C:\working\rust\miloop\target\debug\deps' --extern 'chrono=C:\working\rust\miloop\target\debug\deps\libchrono-58706159c465cca8.rlib' --extern 'either=C:\working\rust\miloop\target\debug\deps\libeither-ea9a994152243437.rlib' --extern 'flume=C:\working\rust\miloop\target\debug\deps\libflume-9a327069e6fabd5d.rlib' --extern 'midir=C:\working\rust\miloop\target\debug\deps\libmidir-6edbaf86fbfb8a74.rlib' --extern 'minalog=C:\working\rust\miloop\target\debug\deps\libminalog-9c21031e9d002305.rlib' --extern 'serde=C:\working\rust\miloop\target\debug\deps\libserde-23b389c7e6076f36.rlib' --extern 'serde_json=C:\working\rust\miloop\target\debug\deps\libserde_json-4b16a51f76e561d1.rlib' --extern 'tempfile=C:\working\rust\miloop\target\debug\deps\libtempfile-00b2878758a7fc2c.rlib' --extern 'timer=C:\working\rust\miloop\target\debug\deps\libtimer-6a2d533cc8262ead.rlib' --extern 'uuid=C:\working\rust\miloop\target\debug\deps\libuuid-6b8d6e4f58093cd9.rlib' -L 'native=C:\Users\dave\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-x86_64-pc-windows-gnu-0.4.0\lib'` (exit code: 101)
Backtrace

``` 0: rust_begin_unwind at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\std\src/panicking.rs:493:5 1: std::panicking::begin_panic_fmt at /rustc/f0f68778f798d6d34649745b41770829b17ba5b8\/library\std\src/panicking.rs:435:5 2: rustc_middle::ty::query::try_load_from_on_disk_cache::{{closure}} 3: rustc_middle::ty::query::try_load_from_on_disk_cache 4: rustc_query_system::dep_graph::graph::DepGraph::exec_cache_promotions 5: rustc_middle::dep_graph::::with_deps 6: rustc_incremental::persist::save::save_in 7: rustc_data_structures::sync::join 8: rustc_middle::dep_graph::::with_deps 9: rustc_incremental::persist::save::save_dep_graph 10: rustc_codegen_ssa::base::finalize_tcx 11: ::codegen_crate 12: rustc_session::utils::::time 13: rustc_interface::passes::QueryContext::enter 14: rustc_interface::queries::Queries::ongoing_codegen 15: rustc_interface::queries::::enter 16: rustc_span::with_source_map 17: rustc_interface::interface::create_compiler_and_run 18: scoped_tls::ScopedKey::set```

scaphe commented 3 years ago

fyi, clean build fixed it

Aaron1011 commented 3 years ago

This should be fixed in the latest nightly.

Enselic commented 1 year ago

Triage: Without a way for others to reproduce the ICE, not much can be done at this point. Closing.