-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Data race in EventLoop #3251
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
Comments
Could you please provide more detailed stacktraces? E.g. on which code path exactly |
Oh, I see, both This is definitely a bug, I already can see an interleaving that leads to an error, working on the fix. |
Nice! Thanks for working on a fix, I'm happy we were able to help here :D |
@shmuelr Hi :) What is this Java/kotlin TSAN you're talking about?? However the implementation still seems to be a work in progress and has not received updates since 2019? :/ |
Hey there,
Similar to #2660, our internal Java TSAN tests in Google picked up a race in EventLoop.common.kt
The race in EventLoop seems to be here
https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/EventLoop.common.kt#L417-L420
that write is not thread safe, but the
dispose
function is marked as synchronizedhttps://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/EventLoop.common.kt#L479-L485
leading to the race in
_heap
reading & writing.Is this race safe?
Thanks!
The text was updated successfully, but these errors were encountered: