-
-
Notifications
You must be signed in to change notification settings - Fork 17.2k
Miscompilation of Bevy (and some wgpu) apps resulting in segfault on macOS. #117902
Copy link
Copy link
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-macosOperating system: macOSOperating system: macOSP-criticalCritical priorityCritical priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-macosOperating system: macOSOperating system: macOSP-criticalCritical priorityCritical priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Recent rustc seems to miscompile something somewhere in the dependency tree of Bevy, causing apps to crash with a segfault.
The issue seems to only manifest when optimizations are enabled and codegen units are > 1. The default cargo release configuration triggers it. Unoptimized builds are fine. Setting
codegen-units = 1withopt-level = 3also seems to be fine.I am on macOS 14.1 Sonoma, on Apple M1 Pro hardware.
Code
You can reproduce with any Bevy application. It is a huge code base, I know, I'm sorry I can't find a more minimal example.
Clone the Bevy repo: https://github.com/bevyengine/bevy
all these revs have the issue:
Run some example in release mode:
Version it worked on
The previous 1.74.0-beta.7 did not have the issue. I am not sure which nightly introduced the regression.
Version with regression
I first noticed the issue when I installed the 2023-11-11 nightly, though it might also be present in earlier nightlies. I just installed 1.75.0-beta.1 and updated my nightly, and can confirm the issue is present there, too.