rust-lang / rust

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

the compiler unexpectedly panicked (when running this command: cargo test --color=always --no-run --package cache_proj --lib cache::bucket::tests) #95201

Closed zvi-code closed 8 months ago

zvi-code commented 2 years ago

Code

<code>

Meta

rustc --version --verbose:

rustc 1.56.1
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.56.1
LLVM version: 13.0.0

Error output

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1147:9
stack backtrace:
   0:        0x106b9c861 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c9c2c58a5e55211
   1:        0x106bed72b - core::fmt::write::h2d5ecb4b9764759c
   2:        0x106b8de3a - std::io::Write::write_fmt::hbb2ed9492eac32a2
   3:        0x106b9f9c5 - std::panicking::default_hook::{{closure}}::h39365228a3bf0aa2
   4:        0x106b9f5af - std::panicking::default_hook::h8ca622aa16a42db0
   5:        0x10830c3b0 - rustc_driver[8702e6016a2d953f]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x106ba0206 - std::panicking::rust_panic_with_hook::ha8b89b2b3829767b
   7:        0x10c990b91 - std[69c2830741c23f7e]::panicking::begin_panic::<rustc_errors[7f9540041f075328]::ExplicitBug>::{closure#0}
   8:        0x10c990a99 - std[69c2830741c23f7e]::sys_common::backtrace::__rust_end_short_backtrace::<std[69c2830741c23f7e]::panicking::begin_panic<rustc_errors[7f9540041f075328]::ExplicitBug>::{closure#0}, !>
   9:        0x10ccb8f21 - std[69c2830741c23f7e]::panicking::begin_panic::<rustc_errors[7f9540041f075328]::ExplicitBug>
  10:        0x10c9c0760 - std[69c2830741c23f7e]::panic::panic_any::<rustc_errors[7f9540041f075328]::ExplicitBug>
  11:        0x10c9c85ce - <rustc_errors[7f9540041f075328]::HandlerInner>::bug
  12:        0x10c9c63d7 - <rustc_errors[7f9540041f075328]::Handler>::bug
  13:        0x10c666d0f - rustc_middle[5473db7a6f082ce6]::ty::context::tls::with_opt::<rustc_middle[5473db7a6f082ce6]::util::bug::opt_span_bug_fmt<rustc_span[a08cc5ade0305263]::span_encoding::Span>::{closure#0}, ()>
  14:        0x10c666d8b - rustc_middle[5473db7a6f082ce6]::util::bug::opt_span_bug_fmt::<rustc_span[a08cc5ade0305263]::span_encoding::Span>
  15:        0x10ccabb86 - rustc_middle[5473db7a6f082ce6]::util::bug::bug_fmt
  16:        0x10ad9fd4e - rustc_typeck[72f05ee69e92895f]::collect::adt_def
  17:        0x10bb010bf - <rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepGraph<rustc_middle[5473db7a6f082ce6]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[5473db7a6f082ce6]::ty::context::TyCtxt, rustc_span[a08cc5ade0305263]::def_id::DefId, &rustc_middle[5473db7a6f082ce6]::ty::adt::AdtDef>
  18:        0x10ba47db1 - rustc_data_structures[5e52a2b4416cafe3]::stack::ensure_sufficient_stack::<(&rustc_middle[5473db7a6f082ce6]::ty::adt::AdtDef, rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepNodeIndex), rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::execute_job<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt, rustc_span[a08cc5ade0305263]::def_id::DefId, &rustc_middle[5473db7a6f082ce6]::ty::adt::AdtDef>::{closure#3}>
  19:        0x10b8ae691 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::try_execute_query::<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt, rustc_query_system[af5ff6f8e7ca742d]::query::caches::DefaultCache<rustc_span[a08cc5ade0305263]::def_id::DefId, &rustc_middle[5473db7a6f082ce6]::ty::adt::AdtDef>>
  20:        0x10b841591 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::force_query::<rustc_query_impl[ef74b726d3255e86]::queries::adt_def, rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt>
  21:        0x10ba74dec - rustc_query_impl[ef74b726d3255e86]::query_callbacks::adt_def::force_from_dep_node
  22:        0x10c6bc1dc - <rustc_middle[5473db7a6f082ce6]::ty::context::TyCtxt as rustc_query_system[af5ff6f8e7ca742d]::dep_graph::DepContext>::try_force_from_dep_node
  23:        0x10bad4d9d - <rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepGraph<rustc_middle[5473db7a6f082ce6]::dep_graph::dep_node::DepKind>>::try_mark_previous_green::<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt>
  24:        0x10ba970e0 - <rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepGraph<rustc_middle[5473db7a6f082ce6]::dep_graph::dep_node::DepKind>>::try_mark_green::<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt>
  25:        0x10b847450 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::ensure_must_run::<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt, rustc_span[a08cc5ade0305263]::def_id::DefId, alloc[6b2a4c4c8c58ee9a]::vec::Vec<&rustc_middle[5473db7a6f082ce6]::mir::coverage::CodeRegion>>
  26:        0x10b941ad0 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::get_query::<rustc_query_impl[ef74b726d3255e86]::queries::check_match, rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt>
  27:        0x1084cce09 - <rustc_middle[5473db7a6f082ce6]::hir::map::Map>::par_body_owners::<rustc_interface[36a618782d12d380]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  28:        0x1084f0490 - <rustc_session[84d5bb8c04871b82]::session::Session>::time::<(), rustc_interface[36a618782d12d380]::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  29:        0x1084f2287 - <rustc_session[84d5bb8c04871b82]::session::Session>::time::<(), rustc_interface[36a618782d12d380]::passes::analysis::{closure#1}>
  30:        0x1084478ac - rustc_interface[36a618782d12d380]::passes::analysis
  31:        0x10bb1aebc - <rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepGraph<rustc_middle[5473db7a6f082ce6]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[5473db7a6f082ce6]::ty::context::TyCtxt, (), core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>
  32:        0x10ba3eda5 - rustc_data_structures[5e52a2b4416cafe3]::stack::ensure_sufficient_stack::<(core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_query_system[af5ff6f8e7ca742d]::dep_graph::graph::DepNodeIndex), rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::execute_job<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt, (), core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>::{closure#3}>
  33:        0x10b8dd3c5 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::try_execute_query::<rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt, rustc_query_system[af5ff6f8e7ca742d]::query::caches::DefaultCache<(), core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>>
  34:        0x10b974b65 - rustc_query_system[af5ff6f8e7ca742d]::query::plumbing::get_query::<rustc_query_impl[ef74b726d3255e86]::queries::analysis, rustc_query_impl[ef74b726d3255e86]::plumbing::QueryCtxt>
  35:        0x10837586b - <rustc_interface[36a618782d12d380]::passes::QueryContext>::enter::<rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>
  36:        0x1083578a0 - <rustc_interface[36a618782d12d380]::interface::Compiler>::enter::<rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}::{closure#2}, core[f4889159fda6615f]::result::Result<core[f4889159fda6615f]::option::Option<rustc_interface[36a618782d12d380]::queries::Linker>, rustc_errors[7f9540041f075328]::ErrorReported>>
  37:        0x10831b0fa - rustc_span[a08cc5ade0305263]::with_source_map::<core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_interface[36a618782d12d380]::interface::create_compiler_and_run<core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}>::{closure#0}>
  38:        0x10835881c - <scoped_tls[504a04b5a30bb02b]::ScopedKey<rustc_span[a08cc5ade0305263]::SessionGlobals>>::set::<rustc_interface[36a618782d12d380]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[36a618782d12d380]::interface::run_compiler<core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}>::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>::{closure#0}::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>
  39:        0x1083253d2 - std[69c2830741c23f7e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[36a618782d12d380]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[36a618782d12d380]::interface::run_compiler<core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}>::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>
  40:        0x1083121c5 - <<std[69c2830741c23f7e]::thread::Builder>::spawn_unchecked<rustc_interface[36a618782d12d380]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[36a618782d12d380]::interface::run_compiler<core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>, rustc_driver[8702e6016a2d953f]::run_compiler::{closure#1}>::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>::{closure#0}, core[f4889159fda6615f]::result::Result<(), rustc_errors[7f9540041f075328]::ErrorReported>>::{closure#1} as core[f4889159fda6615f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:        0x106baa017 - std::sys::unix::thread::Thread::new::thread_start::h96b3fd9d7d5e1337
  42:     0x7fff204e08fc - __pthread_start

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.58.0-nightly (46b8e7488 2021-11-07) running on x86_64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental -C target-cpu=native -C opt-level=3 -C debuginfo=0 -C target-feature=+popcnt

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

query stack during panic:
#0 [adt_def] computing ADT definition for `cache::cl::CacheLine`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `cache_proj`

Process finished with exit code 101```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>
```

zvi-code commented 2 years ago

the issue appeared when i was running specific test with the CLion UI [probably unrelated but might trigger unusual build], same code run just fine from terminal, i'm not sure what is the difference

Enselic commented 8 months ago

Triage: We're going to need a way to reproduce this in order to make progress. Closing for now. Feel free to re-open if this is still a problem and after providing a way for others to reproduce.