-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std: Always check for EDEADLK in rwlocks on unix #25015
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
Conversation
Apparently implementations are allowed to return EDEADLK instead of blocking forever, in which case this can lead to unsafety in the `RwLock` primitive exposed by the standard library. A debug-build of the standard library would have caught this error (due to the debug assert), but we don't ship debug builds right now. This commit adds explicit checks for the EDEADLK error code and triggers a panic to ensure the call does not succeed. Closes rust-lang#25012
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon |
Fun! @bors: r+ |
📌 Commit 5c8ca26 has been approved by |
Do we have any test builders that bootstrap/test with debug assertions on in std/rustc? |
Is there any reason to not simply change the |
⌛ Testing commit 5c8ca26 with merge 071c62d... |
⛄ The build was interrupted to prioritize another pull request. |
⌛ Testing commit 5c8ca26 with merge 9ca199a... |
⛄ The build was interrupted to prioritize another pull request. |
⌛ Testing commit 5c8ca26 with merge 47b0298... |
⛄ The build was interrupted to prioritize another pull request. |
Apparently implementations are allowed to return EDEADLK instead of blocking forever, in which case this can lead to unsafety in the `RwLock` primitive exposed by the standard library. A debug-build of the standard library would have caught this error (due to the debug assert), but we don't ship debug builds right now. This commit adds explicit checks for the EDEADLK error code and triggers a panic to ensure the call does not succeed. Closes #25012
Apparently implementations are allowed to return EDEADLK instead of blocking
forever, in which case this can lead to unsafety in the
RwLock
primitiveexposed by the standard library. A debug-build of the standard library would
have caught this error (due to the debug assert), but we don't ship debug
builds right now.
This commit adds explicit checks for the EDEADLK error code and triggers a panic
to ensure the call does not succeed.
Closes #25012