Skip to content

ICE: index out of bounds in rustc_codegen_ssa #125474

Closed
@parasyte

Description

@parasyte

Code

Minimal repro: https://github.com/parasyte/crashy

Meta

This is the first nightly that the ICE appears in. (Does not appear to affect 2024-05-22 or earlier.)

rustc --version --verbose:

rustc 1.80.0-nightly (867900499 2024-05-23)
binary: rustc
commit-hash: 8679004993f08807289911d9f400f4ac4391d2bc
commit-date: 2024-05-23
host: aarch64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.6

Error output

Backtrace

thread 'rustc' panicked at compiler/rustc_codegen_ssa/src/back/link.rs:2700:27:
index out of bounds: the len is 20 but the index is 20
stack backtrace:
   0:        0x102e97260 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfa1323da475f800d
   1:        0x102ed9d14 - core::fmt::write::heaa8abb186c3047d
   2:        0x102e8d65c - std::io::Write::write_fmt::h3d08850e35aab4bf
   3:        0x102e970b8 - std::sys_common::backtrace::print::h4df82b4992ac1fc1
   4:        0x102e996c0 - std::panicking::default_hook::{{closure}}::h7ff64b2e0b9b22e2
   5:        0x102e9938c - std::panicking::default_hook::h22468db7cd0b8309
   6:        0x10c779e74 - <alloc[b3d7b17f3254a7e4]::boxed::Box<rustc_driver_impl[d78fc4912d252757]::install_ice_hook::{closure#0}> as core[7a0d7fb87c17620e]::ops::function::Fn<(&dyn for<'a, 'b> core[7a0d7fb87c17620e]::ops::function::Fn<(&'a core[7a0d7fb87c17620e]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[7a0d7fb87c17620e]::marker::Sync + core[7a0d7fb87c17620e]::marker::Send, &core[7a0d7fb87c17620e]::panic::panic_info::PanicInfo)>>::call
   7:        0x102e9a0ac - std::panicking::rust_panic_with_hook::h7f81e6b48edd822e
   8:        0x102e99ac0 - std::panicking::begin_panic_handler::{{closure}}::h61dc216c734bb31b
   9:        0x102e976e4 - std::sys_common::backtrace::__rust_end_short_backtrace::h14d37ee99da8f514
  10:        0x102e99830 - _rust_begin_unwind
  11:        0x102ef5608 - core::panicking::panic_fmt::h879022f43970f0ca
  12:        0x102ef5768 - core::panicking::panic_bounds_check::habf076b85f30241b
  13:        0x10c4d5efc - rustc_codegen_ssa[6b173b5bf0f2b0be]::back::link::linker_with_args
  14:        0x10c4cccac - rustc_codegen_ssa[6b173b5bf0f2b0be]::back::link::link_natively
  15:        0x10c4c8e70 - rustc_codegen_ssa[6b173b5bf0f2b0be]::back::link::link_binary
  16:        0x10c3da0e0 - <rustc_codegen_llvm[21fd93a69a5e3bd5]::LlvmCodegenBackend as rustc_codegen_ssa[6b173b5bf0f2b0be]::traits::backend::CodegenBackend>::link
  17:        0x10cf170a8 - <rustc_interface[9b74dd81a584a30b]::queries::Linker>::link
  18:        0x10c76cca4 - rustc_span[16eba1eb411798eb]::create_session_globals_then::<core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>, rustc_interface[9b74dd81a584a30b]::util::run_in_thread_with_globals<rustc_interface[9b74dd81a584a30b]::util::run_in_thread_pool_with_globals<rustc_interface[9b74dd81a584a30b]::interface::run_compiler<core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>, rustc_driver_impl[d78fc4912d252757]::run_compiler::{closure#0}>::{closure#1}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
  19:        0x10c73a9c8 - std[c992710344e8eb3f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9b74dd81a584a30b]::util::run_in_thread_with_globals<rustc_interface[9b74dd81a584a30b]::util::run_in_thread_pool_with_globals<rustc_interface[9b74dd81a584a30b]::interface::run_compiler<core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>, rustc_driver_impl[d78fc4912d252757]::run_compiler::{closure#0}>::{closure#1}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>
  20:        0x10c706024 - <<std[c992710344e8eb3f]::thread::Builder>::spawn_unchecked_<rustc_interface[9b74dd81a584a30b]::util::run_in_thread_with_globals<rustc_interface[9b74dd81a584a30b]::util::run_in_thread_pool_with_globals<rustc_interface[9b74dd81a584a30b]::interface::run_compiler<core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>, rustc_driver_impl[d78fc4912d252757]::run_compiler::{closure#0}>::{closure#1}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7a0d7fb87c17620e]::result::Result<(), rustc_span[16eba1eb411798eb]::ErrorGuaranteed>>::{closure#2} as core[7a0d7fb87c17620e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x102ea2a04 - std::sys::pal::unix::thread::Thread::new::thread_start::h020974cd53976785
  22:        0x195abaf94 - __pthread_joiner_wake

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-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