You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our internal Java TSAN tests inside Google picked up a race condition on the develop branch with CancellableContinuationImpl.parentHandle, likely introduced in this commit that changes parentHandle to be non-volatile.
Previous read of size 4 at 0x0000cf6bf808 by thread T9:
#0 kotlinx.coroutines.CancellableContinuationImpl.getResult()Ljava/lang/Object; CancellableContinuationImpl.kt:267 #1 kotlinx.coroutines.guava.ListenableFutureKt.await(Lcom/google/common/util/concurrent/ListenableFuture;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; ListenableFuture.kt:517 #2
It appears that parentHandle can be raced at when using ListenableFuture extensions for Coroutines, (possibly because LF calls getResult() which triggers the race at line 267).
Thanks!
The text was updated successfully, but these errors were encountered:
Hey there,
Our internal Java TSAN tests inside Google picked up a race condition on the
develop
branch with CancellableContinuationImpl.parentHandle, likely introduced in this commit that changes parentHandle to be non-volatile.According to our stack trace, the race happens at
line 494 parentHandle = NonDisposableHandle
WARNING: ThreadSanitizer: data race (pid=4318)
Write of size 4 at 0x0000cf6bf808 by thread T30 (mutexes: write M379709747054803224, write M380272697008225000, write M379709747035779072, write M380272696989200768, write M357473223960208968, write M361976823587580648, write M498773662268158696, write M565201756770664040):
#0 kotlinx.coroutines.CancellableContinuationImpl.detachChild$kotlinx_coroutines_kotlinx_coroutines()V CancellableContinuationImpl.kt:494
#1 kotlinx.coroutines.CancellableContinuationImpl.detachChildIfNonResuable()V CancellableContinuationImpl.kt:485
#2 kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(Ljava/lang/Object;ILkotlin/jvm/functions/Function1;)V CancellableContinuationImpl.kt:427
#3 kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(Lkotlinx/coroutines/CancellableContinuationImpl;Ljava/lang/Object;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)V CancellableContinuationImpl.kt:420
#4 kotlinx.coroutines.CancellableContinuationImpl.resumeWith(Ljava/lang/Object;)V CancellableContinuationImpl.kt:325
#5 kotlinx.coroutines.guava.ToContinuation.run()V ListenableFuture.kt:266
Previous read of size 4 at 0x0000cf6bf808 by thread T9:
#0 kotlinx.coroutines.CancellableContinuationImpl.getResult()Ljava/lang/Object; CancellableContinuationImpl.kt:267
#1 kotlinx.coroutines.guava.ListenableFutureKt.await(Lcom/google/common/util/concurrent/ListenableFuture;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; ListenableFuture.kt:517
#2
It appears that parentHandle can be raced at when using ListenableFuture extensions for Coroutines, (possibly because LF calls getResult() which triggers the race at line 267).
Thanks!
The text was updated successfully, but these errors were encountered: