Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: codegenprepare pass segfaults #138235

Open
thomasgassmann opened this issue Mar 8, 2025 · 1 comment
Open

ICE: codegenprepare pass segfaults #138235

thomasgassmann opened this issue Mar 8, 2025 · 1 comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@thomasgassmann
Copy link

thomasgassmann commented Mar 8, 2025

Code

fn main() {
    println!("Hello, world!");
}

Compiling the above with rustc -C no-prepopulate-passes -C passes=codegenprepare main.rs segfaults.

A similar issue also happens with ´codegenprepare´.

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (f5a1ef712 2025-03-07)
binary: rustc
commit-hash: f5a1ef7121ad661b5a21a1d02941c8064d54ee0b
commit-date: 2025-03-07
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output

error: rustc interrupted by SIGSEGV, printing backtrace

/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(+0x374941f) [0x751f65d4941f]
/usr/lib/libc.so.6(+0x3dcd0) [0x751f6244bcd0]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(+0x82a6c05) [0x751f60aa6c05]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(_ZN4llvm18CodeGenPreparePass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE+0x190) [0x751f5e00cec0]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(+0x6a6226d) [0x751f5f26226d]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x70d) [0x751f60619b69]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(_ZN4llvm27ModuleToFunctionPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x296) [0x751f6068b728]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(+0x7e8b48d) [0x751f6068b48d]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.20.1-rust-1.87.0-nightly(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0x21f) [0x751f60d2fe5f]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(+0x5e323c1) [0x751f684323c1]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(+0x5e2b818) [0x751f6842b818]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(_RNvXs1_Cs4GJg65wqyXp_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCs2qsHfWh5y4Q_17rustc_codegen_ssa6traits5write19WriteBackendMethods8optimize+0x186) [0x751f6839fce4]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(_RINvNtNtCsaJNBDtcVlXq_3std3sys9backtrace28___rust_begin_short_backtraceNCINvXs0_Cs4GJg65wqyXp_18rustc_codegen_llvmNtB1g_18LlvmCodegenBackendNtNtNtCs2qsHfWh5y4Q_17rustc_codegen_ssa6traits7backend19ExtraBackendMethods18spawn_named_threadNCINvNtNtB2k_4back5write10spawn_workB1O_E0uE0uEB1g_+0x187) [0x751f6839c5c7]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(+0x5d95edc) [0x751f68395edc]
/home/thomas/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-e3b06f91230294e6.so(+0x5d96277) [0x751f68396277]
/usr/lib/libc.so.6(+0x9570a) [0x751f624a370a]
/usr/lib/libc.so.6(+0x119aac) [0x751f62527aac]

note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
[1]    445041 segmentation fault (core dumped)  rustc -C no-prepopulate-passes -C passes=codegenprepare a.rs
@thomasgassmann thomasgassmann added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 8, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 8, 2025
@saethlin saethlin added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Mar 9, 2025
@veera-sivarajan
Copy link
Contributor

veera-sivarajan commented Mar 14, 2025

Upstream issue: llvm/llvm-project#88692

@rustbot label -needs-triage

@rustbot rustbot removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants