Skip to content

Weird bug on iOS - handleCoroutineException #4419

@Monabr

Description

@Monabr

Describe the bug

Hello. For about a month I see this crash on iOS. I don't see such problem on Android and don't understand what is the problem.

Am I missing something? Is this bug on Kotlin Coroutines side?

0  libsystem_kernel.dylib         0xc42c __pthread_kill + 8
1  libsystem_pthread.dylib        0x7c0c pthread_kill + 268
2  libsystem_c.dylib              0x75ba0 abort + 180
3  MyApplication                  0x59d2b3c ReportBacktraceToIosCrashLog(ObjHeader*) + 4435733308
4  MyApplication                  0x59d2a5c void (anonymous namespace)::$_0::operator()<(anonymous namespace)::terminateWithUnhandledException(ObjHeader*)::$_1>((anonymous namespace)::terminateWithUnhandledException(ObjHeader*)::$_1) + 4435733084
5  MyApplication                  0x59d2854 (anonymous namespace)::TerminateHandler::queuedHandler() + 4435732564
6  MyApplication                  0x59d2840 (anonymous namespace)::processUnhandledException(ObjHeader*) + 4435732544
7  MyApplication                  0x9f086c kfun:kotlinx.coroutines#handleCoroutineException(kotlin.coroutines.CoroutineContext;kotlin.Throwable){} + 49 (CoroutineExceptionHandlerImpl.common.kt:49)
8  MyApplication                  0x9e5ea8 kfun:kotlinx.coroutines.StandaloneCoroutine.handleJobException#internal + 194 (Builders.common.kt:194)
9  MyApplication                  0x9fb778 kfun:kotlinx.coroutines.JobSupport.finalizeFinishingState#internal + 223 (JobSupport.kt:223)
10 MyApplication                  0xa0153c kfun:kotlinx.coroutines.JobSupport.tryMakeCompleting#internal + 946 (JobSupport.kt:946)
11 MyApplication                  0xa00e38 kfun:kotlinx.coroutines.JobSupport#makeCompletingOnce(kotlin.Any?){}kotlin.Any? + 859 (JobSupport.kt:859)
12 MyApplication                  0x9e3140 kfun:kotlinx.coroutines.AbstractCoroutine#resumeWith(kotlin.Result<1:0>){} + 99 (AbstractCoroutine.kt:99)
13 MyApplication                  0x7ec590 kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 48 (ContinuationImpl.kt:48)
14 MyApplication                  0xa4bc1c kfun:kotlinx.coroutines.internal.ScopeCoroutine#afterResume(kotlin.Any?){} + 36 (Scopes.kt:36)
15 MyApplication                  0x9e319c kfun:kotlinx.coroutines.AbstractCoroutine#resumeWith(kotlin.Result<1:0>){} + 102 (AbstractCoroutine.kt:102)
16 MyApplication                  0x7ec590 kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 48 (ContinuationImpl.kt:48)
17 MyApplication                  0xa46f60 kfun:kotlinx.coroutines.DispatchedTask#run(){} + 109 (DispatchedTask.kt:109)
18 MyApplication                  0xa491d0 kfun:kotlinx.coroutines.internal.LimitedDispatcher.Worker.run#internal + 128 (LimitedDispatcher.kt:128)
19 MyApplication                  0xa658e0 kfun:kotlinx.coroutines.MultiWorkerDispatcher.MultiWorkerDispatcher$workerRunLoop$1.$invokeCOROUTINE$0.invokeSuspend#internal + 103 (MultithreadedDispatchers.kt:103)
20 MyApplication                  0x7ec38c kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 50 (ContinuationImpl.kt:50)
21 MyApplication                  0xa46cdc kfun:kotlinx.coroutines.DispatchedTask#run(){} + 26 (Continuation.kt:26)
22 MyApplication                  0x9f5f68 kfun:kotlinx.coroutines.EventLoopImplBase#processNextEvent(){}kotlin.Long + 15 (ObjectiveCUtils.kt:15)
23 MyApplication                  0xa5cda4 kfun:kotlinx.coroutines#runBlocking(kotlin.coroutines.CoroutineContext;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,0:0>){0§<kotlin.Any?>}0:0 + 49 (EventLoop.common.kt:49)
24 MyApplication                  0xa64a98 kfun:kotlinx.coroutines.MultiWorkerDispatcher.MultiWorkerDispatcher$1.MultiWorkerDispatcher$1$invoke$$inlined$apply$1.$<bridge-DNN>invoke(){}#internal + 123 (MultithreadedDispatchers.kt:123)
25 MyApplication                  0x59e1064 Worker::processQueueElement(bool) + 51472
26 MyApplication                  0x59e06b4 (anonymous namespace)::workerRoutine(void*) + 48992
27 libsystem_pthread.dylib        0x606c _pthread_start + 136
28 libsystem_pthread.dylib        0x10d8 thread_start + 8

Provide a Reproducer

  • As I see from log - crash appears on the different screens of the app so I have no pattern to provide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions