Skip to content

Workaround a crash in macOS tahoe 26 / xcode 16.4+ #20146

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ArthurBrussee
Copy link
Contributor

Objective

Workaround a crash in macOS tahoe 26, and newer xcode versions.

Fixes #19625, and see #19567

Solution

Disable debug assertions in objc2 untl winit has a new release enabling a more precise workaround.

Testing

cargo run --example breakout goes from crashing to working fine on the macOS tahoe beta.

Alternative

A beta is a beta so maybe it's just not supported and we should just wait for the winit update. madsmtm/objc2#765 (comment) implies that an incoming xcode update has the same issue however so it might be more urgent.

@BD103 BD103 added C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash O-MacOS Specific to the MacOS (Apple) desktop operating system C-Dependencies A change to the crates that Bevy depends on A-Cross-Cutting Impacts the entire engine labels Jul 15, 2025
@BD103
Copy link
Member

BD103 commented Jul 15, 2025

As a small note: the advisories CI failure is unrelated to this PR, so it can be ignored.

@BD103 BD103 added this to the 0.17 milestone Jul 17, 2025
@BD103
Copy link
Member

BD103 commented Jul 17, 2025

I think this should be included in 0.17. It's a small change, and we don't want to crash on platforms we will need to support in the future

@ArthurBrussee
Copy link
Contributor Author

CI is clean now after the minimp3 removal :)

@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jul 21, 2025
@alice-i-cecile alice-i-cecile added X-Contentious There are nontrivial implications that should be thought through D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jul 21, 2025
@alice-i-cecile alice-i-cecile requested a review from BD103 July 21, 2025 17:44
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to test it locally, but the change and comments look good. Note that this is something all projects that depend on Bevy will need to do in order to avoid crashing.

We should probably open up a follow-up issue for this that is blocked on Winit's next release, but beyond that it looks good!

@BD103 BD103 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 21, 2025
@alice-i-cecile alice-i-cecile requested a review from mockersf July 21, 2025 22:48
@alice-i-cecile
Copy link
Member

Hey @mockersf how much do you hate this?

@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jul 21, 2025
@mockersf
Copy link
Member

mockersf commented Jul 22, 2025

A lot. This doesn't fix anything because profiles are not used from libraries

https://doc.rust-lang.org/cargo/reference/profiles.html#profiles

Cargo only looks at the profile settings in the Cargo.toml manifest at the root of the workspace. Profile settings defined in dependencies will be ignored.

@mockersf mockersf removed this from the 0.17 milestone Jul 22, 2025
@mockersf mockersf added X-Controversial There is active debate or serious implications around merging this PR and removed X-Contentious There are nontrivial implications that should be thought through labels Jul 22, 2025
@mockersf
Copy link
Member

mockersf commented Jul 22, 2025

@madsmtm do you know if a winit 0.30.12 patch with rust-windowing/winit#4302 is planned?

@robert-wallis
Copy link

I made a PR to add this to winit v0.30.x rust-windowing/winit#4301 in winit. It's been merged to master rust-windowing/winit#4302, but my v0.30x PR was closed a few weeks ago because it needed to go to master first

@kchibisov
Copy link

kchibisov commented Jul 22, 2025

I made a PR to add this to winit v0.30.x rust-windowing/winit#4301 in winit. It's been merged to master rust-windowing/winit#4302, but my v0.30x PR was closed a few weeks ago because it needed to go to master first

If you pull objc with the feature needed in the Cargo.toml in bevy you don't need anything from upstream. Like the bug is fixed by enabling feature on the crate, so you can do so in bevy without any need from a winit side. That's just how it always worked in rust with such things.

objc2 = { version = "0.5.2", features = ["relax-sign-encoding"] }

Just add this and (and also for 0.6 version I guess if it's in tree) for macOS in bevy where e.g. winit is pulled and you have it fixed.

@mockersf
Copy link
Member

If you pull objc with the feature needed in the Cargo.toml in bevy you don't need anything from upstream.

I would prefer to not add a direct dependency on objc in Bevy. As it's something we depend through winit, it means keeping versions in sync, triggering unused dependency checks, ...

Also, having the update in a winit patch means it will work in previous versions of Bevy that depends on the 0.30, so Bevy 0.16, 0.15 and 0.14, without Bevy having to release patches for all those versions

@kchibisov
Copy link

If you can wait (until I have time to cut a release), then yes, that would be better, it just felt with that spam that urgent action is required, which I've provided.

@mockersf
Copy link
Member

mockersf commented Jul 22, 2025

macOS 26 will release at the earliest in September, so not that urgent. The sooner the patch is the better, but no need to rush

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts the entire engine C-Bug An unexpected or incorrect behavior C-Dependencies A change to the crates that Bevy depends on D-Straightforward Simple bug fixes and API improvements, docs, test and examples O-MacOS Specific to the MacOS (Apple) desktop operating system P-Crash A sudden unexpected crash S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Objc2 framework panics on MacOS 26 developer beta
6 participants