Open matthiaskrgr opened 5 months ago
#0 0x00007ffff1775d80 in ?? () from /usr/lib/libc.so.6
#1 0x00007ffff5062575 in <hashbrown::raw::RawTable<(rustc_query_system::query::job::QueryJobId, rustc_query_system::query::job::QueryJobInfo)>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_query_system::query::job::QueryJobId, rustc_query_system::query::job::QueryJobInfo, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>::{closure#0}> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#2 0x00007ffff50b5fb6 in <hashbrown::map::HashMap<rustc_query_system::query::job::QueryJobId, rustc_query_system::query::job::QueryJobInfo, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>::insert ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#3 0x00007ffff506d555 in <rustc_query_system::query::plumbing::QueryState<()>>::try_collect_active_jobs::<rustc_middle::ty::context::TyCtxt> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#4 0x00007ffff51355fa in rustc_query_impl::query_impl::early_lint_checks::try_collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#5 0x00007ffff5129c7c in <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#6 0x00007ffff50815e1 in rustc_query_system::query::plumbing::cycle_error::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#7 0x00007ffff5c8981b in rustc_query_impl::query_impl::def_span::get_query_non_incr::__rust_end_short_backtrace () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#8 0x00007ffff5fccac6 in rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#9 0x00007ffff512b943 in rustc_query_impl::plumbing::create_query_frame::<rustc_span::def_id::LocalDefId> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#10 0x00007ffff511851b in <rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#11 0x00007ffff506b7da in <rustc_query_system::query::plumbing::QueryState<rustc_span::def_id::LocalDefId>>::try_collect_active_jobs::<rustc_middle::ty::context::TyCtxt> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#12 0x00007ffff5135c1a in rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#13 0x00007ffff5129c7c in <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#14 0x00007ffff50815e1 in rustc_query_system::query::plumbing::cycle_error::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#15 0x00007ffff5c8981b in rustc_query_impl::query_impl::def_span::get_query_non_incr::__rust_end_short_backtrace () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#16 0x00007ffff5fccac6 in rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#17 0x00007ffff512b943 in rustc_query_impl::plumbing::create_query_frame::<rustc_span::def_id::LocalDefId> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#18 0x00007ffff511851b in <rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#19 0x00007ffff506b7da in <rustc_query_system::query::plumbing::QueryState<rustc_span::def_id::LocalDefId>>::try_collect_active_jobs::<rustc_middle::ty::context::TyCtxt> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#20 0x00007ffff5135c1a in rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#21 0x00007ffff5129c7c in <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#22 0x00007ffff50815e1 in rustc_query_system::query::plumbing::cycle_error::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#23 0x00007ffff5c8981b in rustc_query_impl::query_impl::def_span::get_query_non_incr::__rust_end_short_backtrace () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#24 0x00007ffff5fccac6 in rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#25 0x00007ffff512b943 in rustc_query_impl::plumbing::create_query_frame::<rustc_span::def_id::LocalDefId> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#26 0x00007ffff511851b in <rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#27 0x00007ffff506b7da in <rustc_query_system::query::plumbing::QueryState<rustc_span::def_id::LocalDefId>>::try_collect_active_jobs::<rustc_middle::ty::context::TyCtxt> () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#28 0x00007ffff5135c1a in rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#29 0x00007ffff5129c7c in <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::collect_active_jobs () from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
#30 0x00007ffff50815e1 in rustc_query_system::query::plumbing::cycle_error::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> ()
from /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-baba34ae40c356f7.so
This gave an error back in 1.76
but in 1.77
it started just OOM without giving any output.
1.76:
error[E0432]: unresolved import `std::num::NonZero`
--> oom.rs:18:5
|
18 | use std::num::NonZero;
| ^^^^^^^^^^-------
| | |
| | help: a similar name exists in the module: `NonZeroI8`
| no `NonZero` in `num`
error[E0412]: cannot find type `U` in this scope
--> oom.rs:14:31
|
14 | fn specialization<T>(t: T) -> U {
| - ^
| |
| similarly named type parameter `T` defined here
|
help: a type parameter with a similar name exists
|
14 | fn specialization<T>(t: T) -> T {
| ~
help: you might be missing a type parameter
|
14 | fn specialization<T, U>(t: T) -> U {
| +++
error[E0658]: specialization is unstable
--> oom.rs:8:5
|
8 | default type Id = T;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
--> oom.rs:7:6
|
7 | impl<T: Default<Id = U>, U: Copy> Default for U {
| ^ unconstrained type parameter
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0207, E0412, E0432, E0658.
For more information about an error, try `rustc --explain E0207`.
Infinite recursion from cycle_error
? Here's a more detailed backtrace from a debug build:
...
#24 0x00007ffff2a9e841 in rustc_query_system::query::plumbing::cycle_error<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> () at compiler/rustc_query_system/src/query/plumbing.rs:253
#25 0x00007ffff48a3cbc in rustc_query_system::query::plumbing::try_execute_query<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false> () at compiler/rustc_query_system/src/query/plumbing.rs:370
#26 0x00007ffff456fa34 in rustc_query_system::query::plumbing::get_query_non_incr::{closure#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> () at compiler/rustc_query_system/src/query/plumbing.rs:801
#27 stacker::maybe_grow<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>> ()
at /home/jistone/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55
#28 rustc_data_structures::stack::ensure_sufficient_stack<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>> ()
at compiler/rustc_data_structures/src/stack.rs:17
#29 rustc_query_system::query::plumbing::get_query_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> ()
at compiler/rustc_query_system/src/query/plumbing.rs:801
#30 rustc_query_impl::query_impl::def_span::get_query_non_incr::__rust_end_short_backtrace ()
at compiler/rustc_query_impl/src/plumbing.rs:596
#31 0x00007ffff5d70913 in rustc_middle::query::plumbing::query_get_at<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>> () at compiler/rustc_middle/src/query/plumbing.rs:145
#32 0x00007ffff47fb932 in rustc_query_impl::plumbing::create_query_frame<rustc_span::def_id::LocalDefId> ()
at compiler/rustc_query_impl/src/plumbing.rs:333
#33 0x00007ffff47497ac in rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs::{closure#0} ()
at compiler/rustc_query_impl/src/plumbing.rs:699
#34 core::ops::function::FnOnce::call_once<rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs::{closure_env#0}, (rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)> ()
at library/core/src/ops/function.rs:250
#35 0x00007ffff4874fd4 in rustc_query_system::query::plumbing::QueryState::try_collect_active_jobs<rustc_span::def_id::LocalDefId, rustc_middle::ty::context::TyCtxt> () at compiler/rustc_query_system/src/query/plumbing.rs:89
#36 0x00007ffff474a00d in rustc_query_impl::query_impl::local_def_id_to_hir_id::try_collect_active_jobs ()
at compiler/rustc_query_impl/src/plumbing.rs:701
#37 0x00007ffff46c2b46 in rustc_query_impl::plumbing::{impl#3}::collect_active_jobs ()
at compiler/rustc_query_impl/src/plumbing.rs:85
#38 0x00007ffff2a9e841 in rustc_query_system::query::plumbing::cycle_error<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt> () at compiler/rustc_query_system/src/query/plumbing.rs:253
...
Since stacker::maybe_grow
is in there, it can recurse until OOM.
Bisection points to fb4bca04fa1bde2f7db1b31a59e066f7bebd7fc6 (but unsure if directly related) cc @reitermarkus @dtolnay
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-medium
This frame is suspicious, since the code around it is already trying to avoid infinite recursion:
#32 0x00007ffff47fb932 in rustc_query_impl::plumbing::create_query_frame<rustc_span::def_id::LocalDefId> ()
at compiler/rustc_query_impl/src/plumbing.rs:333
cc @Zoxc who added that reduce_queries
check.
I think maybe it should set the reduced state here, e.g. this seems to work:
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index a7696b1fbaff..7a9a1fafc579 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -330,7 +330,7 @@ pub(crate) fn create_query_frame<
// so exit to avoid infinite recursion.
None
} else {
- Some(key.default_span(tcx))
+ Some(ty::print::with_reduced_queries!(key.default_span(tcx)))
};
let def_id = key.key_as_def_id();
let def_kind = if kind == dep_graph::dep_kinds::def_kind || reduce_queries {
I don't immediately spot why there's a cycle from the limited backtrace or why the check for def_span
wouldn't prevent it.
Here's a full backtrace. I was breaking on each cycle_error
until it was clearly recursing on the DefIdCache
(frames 0, 14, 28), but it had also hit cycle_error
before that on VecCache
(42) and SingleCache
(86).
```
#0 rustc_query_system::query::plumbing::cycle_error
Unfortunately there is no kind of error or warning given by rustc, it just OOMs right away :/
I tried this code:
I expected to see this happen: explanation
Instead, this happened: explanation
Meta
rustc --version --verbose
: