-
Notifications
You must be signed in to change notification settings - Fork 888
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
Crash when closing window on macOS if "exception" feature of objc crate is enabled #1925
Comments
Thanks for looking at this so quickly! With the PR, the application panics instead of crashes.
If you'd like to try reproducing, the following steps will probably give you a 100% repro: git clone https://github.com/aclysma/rafx.git This isn't as minimal as the example I gave above, but I could set up a branch with it minimized. Unfortunately it seems to correlate somehow to the "exception" feature of objc being enabled from within another upstream crate, so it's difficult to give a tiny out-of-tree repro. To test with the PR, I added this to the root Cargo.toml
|
Actually, you can get the same minimal repro I had above by replacing demo-web/src/main.rs with the sample code in the original post and then following those steps above |
Oops I didn't get a notification about this. 😕 When you comment under the PR I get a notification. It baffles me, why the exception is still thrown with the PR, but thanks for clarifying how to repro. My cargo is stuck fetching something, but I'll try looking into this again, as soon as possible. |
I managed to run compile the |
@ArturKovacs It looks like this only occurs with 1.51-aarch64-apple-darwin. When I recompile with 1.50 and 1.52 it no longer occurs. Also does not occur with x86_64-apple-darwin 1.51. I'm suspecting bad code generation. EDIT: I forgot to add the patch to cargo.toml, so this result was with winit 0.24.0 |
Thank you! In that case I'm clueless as to how to mitigate this, but considering that this only affects Rust 1.51, it doesn't seem like we need to do anything about this. Is that a fair assessment @aclysma? |
It's possible that this bug is not actually fixed in 1.52-aarch64-apple-darwin, and that compiling with 1.50/1.52 moves things around enough that it just happens to no longer reproduce. So it might be worth trying to find exactly where it went wrong and/or pinging someone who works on the compiler that's familiar with aarch64. That said, mitigation could be tricky/unreliable and I certainly wouldn't blame anyone for just closing this and moving on :D |
Yeah you are right. Do you know anyone who works on the compiler and might be able to help here because I don't :/ |
Just a shot in the dark: [patch.crates-io]
objc_exception = { git = "https://github.com/madsmtm/rust-objc-exception.git", branch = "exception-enum-struct" } (See SSheldon/rust-objc-exception#9 for details) |
A year and a lot of knowledge later: The call to Without the Anyhow, I unknowingly fixed this a while ago in #2138 as part of a general soundness cleanup, so yay! |
Explanation makes a lot of sense, thanks for sharing. Nice to finally know what was happening :D |
I have revision 0152508 which includes 4192d04
This is an example program that crashes when I close the window if I enable the "exception" feature in objc in an upstream crate.
Example program:
If the upstream crate has
objc = { version = "0.2.7", features = [] }
, I get:If the upstream crate has
objc = { version = "0.2.7", features = ["exception"] }
, I get:It is crashing on this line:
Any ideas? Thanks!
The text was updated successfully, but these errors were encountered: