Skip to content

panicked at 'forcing query with already existing DepNode #11500

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

Closed
andrewrodriguez-m opened this issue Sep 13, 2023 · 5 comments
Closed

panicked at 'forcing query with already existing DepNode #11500

andrewrodriguez-m opened this issue Sep 13, 2023 · 5 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@andrewrodriguez-m
Copy link

Summary

I get an ICE when using clippy. Can repro by checking out MaterializeInc/materialize@df05910 from MaterializeInc/materialize#21740 and running cargo clippy --all-targets -- -D warnings after a cargo clean.

Version

rustc 1.72.0 (5680fa18f 2023-08-23)
binary: rustc
commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be
commit-date: 2023-08-23
host: aarch64-apple-darwin
release: 1.72.0
LLVM version: 16.0.5

Error output

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: (ByRef { alloc: ConstAllocation { .. }, offset: Size(0 bytes) }, catalog::builtin::BuiltinCluster)
- dep-node: try_destructure_mir_constant_for_diagnostics(74741c8dbd61c8ee-26d06aa32633f5b4)', /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/compiler/rustc_query_system/src/dep_graph/graph.rs:351:9
stack backtrace:
   0:        0x1039423c0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h523fafbfdb8f0857
   1:        0x103996450 - core::fmt::write::hf94a55b5a3abd106
   2:        0x103937d38 - std::io::Write::write_fmt::hc7c6bf1da111b052
   3:        0x103942218 - std::sys_common::backtrace::print::h68ede8fb1e716cba
   4:        0x103944d94 - std::panicking::default_hook::{{closure}}::hba2205c2705c60bb
   5:        0x103944b24 - std::panicking::default_hook::h9d927e01472bad1a
   6:        0x10be89034 - rustc_driver_impl[e09643758e6f6376]::install_ice_hook::{closure#0}
   7:        0x103945514 - std::panicking::rust_panic_with_hook::h8654c51ef9980a29
   8:        0x1039452e8 - std::panicking::begin_panic_handler::{{closure}}::hd188a636b3b90298
   9:        0x1039427a0 - std::sys_common::backtrace::__rust_end_short_backtrace::hc331d455ac21f427
  10:        0x103945054 - _rust_begin_unwind
  11:        0x1039c1444 - core::panicking::panic_fmt::h4f2054f72ff905b1
  12:        0x10efe7b98 - rustc_query_system[b4230c255e5b9403]::query::plumbing::try_execute_query::<rustc_query_impl[bcaa985f447c9306]::DynamicConfig<rustc_query_system[b4230c255e5b9403]::query::caches::DefaultCache<(rustc_middle[bded664fc7f58a73]::mir::interpret::value::ConstValue, rustc_middle[bded664fc7f58a73]::ty::Ty), rustc_middle[bded664fc7f58a73]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[bcaa985f447c9306]::plumbing::QueryCtxt, true>
  13:        0x10f1431e0 - rustc_query_impl[bcaa985f447c9306]::query_impl::try_destructure_mir_constant_for_diagnostics::get_query_incr::__rust_end_short_backtrace
  14:        0x102c1c494 - clippy_utils[45953a6625f151f0]::consts::field_of_struct
  15:        0x102c1ac70 - <clippy_utils[45953a6625f151f0]::consts::ConstEvalLateContext>::expr
  16:        0x102c9afc4 - <clippy_utils[45953a6625f151f0]::hir_utils::HirEqInterExpr>::eq_expr
  17:        0x102c9b264 - <clippy_utils[45953a6625f151f0]::hir_utils::HirEqInterExpr>::eq_expr
  18:        0x102c9d568 - clippy_utils[45953a6625f151f0]::hir_utils::eq_expr_value
  19:        0x1029bcebc - clippy_utils[45953a6625f151f0]::search_same::<&rustc_hir[33dde4395bd09da6]::hir::Expr, clippy_lints[e2b0f6397c34f5bd]::copies::lint_same_cond::{closure#0}, clippy_lints[e2b0f6397c34f5bd]::copies::lint_same_cond::{closure#1}>
  20:        0x102a49544 - <clippy_lints[e2b0f6397c34f5bd]::copies::CopyAndPaste as rustc_lint[c404b8ed850dd8f8]::passes::LateLintPass>::check_expr
  21:        0x10f8cf074 - <rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass as rustc_lint[c404b8ed850dd8f8]::passes::LateLintPass>::check_expr
  22:        0x10bff3598 - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_expr
  23:        0x10bfa4900 - rustc_hir[33dde4395bd09da6]::intravisit::walk_expr::<rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass>>
  24:        0x10bff35a4 - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_expr
  25:        0x10bff3834 - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_nested_body
  26:        0x10bfa1160 - rustc_hir[33dde4395bd09da6]::intravisit::walk_impl_item::<rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass>>
  27:        0x10bff4a34 - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_nested_impl_item
  28:        0x10bfa5a24 - rustc_hir[33dde4395bd09da6]::intravisit::walk_item::<rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass>>
  29:        0x10bff41cc - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_nested_item
  30:        0x10bfa5540 - rustc_hir[33dde4395bd09da6]::intravisit::walk_item::<rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass>>
  31:        0x10bff41cc - <rustc_lint[c404b8ed850dd8f8]::late::LateContextAndPass<rustc_lint[c404b8ed850dd8f8]::late::RuntimeCombinedLateLintPass> as rustc_hir[33dde4395bd09da6]::intravisit::Visitor>::visit_nested_item
  32:        0x10bff0fc4 - rustc_lint[c404b8ed850dd8f8]::late::late_lint_crate::<rustc_lint[c404b8ed850dd8f8]::BuiltinCombinedLateLintPass>
  33:        0x10bf9ea80 - <rustc_session[81931be3b0b4dc13]::session::Session>::time::<(), rustc_lint[c404b8ed850dd8f8]::late::check_crate<rustc_lint[c404b8ed850dd8f8]::BuiltinCombinedLateLintPass, rustc_interface[a43b58d3432b23e3]::passes::analysis::{closure#5}::{closure#1}::{closure#2}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
  34:        0x10bf9edf0 - <rustc_session[81931be3b0b4dc13]::session::Session>::time::<(), rustc_interface[a43b58d3432b23e3]::passes::analysis::{closure#5}::{closure#1}::{closure#2}::{closure#0}>
  35:        0x10bfefba0 - <core[f9d6478373b114c5]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[a43b58d3432b23e3]::passes::analysis::{closure#5}::{closure#1}> as core[f9d6478373b114c5]::ops::function::FnOnce<()>>::call_once
  36:        0x10bfa03d8 - <rustc_session[81931be3b0b4dc13]::session::Session>::time::<(), rustc_interface[a43b58d3432b23e3]::passes::analysis::{closure#5}>
  37:        0x10c013edc - rustc_interface[a43b58d3432b23e3]::passes::analysis
  38:        0x10f025b74 - rustc_query_impl[bcaa985f447c9306]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[bcaa985f447c9306]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bded664fc7f58a73]::query::erase::Erased<[u8; 1usize]>>
  39:        0x10f0fe964 - <rustc_query_impl[bcaa985f447c9306]::query_impl::analysis::dynamic_query::{closure#2} as core[f9d6478373b114c5]::ops::function::FnOnce<(rustc_middle[bded664fc7f58a73]::ty::context::TyCtxt, ())>>::call_once
  40:        0x10ef9d53c - rustc_query_system[b4230c255e5b9403]::query::plumbing::try_execute_query::<rustc_query_impl[bcaa985f447c9306]::DynamicConfig<rustc_query_system[b4230c255e5b9403]::query::caches::SingleCache<rustc_middle[bded664fc7f58a73]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[bcaa985f447c9306]::plumbing::QueryCtxt, true>
  41:        0x10f0698f4 - rustc_query_impl[bcaa985f447c9306]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  42:        0x10bebcd64 - <rustc_middle[bded664fc7f58a73]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[e09643758e6f6376]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>
  43:        0x10be8e0a4 - <rustc_interface[a43b58d3432b23e3]::interface::Compiler>::enter::<rustc_driver_impl[e09643758e6f6376]::run_compiler::{closure#1}::{closure#2}, core[f9d6478373b114c5]::result::Result<core[f9d6478373b114c5]::option::Option<rustc_interface[a43b58d3432b23e3]::queries::Linker>, rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>
  44:        0x10bebba58 - rustc_span[ba98f16c60603a35]::set_source_map::<core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>, rustc_interface[a43b58d3432b23e3]::interface::run_compiler<core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>, rustc_driver_impl[e09643758e6f6376]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  45:        0x10bece310 - std[5f883c90b3b6ecb9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a43b58d3432b23e3]::util::run_in_thread_pool_with_globals<rustc_interface[a43b58d3432b23e3]::interface::run_compiler<core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>, rustc_driver_impl[e09643758e6f6376]::run_compiler::{closure#1}>::{closure#0}, core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>
  46:        0x10becef08 - <<std[5f883c90b3b6ecb9]::thread::Builder>::spawn_unchecked_<rustc_interface[a43b58d3432b23e3]::util::run_in_thread_pool_with_globals<rustc_interface[a43b58d3432b23e3]::interface::run_compiler<core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>, rustc_driver_impl[e09643758e6f6376]::run_compiler::{closure#1}>::{closure#0}, core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[f9d6478373b114c5]::result::Result<(), rustc_span[ba98f16c60603a35]::ErrorGuaranteed>>::{closure#1} as core[f9d6478373b114c5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  47:        0x10394dd58 - std::sys::unix::thread::Thread::new::thread_start::h143a83d9ede86d5c
  48:        0x192a53fa8 - __pthread_joiner_wake

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: rustc 1.72.0 (5680fa18f 2023-08-23) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

@andrewrodriguez-m andrewrodriguez-m added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Sep 13, 2023
@andrewrodriguez-m
Copy link
Author

andrewrodriguez-m commented Sep 13, 2023

Can't repro after setting env CARGO_INCREMENTAL=0

@y21
Copy link
Member

y21 commented Sep 13, 2023

Looking at the ICE message, rust-lang/rust#115819 probably fixes this, cc @oli-obk is that right?

@oli-obk
Copy link
Contributor

oli-obk commented Sep 14, 2023

I expect it to, yes.

@y21
Copy link
Member

y21 commented Sep 25, 2023

ICE doesn't seem to reproduce anymore on latest nightly, I'm guessing this was fixed by rust-lang/rust#116052 (which, from what I can tell superseded the other PR?)

rustc -Vv
rustc 1.74.0-nightly (37390d656 2023-09-24)
binary: rustc
commit-hash: 37390d65636dd67e263753a3c04fbc60dcc4348e
commit-date: 2023-09-24
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0

@flip1995
Copy link
Member

Thanks for keeping track! Closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants