Skip to content

[ICE]: cannot decode AttrId with CacheDecoder #155139

Closed as duplicate
Closed as duplicate

Description

@ruriww

Code

Not sure what caused it. Only happens on debug mode.

Meta

rustc --version --verbose:

rustc version: 1.96.0-nightly (900485642 2026-04-08)
thread 'rustc' panicked at /rustc-dev/900485642855f4729d926ecf24680a791f9293cf/compiler/rustc_middle/src/query/on_disk_cache.rs:663:9:
cannot decode `AttrId` with `CacheDecoder`
stack backtrace:
   0:        0x113521c08 - <std[cc2a4db2680813b8]::backtrace::Backtrace>::create
   1:        0x1113aeee0 - std[cc2a4db2680813b8]::panicking::update_hook::<alloc[5c025890d9b65067]::boxed::Box<rustc_driver_impl[a9b8195e93143871]::install_ice_hook::{closure#1}>>::{closure#0}
   2:        0x11353369c - std[cc2a4db2680813b8]::panicking::panic_with_hook
   3:        0x113517620 - std[cc2a4db2680813b8]::panicking::panic_handler::{closure#0}
   4:        0x11350df98 - std[cc2a4db2680813b8]::sys::backtrace::__rust_end_short_backtrace::<std[cc2a4db2680813b8]::panicking::panic_handler::{closure#0}, !>
   5:        0x113518bc4 - __rustc[9893dd7cded7045d]::rust_begin_unwind
   6:        0x116554044 - core[65d2295b482aced]::panicking::panic_fmt
   7:        0x11212ed30 - <rustc_middle[4fc8633060c41573]::query::on_disk_cache::OnDiskCache>::load_side_effect
   8:        0x112ca46d8 - <rustc_query_impl[95864d7e07eebc26]::dep_kind_vtables::non_query::SideEffect::{closure#0} as core[65d2295b482aced]::ops::function::FnOnce<(rustc_middle[4fc8633060c41573]::ty::context::TyCtxt, rustc_middle[4fc8633060c41573]::dep_graph::dep_node::DepNode, rustc_middle[4fc8633060c41573]::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
   9:        0x11215c2a4 - <rustc_middle[4fc8633060c41573]::dep_graph::graph::DepGraphData>::try_mark_previous_green
  10:        0x11215c258 - <rustc_middle[4fc8633060c41573]::dep_graph::graph::DepGraphData>::try_mark_previous_green
  11:        0x11215c258 - <rustc_middle[4fc8633060c41573]::dep_graph::graph::DepGraphData>::try_mark_previous_green
  12:        0x11215c118 - <rustc_middle[4fc8633060c41573]::dep_graph::graph::DepGraphData>::try_mark_green
  13:        0x112a38744 - rustc_query_impl[95864d7e07eebc26]::execution::ensure_can_skip_execution::<rustc_data_structures[abfc8eabe9c905b9]::vec_cache::VecCache<rustc_hir_id[185bbc009e60d6cf]::OwnerId, rustc_middle[4fc8633060c41573]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[4fc8633060c41573]::dep_graph::graph::DepNodeIndex>>
  14:        0x112b3c800 - rustc_query_impl[95864d7e07eebc26]::query_impl::check_unsafety::execute_query_incr::__rust_end_short_backtrace
  15:        0x111cbff88 - <rustc_middle[4fc8633060c41573]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[4d5dd335d36b1423]::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  16:        0x111d06540 - rustc_interface[4d5dd335d36b1423]::passes::analysis
  17:        0x1129b7a60 - rustc_query_impl[95864d7e07eebc26]::execution::try_execute_query::<rustc_middle[4fc8633060c41573]::query::caches::SingleCache<rustc_middle[4fc8633060c41573]::query::erase::ErasedData<[u8; 0usize]>>, true>
  18:        0x112b6e930 - rustc_query_impl[95864d7e07eebc26]::query_impl::analysis::execute_query_incr::__rust_end_short_backtrace
  19:        0x111366440 - rustc_interface[4d5dd335d36b1423]::passes::create_and_enter_global_ctxt::<core[65d2295b482aced]::option::Option<rustc_interface[4d5dd335d36b1423]::queries::Linker>, rustc_driver_impl[a9b8195e93143871]::run_compiler::{closure#0}::{closure#2}>
  20:        0x1113addc0 - rustc_interface[4d5dd335d36b1423]::interface::run_compiler::<(), rustc_driver_impl[a9b8195e93143871]::run_compiler::{closure#0}>::{closure#1}
  21:        0x1113a5948 - std[cc2a4db2680813b8]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[4d5dd335d36b1423]::util::run_in_thread_with_globals<rustc_interface[4d5dd335d36b1423]::util::run_in_thread_pool_with_globals<rustc_interface[4d5dd335d36b1423]::interface::run_compiler<(), rustc_driver_impl[a9b8195e93143871]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  22:        0x1113b5ad0 - <std[cc2a4db2680813b8]::thread::lifecycle::spawn_unchecked<rustc_interface[4d5dd335d36b1423]::util::run_in_thread_with_globals<rustc_interface[4d5dd335d36b1423]::util::run_in_thread_pool_with_globals<rustc_interface[4d5dd335d36b1423]::interface::run_compiler<(), rustc_driver_impl[a9b8195e93143871]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[65d2295b482aced]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  23:        0x11353dee0 - <std[cc2a4db2680813b8]::sys::thread::unix::Thread>::new::thread_start
  24:        0x18250fbc8 - __pthread_cond_wait


rustc version: 1.96.0-nightly (900485642 2026-04-08)
platform: aarch64-apple-darwin

query stack during panic:
#0 [analysis] running analysis passes on crate `---`
end of query stack
Backtrace

<backtrace>

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Apr 11, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Apr 11, 2026
  3. changed the title [-][ICE]:[/-] [+][ICE]: cannot decode `AttrId` with `CacheDecoder`[/+] on Apr 11, 2026
  4. spqr79 commented on Apr 11, 2026

    @spqr79

    have you tried cargo clean first and then doing a fresh build? the panic in
    on_disk_cache.rs:663 usually means the incremental cache has something it
    can't decode anymore, and nightly builds can invalidate it without warning.

    if the ICE comes back on the next incremental build after that, it's more
    likely a regression in 900485642. in that case it would be worth trying
    rustup override set nightly-2026-04-07 to see if an earlier nightly avoids
    it, since the check_unsafety path in the backtrace is a pretty specific clue
    for bisecting.

  5. ruriww commented on Apr 11, 2026

    @ruriww
    Author

    I have cleaned, and I believe it was happening in the 04-05 build as well.

  6. spqr79 commented on Apr 11, 2026

    @spqr79

    Good to know it's not just stale cache. If 04-05 also triggers it, try nightly-2026-04-01 to narrow the window before bisecting.

  7. ruriww commented on Apr 12, 2026

    @ruriww
    Author

    Ok actually it is due to cache, but I wouldn't call it stale. Simply running two back to back builds after a clean consistently causes the error. 04-03 is the last version to work, 04-04 breaks.

  8. spqr79 commented on Apr 12, 2026

    @spqr79

    That's a precise reproduction. The window is tight enough that git log --oneline .. -- compiler/rustc_middle/src/query/on_disk_cache.rs might show the culprit directly without a full bisect.

  9. JonathanBrouwer commented on Apr 12, 2026

    @JonathanBrouwer
    Member

    Duplicate of #154878, fixed by #155056

  10. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions