rust-lang / rust-lang/rust

[ICE]: index out of bounds, can't reproduce

Open
#157,891 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-ICE needs-triage S-needs-repro T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This happened once, but sadly I can't reproduce this.

Invocation to get this: cargo test -F single_generation_mt -F defer_gc -F weak_pointer.
Code that caused this: https://codeberg.org/nahratzah/cycle_ptr/src/commit/c8ceb72811962218fb99941ad223b378bf2a7dc4

Code

https://codeberg.org/nahratzah/cycle_ptr/src/commit/c8ceb72811962218fb99941ad223b378bf2a7dc4

(Sorry, I can't reproduce, so I can't minimize either.)

Meta

rustc --version --verbose:

rustc 1.94.0 (4a4ef493e 2026-03-02) (built from a source tarball)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: x86_64-unknown-freebsd
release: 1.94.0
LLVM version: 21.1.8
Error output
failures:

---- src/lib.rs - (line 293) stdout ----

thread 'rustc' (578110) panicked at /rustc-dev/4a4ef493e3a1488c6e321570238084b38948f6db/compiler/rustc_data_structures/src/graph/dominators/mod.rs:91:33:
index out of bounds: the len is 4 but the index is 4294967041
stack backtrace:
   0:     0x28034c0feb85 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h893a3522304a637f
   1:     0x28034c15340a - core::fmt::write::h6484e26f8297056d
   2:     0x28034c1123a2 - <unknown>
   3:     0x28034c0e317f - <unknown>
   4:     0x28034c0e301b - std::panicking::default_hook::h8c7cb7311308c28d
   5:     0x280344dc8116 - <unknown>
   6:     0x28034c0e33fe - std::panicking::panic_with_hook::h8880f3953a4c5a55
   7:     0x28034c0fc0d8 - <unknown>
   8:     0x28034c0f9159 - <unknown>
   9:     0x28034c0e026d - __rustc[cba8e45071337d10]::rust_begin_unwind
  10:     0x28034c16a40c - core::panicking::panic_fmt::hbcffacdbf8d1a05a
  11:     0x28034c16a1cf - core::panicking::panic_bounds_check::hd2545950ae1a4ad7
  12:     0x280345224e28 - <unknown>
  13:     0x28034525c9f3 - <unknown>
  14:     0x28034c0e2b9a - std::sys::sync::once::futex::Once::call::h3a1bf212a04f3437
  15:     0x28034524e148 - <unknown>
  16:     0x2803451d92fd - <unknown>
  17:     0x280345250824 - <unknown>
  18:     0x2803451ffc33 - <unknown>
  19:     0x2803451f6b9c - <unknown>
  20:     0x2803451ef1e3 - <unknown>
  21:     0x280345288ec6 - <rustc_codegen_llvm[bb1d4ee3f3b1091d]::LlvmCodegenBackend as rustc_codegen_ssa[e5a96250ecfb780]::traits::backend::CodegenBackend>::codegen_crate
  22:     0x28034509a443 - <unknown>
  23:     0x280345041779 - <unknown>
  24:     0x280344f4d8aa - <rustc_interface[b1b57f764a516f95]::queries::Linker>::codegen_and_build_linker
  25:     0x280344de2c07 - <unknown>
  26:     0x280344d4c65e - <unknown>
  27:     0x280344d75ee1 - <unknown>
  28:     0x280344d734b2 - <unknown>
  29:     0x280344d83ee8 - <unknown>
  30:     0x280344d767bd - <unknown>
  31:     0x280344dc77c8 - <unknown>
  32:     0x280344deb216 - <unknown>
  33:     0x28034c118134 - <unknown>
  34:     0x28034f032d21 - <unknown>

error: 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.94.0 (4a4ef493e 2026-03-02) (built from a source tarball) running on x86_64-unknown-freebsd

note: compiler flags: --crate-type bin

query stack during panic:
end of query stack
Couldn't compile the test.

failures:
    src/lib.rs - (line 293)

test result: FAILED. 15 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.14s

error: doctest failed, to rerun pass `--doc`
*** Error code 101
Backtrace

stack backtrace:
   0:     0x28034c0feb85 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h893a3522304a637f
   1:     0x28034c15340a - core::fmt::write::h6484e26f8297056d
   2:     0x28034c1123a2 - <unknown>
   3:     0x28034c0e317f - <unknown>
   4:     0x28034c0e301b - std::panicking::default_hook::h8c7cb7311308c28d
   5:     0x280344dc8116 - <unknown>
   6:     0x28034c0e33fe - std::panicking::panic_with_hook::h8880f3953a4c5a55
   7:     0x28034c0fc0d8 - <unknown>
   8:     0x28034c0f9159 - <unknown>
   9:     0x28034c0e026d - __rustc[cba8e45071337d10]::rust_begin_unwind
  10:     0x28034c16a40c - core::panicking::panic_fmt::hbcffacdbf8d1a05a
  11:     0x28034c16a1cf - core::panicking::panic_bounds_check::hd2545950ae1a4ad7
  12:     0x280345224e28 - <unknown>
  13:     0x28034525c9f3 - <unknown>
  14:     0x28034c0e2b9a - std::sys::sync::once::futex::Once::call::h3a1bf212a04f3437
  15:     0x28034524e148 - <unknown>
  16:     0x2803451d92fd - <unknown>
  17:     0x280345250824 - <unknown>
  18:     0x2803451ffc33 - <unknown>
  19:     0x2803451f6b9c - <unknown>
  20:     0x2803451ef1e3 - <unknown>
  21:     0x280345288ec6 - <rustc_codegen_llvm[bb1d4ee3f3b1091d]::LlvmCodegenBackend as rustc_codegen_ssa[e5a96250ecfb780]::traits::backend::CodegenBackend>::codegen_crate
  22:     0x28034509a443 - <unknown>
  23:     0x280345041779 - <unknown>
  24:     0x280344f4d8aa - <rustc_interface[b1b57f764a516f95]::queries::Linker>::codegen_and_build_linker
  25:     0x280344de2c07 - <unknown>
  26:     0x280344d4c65e - <unknown>
  27:     0x280344d75ee1 - <unknown>
  28:     0x280344d734b2 - <unknown>
  29:     0x280344d83ee8 - <unknown>
  30:     0x280344d767bd - <unknown>
  31:     0x280344dc77c8 - <unknown>
  32:     0x280344deb216 - <unknown>
  33:     0x28034c118134 - <unknown>
  34:     0x28034f032d21 - <unknown>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running cargo test -F single_generation_mt -F defer_gc -F weak_pointer against the Codeberg cycle_ptr commit and inspect the doctest at src/lib.rs line 293. Compare the failure at compiler/rustc_data_structures/src/graph/dominators/mod.rs:91; done means reproducing and minimizing the ICE sufficiently to validate a compiler fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.