Skip to content

LLVM crash in vectorizer when compiling GameCube emulators #151926

@Noratrieb

Description

@Noratrieb

code: https://codeberg.org/hazelwiss/solstice/src/commit/34059d531fb8675c6a5b8dc5990ff748c8063ebc

error: rustc interrupted by SIGSEGV, printing backtrace

/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x3c159fc) [0x7f7624e159fc]
/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/libc.so.6(+0x42790) [0x7f7620e42790]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(+0x9111519) [0x7f761f111519]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(+0x9235d8f) [0x7f761f235d8f]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(+0x970b796) [0x7f761f70b796]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm24LoopVectorizationPlanner28tryToBuildVPlanWithVPRecipesESt10unique_ptrINS_5VPlanESt14default_deleteIS2_EERNS_7VFRangeEPNS_14LoopVersioningE+0x2d0) [0x7f761f1089d0]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm24LoopVectorizationPlanner24buildVPlansWithVPRecipesENS_12ElementCountES1_+0x29c) [0x7f761f084e9c]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm24LoopVectorizationPlanner4planENS_12ElementCountEj+0x172) [0x7f761f1bebc2]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm17LoopVectorizePass11processLoopEPNS_4LoopE+0xb42) [0x7f761f0f7c82]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm17LoopVectorizePass7runImplERNS_8FunctionE+0x1c4) [0x7f761f0f7044]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm17LoopVectorizePass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE+0x2aa) [0x7f761f0f6df4]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x723) [0x7f761ea159bf]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm27ModuleToFunctionPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x30b) [0x7f761eab4191]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.22.1-rust-1.95.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x1ef) [0x7f761eb7a22f]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x623a103) [0x7f762743a103]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x6238451) [0x7f7627438451]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x6237e2e) [0x7f7627437e2e]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(_RNvXs1_CshzHMhUsKEoY_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCs4UBZKgvTf0h_17rustc_codegen_ssa6traits5write19WriteBackendMethods24run_and_optimize_fat_lto+0x1214) [0x7f7624c24094]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(_RNvXs3_CshzHMhUsKEoY_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCs4UBZKgvTf0h_17rustc_codegen_ssa6traits7backend14CodegenBackend12join_codegen+0xd0a) [0x7f76276bb1ca]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(_RNvMNtCsgLgEObvq8lS_15rustc_interface7queriesNtB2_6Linker4link+0x106) [0x7f76276bc5d4]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x63957c5) [0x7f76275957c5]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x63d25be) [0x7f76275d25be]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x63d2ae0) [0x7f76275d2ae0]
/home/nora/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-1c4195dec9454671.so(+0x63d396c) [0x7f76275d396c]
/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/libc.so.6(+0x9dd53) [0x7f7620e9dd53]
/nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/libc.so.6(+0x1255fc) [0x7f7620f255fc]

Happens with fat LTO. Assertions don't give a better error.

********************************************************************************
Regression in nightly-2026-01-29
********************************************************************************

my cargo-bisect-rustc is too old and can't bisect commits but this is definitely from LLVM 22, which happened on that day.

I managed to reproduce the crash with opt -passes=lto<O3> and am currently reducing the over 70MB of bitcode.

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issuellvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions