-
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
Condvar isn't RefUnwindSafe when building on Mac #118009
Comments
@rustbot label O-macos T-libs |
After trying to run Gooey again on my Mac for the first time in a few weeks, I found that I ran into the Condvar issue again. Rather than pasting AssertUnwindSafe in those files, I've both reported the discrepency in unwind safety (rust-lang/rust#118009) and moved the workaround into a type that only uses AssertUnwindsafe when compiling for Apple.
sounds like a bug, there's probably an implementation missing on some MacOS specific sys struct, the unwind safety traits are always forgotten |
Hi, is there any updates? I am seeing the same issue. |
No updates because no one has fixed this yet. Feel free to make a PR and fix if yourself :) |
Is it correct to assume that Condvar is supposed to be UnwindSafe on all platforms? My basic understanding of this is that Condvar should be UnwindSafe and, barring any surprises, the data structures should already be unwind safe and are simply not marked as such. it seems like this issue likely affects multiple platforms, as similar primitives are used across other I'm happy to try to put together a PR that adds a test asserting unwind safety (similar tests exist for other data structures) if someone more knowledgeable than me can confirm it is the correct thing to do. This would be my first contribution, which is also why I'm hesitant to throw in a PR about something I'm not sure I fully understand. |
Condvar isn't UnwindSafe on Windows either. See rust-lang/rust#118009
What's a current state of this bug, please? |
@ecton said they'd work on here, but nothing seems to have happened. If you want to, you can submit a PR fixing it. |
Actually the current state is asking whether it is the correct behavior for all platforms or not. My last comment expressed how I do not have confidence to know that it's the right choice, and was looking for confirmation on the approach before beginning work. |
Generally for these platforms, we would really like them all to be the same, otherwise it results in really confusing issues. |
I do agree. |
Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
Rollup merge of rust-lang#121768 - ecton:condvar-unwindsafe, r=m-ou-se Implement unwind safety for Condvar on all platforms Closes rust-lang#118009 This commit adds unwind safety consistency to Condvar. Previously, only select platforms implemented unwind safety through auto traits. Known by this committer: On Linux, `Condvar` implemented `UnwindSafe` but on Mac and Windows, it did not. This change changes the implementation from auto to explicit. In rust-lang#118009, it was suggested that the platform differences were a bug and that a simple PR could address this. In trying to determine the best information to put in the `#[stable]` attribute, it [was suggested](rust-lang#121690 (comment)) I copy the stability information from the previous unwind safety implementations.
I expected to see this happen: No errors. This code compiles on Linux, as I would expect based on Condvar's documentation.
Instead, this happened: When compiling on Mac OS, I get this error:
On Linux, this code compiles correctly, and the hosted Rust docs for Convdar document this type as UnwindSafe. I'm filing this issue to ask:
Is the current MacOS implementation not actually UnwindSafe? My workaround for this issue is to wrap Condvar in AssertUnwindwSafe, but I would like to confirm this is actually safe. My personal hope is that these sync primitives are UnwindSafe and that this is a safe workaround.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: