-
Notifications
You must be signed in to change notification settings - Fork 44
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
Possible data race involving set_promise() & sys::transforms::wait() #38
Comments
Could you re-test your issue with a thread safe queue from cameron314/concurrentqueue?
What is your thread sanitizer reporting exactly? |
moodycamel::BlockingConcurrentQueue is what I use in the real application. I don't have time right now to modify the code. Output from thread sanitizer is attached. Just executing the single command in README and then ./a.out will also give the thread sanitizer output. |
Version using moodycamel::BlockingConcurrentQueue |
I could reproduce it with Clang 10 and found the issue. It is indeed a race condition that happens when the waiting thread encounters a spurious wake up between continuable/include/continuable/detail/transforms/wait.hpp Lines 93 to 94 in f57c589
The The
|
Important note: Because of using a
to
|
Could you test whether 6bffb44 fixes your issue? |
Thread sanitizer is not complaining anymore and both the repro scenario and the application behave correctly now. Thank you! |
@Naios
Almost every time I run the program it will hang in the .apply(cti::transforms::wait()). Thread sanitizer also detects and reports a data race.
The compile command is in the README.
continuable-bug.tar.gz
Commit Hash
Latest.
Expected Behavior
Execute the loop 20000 times.
Actual Behavior
Misses a wakeup from the set_promise() call.
Steps to Reproduce
compile and execute the program. A thread sanitizer report will appear.
You may want to comment out line 41 in main.cc
Your Environment
The text was updated successfully, but these errors were encountered: