-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix data race in ReentrantLock fallback for targets without 64bit atomics #141248
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
The Miri subtree was changed cc @rust-lang/miri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah there is not. rust-lang/miri#4333 adds this mips target so that we will cover this in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was subtle...
r=me once CI passes
@bors r=joboet |
…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
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`
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