Repository navigation
rustc 1.78.0 segfault on MacOS / M1 #125053
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixes
Description
Activity
- addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on May 12, 2024 The problem disappears if I turn off incremental compilation by adding this to the
Cargo.toml:[profile.dev] incremental = false
- addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.A-incr-compArea: Incremental compilationArea: Incremental compilationO-macosOperating system: macOSOperating system: macOS
on May 13, 2024 - addedI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.C-bugCategory: This is a bug.Category: This is a bug.and removedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on May 13, 2024 We are hitting an LLVM assertion:
Assertion failed: (N < NumContainedTys && "Element number out of range!"), function getElementType, file DerivedTypes.h, line 343.- addedA-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
on May 13, 2024 Could someone please run
cargo -vand then repeat the rustc command with-C save-tempsand share the bitcode files?Could someone please run
cargo -vand then repeat the rustc command with-C save-tempsand share the bitcode files?I can reproduce it, and I will try to reduce it.
Reacted by Ben Kimock, Nikita Popov and Rémy RakicUpstream issue: llvm/llvm-project#92062
Reduced: https://llvm.godbolt.org/z/a4h1abfKc.target triple = "arm64" @p = external global { {}, { ptr } } define void @foo() { bb: %i1 = load ptr, ptr @p, align 8 store ptr %i1, ptr null, align 8 ret void }
It has already been backported to LLVM 18: llvm/llvm-project#92129.
@rustbot label +llvm-fixed-upstream- addedllvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixes
on May 16, 2024 - added a commit that references this issue
on May 20, 2024
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-macosOperating system: macOSOperating system: macOST-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesIssue expected to be fixed by the next major LLVM upgrade, or backported fixes
I get a segfault when I try to run
cargo teston the following code:I see the same behavior with the latest nightly
rustc. I see no error withrustc1.77.0 or earlier. It also works fine on Linux, and on an older Intel Macbook.I also updated to the latest XCode to make sure all parts of my toolchain were up to date. Doing so did not make the segfault go away.