Skip to content

UncaughtExceptionHandlerIntegration.java causes ANR when waiting for File I/O #2719

@kylannjohnson

Description

@kylannjohnson

Integration

sentry-android

Build System

Gradle

AGP Version

7.4.2

Proguard

Enabled

Version

6.16.0

Steps to Reproduce

Not entirely sure. The ANR seems to come from an uncaught exception in coroutine based code.

Expected Result

App shouldn't crash.

Actual Result

here is the ANR with some redactions

  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:234)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos (AbstractQueuedSynchronizer.java:1079)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos (AbstractQueuedSynchronizer.java:1369)
  at java.util.concurrent.CountDownLatch.await (CountDownLatch.java:278)
  at io.sentry.UncaughtExceptionHandlerIntegration$UncaughtExceptionHint.waitFlush (UncaughtExceptionHandlerIntegration.java:169)
  at io.sentry.UncaughtExceptionHandlerIntegration.uncaughtException (UncaughtExceptionHandlerIntegration.java:106)
  at [**redacted**]GlobalExceptionHandler.uncaughtException (GlobalExceptionHandler.kt:23)
  at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException (CrashlyticsUncaughtExceptionHandler.java:62)
  at java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:1073)
  at java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:1068)
  at kotlinx.coroutines.CoroutineExceptionHandlerImplKt.handleCoroutineExceptionImpl (CoroutineExceptionHandlerImpl.kt:61)
  at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException (CoroutineExceptionHandler.kt:33)
  at kotlinx.coroutines.StandaloneCoroutine.handleJobException (Builders.common.kt:196)
  at kotlinx.coroutines.JobSupport.finalizeFinishingState (JobSupport.kt:229)
  at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath (JobSupport.kt:906)
  at kotlinx.coroutines.JobSupport.tryMakeCompleting (JobSupport.kt:863)
  at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core (JobSupport.kt:828)
  at kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.kt:100)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:46)
  at kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith (DispatchedContinuation.java:256)
  at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith (DispatchedContinuation.kt:282)
  at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default (DispatchedContinuation.kt:278)
  at kotlinx.coroutines.internal.ScopeCoroutine.afterCompletion (Scopes.kt:28)
  at kotlinx.coroutines.JobSupport.continueCompleting (JobSupport.kt:936)
  at kotlinx.coroutines.JobSupport.access$awaitSuspend (JobSupport.kt)
  at kotlinx.coroutines.JobSupport.access$continueCompleting (JobSupport.kt)
  at kotlinx.coroutines.JobSupport$ChildCompletion.invoke (JobSupport.kt:1155)
  at kotlinx.coroutines.JobSupport.notifyHandlers (JobSupport.kt:368)
  at kotlinx.coroutines.JobSupport.notifyCompletion (JobSupport.kt:362)
  at kotlinx.coroutines.JobSupport.completeStateFinalization (JobSupport.kt:323)
  at kotlinx.coroutines.JobSupport.finalizeFinishingState (JobSupport.kt:240)
  at kotlinx.coroutines.JobSupport.continueCompleting (JobSupport.kt:935)
  at kotlinx.coroutines.JobSupport.access$awaitSuspend (JobSupport.kt)
  at kotlinx.coroutines.JobSupport.access$continueCompleting (JobSupport.kt)
  at kotlinx.coroutines.JobSupport$ChildCompletion.invoke (JobSupport.kt:1155)
  at kotlinx.coroutines.JobSupport.notifyHandlers (JobSupport.kt:368)
  at kotlinx.coroutines.JobSupport.notifyCompletion (JobSupport.kt:362)
  at kotlinx.coroutines.JobSupport.completeStateFinalization (JobSupport.kt:323)
  at kotlinx.coroutines.JobSupport.finalizeFinishingState (JobSupport.kt:240)
  at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath (JobSupport.kt:906)
  at kotlinx.coroutines.JobSupport.tryMakeCompleting (JobSupport.kt:863)
  at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core (JobSupport.kt:828)
  at kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.kt:100)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:46)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
  at android.os.Handler.handleCallback (Handler.java:942)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8757)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

Metadata

Metadata

Assignees

Labels

BugIssue type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions