std: Always check for EDEADLK in rwlocks on unix#25015
Merged
bors merged 2 commits intorust-lang:masterfrom May 2, 2015
Merged
std: Always check for EDEADLK in rwlocks on unix#25015bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
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
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
r? @aturon |
Contributor
|
Fun! @bors: r+ |
Collaborator
|
📌 Commit 5c8ca26 has been approved by |
Contributor
|
Do we have any test builders that bootstrap/test with debug assertions on in std/rustc? |
Member
|
Is there any reason to not simply change the |
Collaborator
|
⌛ Testing commit 5c8ca26 with merge 071c62d... |
Collaborator
|
⛄ The build was interrupted to prioritize another pull request. |
Collaborator
|
⌛ Testing commit 5c8ca26 with merge 9ca199a... |
Collaborator
|
⛄ The build was interrupted to prioritize another pull request. |
Collaborator
|
⌛ Testing commit 5c8ca26 with merge 47b0298... |
Collaborator
|
⛄ The build was interrupted to prioritize another pull request. |
Member
Author
bors
added a commit
that referenced
this pull request
May 2, 2015
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
Collaborator
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apparently implementations are allowed to return EDEADLK instead of blocking
forever, in which case this can lead to unsafety in the
RwLockprimitiveexposed 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