https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Aaron Stacy

09/11/2019, 6:53 PM
Hi all, I've got a codebase using coroutines on the JVM (it's a CLI tool), and it got flagged by TSAN (https://wiki.openjdk.java.net/display/tsan/Main) as having a read-after-write race. The code isn't flaky, and it has decent fuzz tests, and TSAN flags the race in
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.trySteal()Lkotlinx/coroutines/scheduling/Task
every time, which leads me to believe there's either a race in the coroutines library that's not affecting my code, or TSAN is unaware of some invariants in coroutines. Does anyone else have experience with TSAN and Kotlin Coroutines? Any idea if this is a bug or a config issue? I'm happy to share the trace if that'd help.
v

Vsevolod Tolstopyatov [JB]

09/12/2019, 9:02 AM
Please share the trace (wild guess: it’s line 983 🙂)
a

Aaron Stacy

09/12/2019, 1:32 PM
Not so bad!
106 lines. DM'd you
13 Views