fix data race in ReentrantLock fallback for targets without 64bit atomics#141248
Merged
bors merged 2 commits intorust-lang:masterfrom May 19, 2025
Merged
fix data race in ReentrantLock fallback for targets without 64bit atomics#141248bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
The Miri subtree was changed cc @rust-lang/miri |
RalfJung
commented
May 19, 2025
Member
Author
There was a problem hiding this comment.
This test will not be run by bors, only by the Miri test suite on the next sync. I verified it locally.
However we anyway don't have mips-unknown-linux-gnu in the Miri test suite... is there any tier 1 target without 64bit atomics?
Member
Author
There was a problem hiding this comment.
Yeah there is not. rust-lang/miri#4333 adds this mips target so that we will cover this in the future.
joboet
approved these changes
May 19, 2025
Member
joboet
left a comment
There was a problem hiding this comment.
Wow, that was subtle...
r=me once CI passes
Member
Author
|
@bors r=joboet |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 19, 2025
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#131200 (Handle `rustc_query_system` cases of `rustc::potential_query_instability` lint) - rust-lang#141244 (windows: document that we rely on an undocumented property of GetUserProfileDirectoryW) - rust-lang#141247 (skip compiler tools sanity checks on certain commands) - rust-lang#141248 (fix data race in ReentrantLock fallback for targets without 64bit atomics) - rust-lang#141249 (introduce common macro for `MutVisitor` and `Visitor` to dedup code) - rust-lang#141253 (Warning added when dependency crate has async drop types, and the feature is disabled) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 19, 2025
Rollup merge of rust-lang#141248 - RalfJung:reentrant-lock-race, r=joboet fix data race in ReentrantLock fallback for targets without 64bit atomics See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/reentrant.20lock.20failure.20on.20musl) for details: the address used to identify a thread might get lazily allocated inside `tls_addr()`, so if we call that *after* doing the `tls_addr.load()` it is too late to establish synchronization with prior threads that used the same address -- the `load()` thus races with the `store()` by that prior thread, and might hence see outdated values, and then the entire logic breaks down. r? `@joboet`
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
May 21, 2025
…boet fix data race in ReentrantLock fallback for targets without 64bit atomics See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/reentrant.20lock.20failure.20on.20musl) for details: the address used to identify a thread might get lazily allocated inside `tls_addr()`, so if we call that *after* doing the `tls_addr.load()` it is too late to establish synchronization with prior threads that used the same address -- the `load()` thus races with the `store()` by that prior thread, and might hence see outdated values, and then the entire logic breaks down. r? `@joboet`
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.
See Zulip for details: the address used to identify a thread might get lazily allocated inside
tls_addr(), so if we call that after doing thetls_addr.load()it is too late to establish synchronization with prior threads that used the same address -- theload()thus races with thestore()by that prior thread, and might hence see outdated values, and then the entire logic breaks down.r? @joboet