-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
SIGSEGV in rustc upon compiling with --release #119179
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Reduced: ; RUN: opt -passes="loop-mssa(loop-instsimplify,simple-loop-unswitch<nontrivial>)" < %s
@vtable = constant ptr @foo
declare void @foo() memory(none)
define void @test(i1 %c) {
br label %loop
loop:
%fn = load ptr, ptr @vtable, align 8
call void %fn()
br i1 %c, label %exit, label %loop
exit:
ret void
} |
Upstream fix: llvm/llvm-project#76142 |
@cfstras, could you please try adding edit: Ah nikic might have already found a more specific issue, probably nevermind :) |
I verified successfully that this also fixes the build for my codebase where I originally found this 👍🏻 (by cherry-picking only your commit on top of the currently used nightly llvm branch in rust-lang/rust, 606bc11367b4) edit @jamesmunns: Sorry, just saw your comment as I was leaving. I can try that later, but since it also reproduces on the (linux/ guessing amd64?) rust playground, I doubt this is ARM-related. |
@jamesmunns: The argument doesn't seem to make a difference, neither on stable/beta, nor on nightly. |
I'm confused, this code still crashes with yesterday's nightly? Could it be that the alternative fix you selected doesn't fully fix the issue I'm seeing? |
I had also tested my code using your cherry-picked fix (llvm/llvm-project#76819) based on llvm 606bc11367b4 again, and saw the crash still happen. Apologies, I seemingly had written the comment but forgot to send. |
Hm yeah, I tested my original fix against the original test case, but not the final version. Let me take another look. |
New reduction: ; RUN: opt -passes="loop-mssa(loop-instsimplify,simple-loop-unswitch<nontrivial>)" < %s
@vtable = constant ptr @foo
declare void @foo() memory(none)
define void @test(i1 %c) {
br label %loop
loop:
%fn = load ptr, ptr @vtable, align 8
call void %fn()
br i1 %c, label %exit, label %loop
exit:
ret void
} Took me a while to spot how this differs from the previous one: The branch destinations are swapped... |
New upstream fix: llvm/llvm-project#78272 |
When cherry-picking this onto latest rust master (fa0dc20, llvm 919a630125a0), I get:
Is this expected? |
@cfstras Are you sure the commit was picked up? The patch removes that assertion. |
Reopening, the auto closing on a merge in @saethlin's fork seems unintentional. |
🤦 yes, unintentional. If someone has a way to prevent that I'd appreciate it. |
@nikic duh, forgot to commit the llvm submodule, thanks. Confirmed ✅ no crash, also builds my original project without issue. |
Fixed in beta & nightly. |
I tried compiling this code with
--release
:(Thanks to @Xiretza for helping me find this shorter reproducer)
I expected to see this happen: (nothing, since there's no main method) a clean compile
Instead, this happened:
(Or, when compiling through
cargo build --release
:)Meta
rustc --version --verbose
:Note: this crashes on the playground on nightly (2023-12-20 5ac4c8a), beta (1.75.0-beta.7), and stable (1.74.1). Also crashes on aarch64-apple-darwin nightly (2023-12-19 f704f3b), beta (1.75.0-beta.7) and stable (1.74.1)
Backtrace
(From Playground since I don't have a debug build on macOS yet)
The text was updated successfully, but these errors were encountered: