-
Notifications
You must be signed in to change notification settings - Fork 217
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
ThreadSanitizer and RwLock #323
Comments
Hi I was wondering if there was any update about getting parking_lot::RwLock to work with threadsanitizer? I'm happy to try out different configs or provide any logs if you'd like. Also let me know if you'd like to discuss the issue more and I'm happy to share some contact info so we can discuss :) |
I just tried your repo on ee51de677f1722b9b1a0ec70ac9e9462d87bf4a1 and it runs fine without producing any errors from ThreadSanitizer. I'm using |
Interesting, I just retried and still see the issue with Did you try running multiple times? The error is flaky (~50%). |
I tried running it 20 times and couldn't reproduce the error. I am on Arch Linux (kernel 5.17) with a Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz. |
Hi Amanieu, thanks for trying I really appreciate it. I created a minimal example to repeat this issue and I just wanted to check that you don't see any failures before I send this to the TSAN team. Would you mind putting your
Run via:
Code (parking_lot 0.12.0, rust edition 2021):
|
I managed to reproduce the error with your example. I've found the source of the bug, a fix is coming up. Thanks a lot for helping to track this down! |
Update deps including `parking_lot` update to 0.12.1 fixing Amanieu/parking_lot#323
I am attempting to switch from the standard library's RwLock to parking_lot's. Unfortunately when making this switch thread sanitizer started to complain about data races. I was able to isolate that this is just a matter of the RwLock, since this diff fixes the issue by switching to std::sync::RwLock - matanmarkind/active_standby@bb1cd75.
Checking out the base commit, ee51de677f1722b9b1a0ec70ac9e9462d87bf4a1, and running the following results in failures about half the time with parking_lot, while never failing with the std RwLock.
RUST_BACKTRACE=full RUSTFLAGS="-Zsanitizer=thread -g" cargo +nightly bench shared_wguard_rw_contention -Z build-std --target x86_64-unknown-linux-gnu --quiet
The text was updated successfully, but these errors were encountered: