#0 0x00007ffff0466695 in llvm::X86FrameLowering::getFrameIndexReference(llvm::MachineFunction const&, int, llvm::Register&) const () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#1 0x00007ffff07f60ed in llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&, bool) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#2 0x00007ffff0763b25 in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3 0x00007ffff076370d in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#4 0x00007ffff076370d in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
[repeated many times]
#3018 0x00007ffff076370d in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3019 0x00007ffff076370d in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3020 0x00007ffff076370d in llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3021 0x00007ffff0762521 in llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*, llvm::LexicalScope*) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3022 0x00007ffff07610e8 in llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction const*) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3023 0x00007ffff07d313d in llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3024 0x00007ffff076b5cc in llvm::AsmPrinter::emitFunctionBody() () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3025 0x00007ffff0769046 in llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3026 0x00007ffff05193ba in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3027 0x00007ffff051866f in llvm::FPPassManager::runOnModule(llvm::Module&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3028 0x00007ffff0720bba in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-17-rust-1.76.0-stable.so
#3029 0x00007ffff6e16358 in LLVMRustWriteOutputFile () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3030 0x00007ffff6e15f95 in rustc_codegen_llvm::back::write::write_output_file () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3031 0x00007ffff6e13713 in rustc_codegen_llvm::back::write::codegen () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3032 0x00007ffff6e133c2 in rustc_codegen_ssa::back::write::finish_intra_module_work::<rustc_codegen_llvm::LlvmCodegenBackend> () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3033 0x00007ffff6eabbf1 in std::sys_common::backtrace::__rust_begin_short_backtrace::<<rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::spawn_named_thread<rustc_codegen_ssa::back::write::spawn_work<rustc_codegen_llvm::LlvmCodegenBackend>::{closure#0}, ()>::{closure#0}, ()> () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3034 0x00007ffff6eab6c2 in <<std::thread::Builder>::spawn_unchecked_<<rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::spawn_named_thread<rustc_codegen_ssa::back::write::spawn_work<rustc_codegen_llvm::LlvmCodegenBackend>::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} () from /home/coder0xff/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-ef0b2e016afc8182.so
#3035 0x00007ffff23988e5 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#3036 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2015
#3037 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#3038 0x00007ffff2094ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#3039 0x00007ffff2126850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
While building the p384 crate on an experimental platform I encountered a consistent ICE. Initially, the problem seemed to be due to the experimental platform. However, identifying the minimal reproduction revealed that all rustc are likely impacted. Note that the top of the stack is inside LLVM. I wasn't sure whether to report here or in LLVM, but it's clear that the structure that's being passed into LLVM is causing it to recurse too deeply.
This issue is a follow-up to esp-rs#214.
Minimal Reproduction
Directory Structure
Contents of: Cargo.toml
Contents of: src/lib.rs
Meta
rustc --version --verbose:Error output
Backtrace