From 6055432cc1bbefefda3ddc876052bc5e202a88f2 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 2 Sep 2021 12:14:53 +0300 Subject: [PATCH] Fix BlockHound false positive in stack trace recovery (#2895) Fixes #2894 --- .../{ExceptionsConstuctor.kt => ExceptionsConstructor.kt} | 0 kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt | 2 ++ 2 files changed, 2 insertions(+) rename kotlinx-coroutines-core/jvm/src/internal/{ExceptionsConstuctor.kt => ExceptionsConstructor.kt} (100%) diff --git a/kotlinx-coroutines-core/jvm/src/internal/ExceptionsConstuctor.kt b/kotlinx-coroutines-core/jvm/src/internal/ExceptionsConstructor.kt similarity index 100% rename from kotlinx-coroutines-core/jvm/src/internal/ExceptionsConstuctor.kt rename to kotlinx-coroutines-core/jvm/src/internal/ExceptionsConstructor.kt diff --git a/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt b/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt index 190476c41a..e0905567d6 100644 --- a/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt +++ b/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt @@ -19,6 +19,8 @@ public class CoroutinesBlockHoundIntegration : BlockHoundIntegration { allowServiceLoaderInvocationsOnInit() allowBlockingCallsInReflectionImpl() allowBlockingCallsInDebugProbes() + // Stacktrace recovery cache is guarded by lock + allowBlockingCallsInside("kotlinx.coroutines.internal.ExceptionsConstructorKt", "tryCopyException") /* The predicates that define that BlockHound should only report blocking calls from threads that are part of the coroutine thread pool and currently execute a CPU-bound coroutine computation. */ addDynamicThreadPredicate { isSchedulerWorker(it) }