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

Latest nightly segfaults with thin lto #130333

Closed
theoparis opened this issue Sep 14, 2024 · 2 comments
Closed

Latest nightly segfaults with thin lto #130333

theoparis opened this issue Sep 14, 2024 · 2 comments
Labels
A-codegen Area: Code generation 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.

Comments

@theoparis
Copy link

I tried this command:

rustup install nightly --profile complete && cargo install nu

with this ~/.cargo/config.toml:

[unstable]
codegen-backend = true

[unstable.gitoxide]
fetch = true
shallow_index = true
shallow_deps = true
checkout = true
internal_use_git2 = false

#[profile.dev]
#codegen-backend = "cranelift"

[profile.dev]
incremental = true

[profile.release]
opt-level = "z"
lto = "thin"
strip = true
incremental = true

[build]
rustc-wrapper = "ccache"

[target.x86_64-unknown-linux-gnu]
linker = "clang"

I expected a successful install of nushell.

Instead, this happened:

error: rustc interrupted by SIGSEGV, printing backtrace

/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(+0x359af13) [0x7f44e959af13]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f5d0) [0x7f44e5e545d0]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM.so.19.1-rust-1.83.0-nightly(_ZN4llvm16FunctionImporter15importFunctionsERNS_6ModuleERKNS_8DenseMapINS_9StringRefESt13unordered_mapImNS_18GlobalValueSummary10ImportKindESt4hashImESt8equal_toImESaISt4pairIKmS7_EEENS_12DenseMapInfoIS4_vEENS_6detail12DenseMapPairIS4_SG_EEEE+0x6e2) [0x7f44e43b6ae4]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(LLVMRustPrepareThinLTOImport+0xce) [0x7f44eb8b85ce]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(_RNvXs1_Cs87LJ2YypnxP_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCsdhNFoV3RweI_17rustc_codegen_ssa6traits5write19WriteBackendMethods13optimize_thin+0x5b3) [0x7f44eb8b7b09]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(+0x5a41d93) [0x7f44eba41d93]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(+0x5a411a1) [0x7f44eba411a1]
/home/theo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-67e992fc9ebdf5ae.so(+0x5a406ab) [0x7f44eba406ab]
/lib/x86_64-linux-gnu/libc.so.6(+0x8c732) [0x7f44e5ea1732]
/lib/x86_64-linux-gnu/libc.so.6(+0x1072b8) [0x7f44e5f1c2b8]

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
error: could not compile `nu` (bin "nu")

It seems to have random timing but it seems to be happening every time I run cargo install nu again.

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (0609062a9 2024-09-13)
binary: rustc
commit-hash: 0609062a91c8f445c3e9a0de57e402f9b1b8b0a7
commit-date: 2024-09-13
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

I assume I'd have to build rustc and llvm in order to get more backtrace information...

@theoparis theoparis added the C-bug Category: This is a bug. label Sep 14, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 14, 2024
@workingjubilee workingjubilee added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-codegen Area: Code generation I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. labels Sep 14, 2024
@saethlin
Copy link
Member

"minimized" to:

RUSTFLAGS="-Copt-level=z -Clto=thin -Cembed-bitcode=yes -Cstrip=debuginfo" cargo +nightly install nu --force --target=x86_64-unknown-linux-gnu

@DianQK
Copy link
Member

DianQK commented Sep 19, 2024

This appears to have been fixed in #130477.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation 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.
Projects
None yet
Development

No branches or pull requests

5 participants