Repository navigation
Flaky failure in query feeding on the parallel compiler: caller raced calls to put() #162316
Copy link
Copy link
Open
Labels
A-parallel-compilerArea: parallel compilerArea: parallel compilerC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Observed in a CI failure here: #162105 (comment)
thread 'rustc' (525478) panicked at compiler/rustc_data_structures/src/vec_cache.rs:179:23:
caller raced calls to put()
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: rustc_middle::query::calls::query_feed::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>>
3: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
4: <<dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}::GenericArgsCtxt as rustc_hir_analysis::hir_ty_lowering::GenericArgsLowerer>::provided_kind
5: rustc_hir_analysis::hir_ty_lowering::generics::lower_generic_args::<<dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}::GenericArgsCtxt>
6: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path
7: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_poly_trait_ref
8: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_bounds::<&[rustc_hir::hir::GenericBound]>
9: rustc_hir_analysis::collect::clauses_of::implied_clauses_with_filter
10: rustc_hir_analysis::collect::clauses_of::explicit_implied_clauses_of
[... omitted 1 frame ...]
11: rustc_hir_analysis::check::check::check_item_type
12: rustc_hir_analysis::check::wfcheck::check_well_formed
[... omitted 1 frame ...]
13: rustc_middle::query::calls::query_ensure_result::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 1]>, rustc_middle::dep_graph::graph::DepNodeIndex>, ()>
14: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::par_slice<&rustc_hir::hir::ItemId, rustc_data_structures::sync::parallel::try_par_for_each_in<&[rustc_hir::hir::ItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_items<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#1}::{closure#0}::{closure#0}>
15: <rustc_thread_pool::scope::ScopeBase>::execute_job_closure::<<rustc_thread_pool::scope::Scope>::spawn<rustc_data_structures::sync::parallel::par_slice<&rustc_hir::hir::ItemId, rustc_data_structures::sync::parallel::try_par_for_each_in<&[rustc_hir::hir::ItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_items<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#1}::{closure#0}>::{closure#0}::{closure#0}, ()>
16: <rustc_thread_pool::job::HeapJob<<rustc_thread_pool::scope::Scope>::spawn<rustc_data_structures::sync::parallel::par_slice<&rustc_hir::hir::ItemId, rustc_data_structures::sync::parallel::try_par_for_each_in<&[rustc_hir::hir::ItemId], rustc_span::ErrorGuaranteed, <rustc_middle::hir::ModuleItems>::par_items<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#1}::{closure#0}>::{closure#0}> as rustc_thread_pool::job::Job>::execute
17: <rustc_thread_pool::registry::WorkerThread>::wait_or_steal_until_cold
18: <rustc_thread_pool::registry::ThreadBuilder>::run
19: rustc_span::set_session_globals_then::<(), rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#5}::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Normally it's OK to feed the same query twice as long as both values are the same. However, from looking at query_feed there might be a race condition when two query calls try to feed the same query at the same time, see that the cache is empty, and then both try to fill the cache entry without further coordination.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-parallel-compilerArea: parallel compilerArea: parallel compilerC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
petrochenkov commentedon Sep 5, 2026
This happened when compiling
tests/ui/traits/alias/self-in-const-generics.rs(CI logs disappear with time).aerooneqq commentedon Sep 8, 2026
Reproduced locally, simple reproducer:
rustc ./tests/ui/traits/alias/self-in-const-generics.rs -Znext-solver=coherence -Zthreads=4, should reproduce within100_000launches. I want to try to fix it.@rustbot claim
JonathanBrouwer commentedon Sep 8, 2026
One more occurence here: #162474 (comment)
I'll add a
//@ ignore-parallel-frontend triageto the test for nowRollup merge of rust-lang#162494 - JonathanBrouwer:ignore-parallel, r…
Rollup merge of rust-lang#162494 - JonathanBrouwer:ignore-parallel, r…
Unrolled build for #162494 in rollup 162503