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: panicked at 'forcing query with already existing DepNode' #101518

Closed
djc opened this issue Sep 7, 2022 · 6 comments · May be fixed by #109050
Closed

ICE: panicked at 'forcing query with already existing DepNode' #101518

djc opened this issue Sep 7, 2022 · 6 comments · May be fixed by #109050
Assignees
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@djc
Copy link
Contributor

djc commented Sep 7, 2022

Code

For now I only have a branch, which can be found at https://github.com/InstantDomain/instant-xml/tree/ice-2. To reproduce, run cargo test with either stable (currently 1.63.0) or nightly. Using CARGO_INCREMENTAL=0 makes the problem go away. cargo clean doesn't help.

Meta

rustc --version --verbose:

cargo 1.65.0-nightly (4ed54cecc 2022-08-27)
release: 1.65.0-nightly
commit-hash: 4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5
commit-date: 2022-08-27
host: aarch64-apple-darwin
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.5.1 [64-bit]

Error output

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Val(ByRef { alloc: Allocation { bytes: [0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [(Size(0 bytes), alloc5), (Size(16 bytes), alloc27)] }), init_mask: InitMask { blocks: [4294967295], len: Size(32 bytes) }, align: Align(8 bytes), mutability: Not, extra: () }, offset: Size(0 bytes) }, instant_xml::de::Id) }
- dep-node: try_destructure_mir_constant(bc0148d6ccb6596f-ed23fac1cbe20fc0)', /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/compiler/rustc_query_system/src/dep_graph/graph.rs:300:9
Backtrace

stack backtrace:
   0:        0x102d2bfe0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h188b7ef1c7993e78
   1:        0x102d7da54 - core::fmt::write::he84a3004e7af3f34
   2:        0x102d1f0c0 - std::io::Write::write_fmt::h9370b50affaab0be
   3:        0x102d2ec24 - std::panicking::default_hook::{{closure}}::hc074f8023cce83ca
   4:        0x102d2e98c - std::panicking::default_hook::hef854b51b9b79ff2
   5:        0x10a19c154 - rustc_driver[8d2050f8429f7bc4]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x102d2f1f8 - std::panicking::rust_panic_with_hook::h1e59e224d558a492
   7:        0x102d2f090 - std::panicking::begin_panic_handler::{{closure}}::he1a9d6ab32bfd8c6
   8:        0x102d2c4bc - std::sys_common::backtrace::__rust_end_short_backtrace::he9b94791b02f48cd
   9:        0x102d2ede8 - _rust_begin_unwind
  10:        0x102dab968 - core::panicking::panic_fmt::h9fec86f6a9c4146e
  11:        0x10d1880d8 - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, rustc_middle[4fa9dd76776bb2aa]::ty::ParamEnvAnd<rustc_middle[4fa9dd76776bb2aa]::mir::ConstantKind>, core[bae5e8ef542d20e5]::option::Option<rustc_middle[4fa9dd76776bb2aa]::mir::query::DestructuredMirConstant>>
  12:        0x10d01fadc - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::try_destructure_mir_constant, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
  13:        0x10d26fd40 - <rustc_query_impl[d9716e6ec5023784]::Queries as rustc_middle[4fa9dd76776bb2aa]::ty::query::QueryEngine>::try_destructure_mir_constant
  14:        0x10dcb7f74 - <rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt>::destructure_mir_constant
  15:        0x10caac1d0 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::const_to_pat::ConstToPat>::recur
  16:        0x10caa1054 - <rustc_infer[b8df2f762d2af832]::infer::InferCtxtBuilder>::enter::<rustc_middle[4fa9dd76776bb2aa]::thir::Pat, <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::const_to_pat::{closure#0}>
  17:        0x10cac9968 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::const_to_pat
  18:        0x10caca058 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::lower_path
  19:        0x10cac6da8 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::lower_pattern
  20:        0x10ca9c1f0 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>::lower_pattern
  21:        0x10ca91b84 - <alloc[60e9ff9c62c1e93b]::vec::Vec<rustc_mir_build[d8c711f153adeead]::thir::pattern::usefulness::MatchArm> as alloc[60e9ff9c62c1e93b]::vec::spec_from_iter::SpecFromIter<rustc_mir_build[d8c711f153adeead]::thir::pattern::usefulness::MatchArm, core[bae5e8ef542d20e5]::iter::adapters::map::Map<core[bae5e8ef542d20e5]::slice::iter::Iter<rustc_hir[f8f7f977ec6e9d12]::hir::Arm>, <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>::check_match::{closure#0}>>>::from_iter
  22:        0x10ca9aea4 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  23:        0x10ca9ad3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  24:        0x10ca6a6ec - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_stmt::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  25:        0x10ca6a520 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  26:        0x10ca9ad3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  27:        0x10ca6a4a0 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  28:        0x10ca9ad3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  29:        0x10ca9ad3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  30:        0x10ca6a520 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  31:        0x10ca9ad3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  32:        0x10ca9a960 - rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::check_match
  33:        0x10d1a8a9c - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, rustc_span[143ffa354e326ede]::def_id::DefId, ()>
  34:        0x10cf7ee9c - rustc_query_system[f18d9eae22d44560]::query::plumbing::try_execute_query::<rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt, rustc_query_system[f18d9eae22d44560]::query::caches::DefaultCache<rustc_span[143ffa354e326ede]::def_id::DefId, ()>>
  35:        0x10cfe0de8 - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::check_match, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
  36:        0x10a243ebc - <rustc_middle[4fa9dd76776bb2aa]::hir::map::Map>::par_body_owners::<rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  37:        0x10a235ec8 - <rustc_session[282d64e95cd3bf88]::session::Session>::time::<(), rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  38:        0x10a237d7c - <rustc_session[282d64e95cd3bf88]::session::Session>::time::<(), rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}>
  39:        0x10a227f44 - rustc_interface[db32075e2a9c594e]::passes::analysis
thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Val(ByRef { alloc: Allocation { bytes: [0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [(Size(0 bytes), alloc88), (Size(16 bytes), alloc89)] }), init_mask: InitMask { blocks: [4294967295], len: Size(32 bytes) }, align: Align(8 bytes), mutability: Not, extra: () }, offset: Size(0 bytes) }, instant_xml::de::Id) }
- dep-node: try_destructure_mir_constant(bc0148d6ccb6596f-ed23fac1cbe20fc0)', /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/compiler/rustc_query_system/src/dep_graph/graph.rs:300:9
stack backtrace:
  40:        0x10d1b7b48 - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, (), core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  41:        0x10cf8c5d0 - rustc_query_system[f18d9eae22d44560]::query::plumbing::try_execute_query::<rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt, rustc_query_system[f18d9eae22d44560]::query::caches::DefaultCache<(), core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>>
  42:        0x10d02b54c - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::analysis, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
   0:        0x1014e7fe0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h188b7ef1c7993e78
   1:        0x101539a54 - core::fmt::write::he84a3004e7af3f34
   2:        0x1014db0c0 - std::io::Write::write_fmt::h9370b50affaab0be
   3:        0x1014eac24 - std::panicking::default_hook::{{closure}}::hc074f8023cce83ca
  43:        0x10a15e66c - <rustc_interface[db32075e2a9c594e]::passes::QueryContext>::enter::<rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  44:        0x10a1417f0 - <rustc_interface[db32075e2a9c594e]::interface::Compiler>::enter::<rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}::{closure#2}, core[bae5e8ef542d20e5]::result::Result<core[bae5e8ef542d20e5]::option::Option<rustc_interface[db32075e2a9c594e]::queries::Linker>, rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  45:        0x10a12dbb4 - rustc_span[143ffa354e326ede]::with_source_map::<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_interface[db32075e2a9c594e]::interface::create_compiler_and_run<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#1}>
  46:        0x10a141fe8 - <scoped_tls[e8c526b3ddc66487]::ScopedKey<rustc_span[143ffa354e326ede]::SessionGlobals>>::set::<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
   4:        0x1014ea98c - std::panicking::default_hook::hef854b51b9b79ff2
  47:        0x10a18cb68 - std[ad4c17a2ddbcabe2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  48:        0x10a160ef8 - <<std[ad4c17a2ddbcabe2]::thread::Builder>::spawn_unchecked_<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#1} as core[bae5e8ef542d20e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:        0x102d37a5c - std::sys::unix::thread::Thread::new::thread_start::h7b2f9b83fb320a20
  50:        0x1bc56026c - __pthread_deallocate

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.63.0 (4b91a6ea7 2022-08-08) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [try_destructure_mir_constant] destructuring mir constant
#1 [check_match] match-checking `<impl at instant-xml/tests/de-nested.rs:12:32: 12:39>::deserialize`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `instant-xml`
warning: build failed, waiting for other jobs to finish...
   5:        0x108958154 - rustc_driver[8d2050f8429f7bc4]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x1014eb1f8 - std::panicking::rust_panic_with_hook::h1e59e224d558a492
   7:        0x1014eb090 - std::panicking::begin_panic_handler::{{closure}}::he1a9d6ab32bfd8c6
   8:        0x1014e84bc - std::sys_common::backtrace::__rust_end_short_backtrace::he9b94791b02f48cd
   9:        0x1014eade8 - _rust_begin_unwind
  10:        0x101567968 - core::panicking::panic_fmt::h9fec86f6a9c4146e
  11:        0x10b9440d8 - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, rustc_middle[4fa9dd76776bb2aa]::ty::ParamEnvAnd<rustc_middle[4fa9dd76776bb2aa]::mir::ConstantKind>, core[bae5e8ef542d20e5]::option::Option<rustc_middle[4fa9dd76776bb2aa]::mir::query::DestructuredMirConstant>>
  12:        0x10b7dbadc - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::try_destructure_mir_constant, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
  13:        0x10ba2bd40 - <rustc_query_impl[d9716e6ec5023784]::Queries as rustc_middle[4fa9dd76776bb2aa]::ty::query::QueryEngine>::try_destructure_mir_constant
  14:        0x10c473f74 - <rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt>::destructure_mir_constant
  15:        0x10b2681d0 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::const_to_pat::ConstToPat>::recur
  16:        0x10b25d054 - <rustc_infer[b8df2f762d2af832]::infer::InferCtxtBuilder>::enter::<rustc_middle[4fa9dd76776bb2aa]::thir::Pat, <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::const_to_pat::{closure#0}>
  17:        0x10b285968 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::const_to_pat
  18:        0x10b286058 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::lower_path
  19:        0x10b282da8 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::PatCtxt>::lower_pattern
  20:        0x10b2581f0 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>::lower_pattern
  21:        0x10b24db84 - <alloc[60e9ff9c62c1e93b]::vec::Vec<rustc_mir_build[d8c711f153adeead]::thir::pattern::usefulness::MatchArm> as alloc[60e9ff9c62c1e93b]::vec::spec_from_iter::SpecFromIter<rustc_mir_build[d8c711f153adeead]::thir::pattern::usefulness::MatchArm, core[bae5e8ef542d20e5]::iter::adapters::map::Map<core[bae5e8ef542d20e5]::slice::iter::Iter<rustc_hir[f8f7f977ec6e9d12]::hir::Arm>, <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>::check_match::{closure#0}>>>::from_iter
  22:        0x10b256ea4 - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  23:        0x10b256d3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  24:        0x10b2266ec - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_stmt::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  25:        0x10b226520 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  26:        0x10b256d3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  27:        0x10b2264a0 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  28:        0x10b256d3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  29:        0x10b256d3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  30:        0x10b226520 - rustc_hir[f8f7f977ec6e9d12]::intravisit::walk_expr::<rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor>
  31:        0x10b256d3c - <rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::MatchVisitor as rustc_hir[f8f7f977ec6e9d12]::intravisit::Visitor>::visit_expr
  32:        0x10b256960 - rustc_mir_build[d8c711f153adeead]::thir::pattern::check_match::check_match
  33:        0x10b964a9c - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, rustc_span[143ffa354e326ede]::def_id::DefId, ()>
  34:        0x10b73ae9c - rustc_query_system[f18d9eae22d44560]::query::plumbing::try_execute_query::<rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt, rustc_query_system[f18d9eae22d44560]::query::caches::DefaultCache<rustc_span[143ffa354e326ede]::def_id::DefId, ()>>
  35:        0x10b79cde8 - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::check_match, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
  36:        0x1089ffebc - <rustc_middle[4fa9dd76776bb2aa]::hir::map::Map>::par_body_owners::<rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  37:        0x1089f1ec8 - <rustc_session[282d64e95cd3bf88]::session::Session>::time::<(), rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  38:        0x1089f3d7c - <rustc_session[282d64e95cd3bf88]::session::Session>::time::<(), rustc_interface[db32075e2a9c594e]::passes::analysis::{closure#1}>
  39:        0x1089e3f44 - rustc_interface[db32075e2a9c594e]::passes::analysis
  40:        0x10b973b48 - <rustc_query_system[f18d9eae22d44560]::dep_graph::graph::DepGraph<rustc_middle[4fa9dd76776bb2aa]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[4fa9dd76776bb2aa]::ty::context::TyCtxt, (), core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  41:        0x10b7485d0 - rustc_query_system[f18d9eae22d44560]::query::plumbing::try_execute_query::<rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt, rustc_query_system[f18d9eae22d44560]::query::caches::DefaultCache<(), core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>>
  42:        0x10b7e754c - rustc_query_system[f18d9eae22d44560]::query::plumbing::get_query::<rustc_query_impl[d9716e6ec5023784]::queries::analysis, rustc_query_impl[d9716e6ec5023784]::plumbing::QueryCtxt>
  43:        0x10891a66c - <rustc_interface[db32075e2a9c594e]::passes::QueryContext>::enter::<rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  44:        0x1088fd7f0 - <rustc_interface[db32075e2a9c594e]::interface::Compiler>::enter::<rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}::{closure#2}, core[bae5e8ef542d20e5]::result::Result<core[bae5e8ef542d20e5]::option::Option<rustc_interface[db32075e2a9c594e]::queries::Linker>, rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  45:        0x1088e9bb4 - rustc_span[143ffa354e326ede]::with_source_map::<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_interface[db32075e2a9c594e]::interface::create_compiler_and_run<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#1}>
  46:        0x1088fdfe8 - <scoped_tls[e8c526b3ddc66487]::ScopedKey<rustc_span[143ffa354e326ede]::SessionGlobals>>::set::<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  47:        0x108948b68 - std[ad4c17a2ddbcabe2]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>
  48:        0x10891cef8 - <<std[ad4c17a2ddbcabe2]::thread::Builder>::spawn_unchecked_<rustc_interface[db32075e2a9c594e]::util::run_in_thread_pool_with_globals<rustc_interface[db32075e2a9c594e]::interface::run_compiler<core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>, rustc_driver[8d2050f8429f7bc4]::run_compiler::{closure#1}>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#0}, core[bae5e8ef542d20e5]::result::Result<(), rustc_errors[3321b68084f70bb0]::ErrorGuaranteed>>::{closure#1} as core[bae5e8ef542d20e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:        0x1014f3a5c - std::sys::unix::thread::Thread::new::thread_start::h7b2f9b83fb320a20
  50:        0x1bc56026c - __pthread_deallocate

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.63.0 (4b91a6ea7 2022-08-08) running on aarch64-apple-darwin

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

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

query stack during panic:
#0 [try_destructure_mir_constant] destructuring mir constant
#1 [check_match] match-checking `<impl at instant-xml/tests/de-ns.rs:78:32: 78:39>::deserialize`
#2 [analysis] running analysis passes on this crate
end of query stack

#97858 had a similar error but seems to have been intermittent, while this reproduces every time.

@rustbot label +A-incr-comp +E-needs-mcve

cc @steffahn

@djc djc 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 Sep 7, 2022
@rustbot rustbot added A-incr-comp Area: Incremental compilation E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Sep 7, 2022
@cjgillot cjgillot self-assigned this Sep 7, 2022
@lqd
Copy link
Member

lqd commented Sep 7, 2022

Minimized:

#[derive(PartialEq, Eq)]
struct Id<'a> {
    ns: &'a str,
}
fn visit_struct() {
    let id = Id { ns: "random1" };
    const FLAG: Id<'static> = Id {
        ns: "needs_to_be_the_same",
    };
    match id {
        FLAG => {}
        _ => {}
    }
}
fn visit_struct2() {
    let id = Id { ns: "random2" };
    const FLAG: Id<'static> = Id {
        ns: "needs_to_be_the_same",
    };
    match id {
        FLAG => {}
        _ => {}
    }
}

godbolt shows it ICEs as far back as 1.42.0 from 03/2020.

@lqd lqd removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Sep 7, 2022
@cjgillot
Copy link
Contributor

cjgillot commented Sep 7, 2022

Thanks for the MCVE. I suspect an issue with AllocId, like most issues that feature the same exact ICE. Working on a refactor to get this unstability out of the way.

@steffahn
Copy link
Member

steffahn commented Sep 7, 2022

Ah, damn, I just minimized it, too xD

Looks roughly the same.

@steffahn
Copy link
Member

steffahn commented Sep 7, 2022

@rustbot label S-bug-has-mcve

Note that it only ICEs with incremental compilation turned on (hence e.g. it doesnt reproduce on the playground.

@rustbot rustbot added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Sep 7, 2022
@matthiaskrgr
Copy link
Member

This is probably a duplicate of #83085

matthiaskrgr added a commit to matthiaskrgr/glacier that referenced this issue Sep 8, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Sep 8, 2022
Manishearth added a commit to Manishearth/rust that referenced this issue Nov 14, 2022
…imulacrum

Add a few known-bug tests

The labels of these tests should be changed from `S-bug-has-mcve` to `S-bug-has-test` once this is merged.

cc:
rust-lang#101518
rust-lang#99492
rust-lang#90950
rust-lang#89196
rust-lang#104034
rust-lang#101350
rust-lang#103705
rust-lang#103899

I couldn't reproduce the failures in rust-lang#101962 and rust-lang#100772 (so either these have started passing, or I didn't repro properly), so leaving those out for now.

rust-lang#102065 was a bit more complicated, since it uses `rustc_private` and I didn't want to mess with that.
@jackh726 jackh726 added S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. and removed S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Nov 14, 2022
@apiraino
Copy link
Contributor

Hope it's fine to close in favor of #83085 (which has a patch for fixing the issue in progress)

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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants