-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
RwLock
can sometimes deadlock on Windows with only read locks holding or waiting for the lock
#121949
Comments
As it happens, I was investigating switching to the @rustbot claim |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Apr 16, 2024
Use queue-based `RwLock` on more platforms This switches over Windows 7, SGX and Xous to the queue-based `RwLock` implementation added in rust-lang#110211, thereby fixing rust-lang#121949 for Windows 7 and partially resolving rust-lang#114581 on SGX. TEEOS can't currently be switched because it doesn't have a good thread parking implementation. CC `@roblabla` `@raoulstrackx` `@xobs` Could you help me test this, please? r? `@ChrisDenton` the Windows stuff should be familiar to you
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 16, 2024
Rollup merge of rust-lang#123811 - joboet:queue_em_up, r=ChrisDenton Use queue-based `RwLock` on more platforms This switches over Windows 7, SGX and Xous to the queue-based `RwLock` implementation added in rust-lang#110211, thereby fixing rust-lang#121949 for Windows 7 and partially resolving rust-lang#114581 on SGX. TEEOS can't currently be switched because it doesn't have a good thread parking implementation. CC `@roblabla` `@raoulstrackx` `@xobs` Could you help me test this, please? r? `@ChrisDenton` the Windows stuff should be familiar to you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried this code:
I expected to see this happen: the program continues to print increasing numbers, never stopping.
Instead, this happened: it stop after a non-deterministic amount of numbers printed, usually less than 1000.
The example is adapted from this C thread https://www.reddit.com/r/cpp/comments/1b55686/maybe_possible_bug_in_stdshared_mutex_on_windows/
According to some comments it seems to be a bug in Windows' SRWLOCK which Rust appears to use for
RwLock
.Opened as requested on zulip https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/SRWLOCK.20bug/near/424539022
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: