rust-lang / rust-lang/rust

ICE of SIGILL/STATUS_ILLEGAL_INSTRUCTION when compiling static variables with 2MB alignment targeting Windows

Open
#142,386 10 comments 0 reactions 1 assignee View on GitHub

@nthery is already working on this.

Since Jun 16, 2025.

A-LLVM C-bug I-crash O-windows T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Static variables with alignment of 2MB when building for Windows crash with either SIGILL on Linux cross-comiling or STATUS_ILLEGAL_INSTRUCTION on Windows.

See https://godbolt.org/z/rvfM8M455.

Code
#[repr(C, align(0x200000))]
struct Foo(u8);
static FOO: Foo = Foo(0);
fn main() {}
Meta

rustc --version --verbose:

1.87
nightly
Error output
error: rustc interrupted by SIGILL, printing backtrace
Backtrace

error: rustc interrupted by SIGILL, printing backtrace

/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x39177df)[0x7959893177df]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x795985642520]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm13WinCOFFWriter13defineSectionERKNS_11MCAssemblerERKNS_13MCSectionCOFFE+0x51c)[0x795981bb616c]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm13WinCOFFWriter24executePostLayoutBindingERNS_11MCAssemblerE+0xfd)[0x795981bb821d]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm19WinCOFFObjectWriter24executePostLayoutBindingERNS_11MCAssemblerE+0x13)[0x795981bb9613]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm11MCAssembler6layoutEv+0x1606)[0x795984144d06]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm16MCObjectStreamer10finishImplEv+0x63)[0x7959841435e3]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm10AsmPrinter14doFinalizationERNS_6ModuleE+0x35e)[0x7959839ebe5e]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm13FPPassManager14doFinalizationERNS_6ModuleE+0x2a)[0x79598382a0ea]
/opt/compiler-explorer/rust-1.87.0/lib/libLLVM.so.20.1-rust-1.87.0-stable(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x3ff)[0x795983e4a553]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f719c2)[0x79598b9719c2]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f71521)[0x79598b971521]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f6eb5b)[0x79598b96eb5b]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f6e834)[0x79598b96e834]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(_RINvNtNtCseJswNlh1fGO_3std3sys9backtrace28___rust_begin_short_backtraceNCINvXs0_Csj8izNYKuql0_18rustc_codegen_llvmNtB1g_18LlvmCodegenBackendNtNtNtCs2ZezlIswSFH_17rustc_codegen_ssa6traits7backend19ExtraBackendMethods18spawn_named_threadNCINvNtNtB2k_4back5write10spawn_workB1O_E0uE0uEB1g_+0x251)[0x79598b96cf91]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f6685c)[0x79598b96685c]
/opt/compiler-explorer/rust-1.87.0/lib/librustc_driver-9c23edfdcf82221e.so(+0x5f66bf7)[0x79598b966bf7]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3)[0x795985694ac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x126850)[0x795985726850]

note: we would appreciate a report at https://github.com/rust-lang/rust
Program terminated with signal: SIGILL
Execution build compiler returned: 132

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.