Ktor: Upload via iOS (Kotlin Native/Multiplatform) failed: pointer being freed was not allocated

Created on 23 May 2019  路  11Comments  路  Source: ktorio/ktor

Ktor Version - 1.2.0
Ktor Engine Used(client or server and name)

  • Multiplatform/Native Client
  • core-iosarm64
  • json-iosarm64
  • ios-iosarm64
  • serialization-iosarm64
    Operating System - iOS
    Request: PUT
    content-type: 聽Multipart/form-data
    Ktor Client Engine: iOS

Tried to upload an image via iOS ktor client and it produces the error shown below. Versions before 1.2.0 works.

iosApp(6943,0x1049d2b80) malloc: *** error for object 0x106794018: pointer being freed was not allocated
iosApp(6943,0x1049d2b80) malloc: *** set a breakpoint in malloc_error_break to debug
 GlobalScope.launch(Dispatchers.Main) {
            try {
                client.submitForm {
                    url("http://192.168.1.47:8000/api/images/")
                    method = HttpMethod.Put
                    header(HttpHeaders.Authorization, "JWT $token")

                    body = MultiPartFormDataContent(
                        formData {
                            append(
                                "image",
                                data,
                                Headers.build {
                                    append(HttpHeaders.ContentType, "image/jpg")
                                    append(HttpHeaders.ContentDisposition, " filename=hello.jpg")
                                }
                            )
                        }
                    )
                }
            } catch (e: Exception){
            }
        }

Most helpful comment

@cy6erGn0m

All 11 comments

This is how I read the file

fun readFile(fileUrl: String): ByteArray {
    val nsdata = NSData.create(contentsOfFile = fileUrl)
    if (nsdata != null){
        val byteArray = toByteArray(nsData = nsdata)
        byteArray.freeze()
        return byteArray
    } else {
        throw Exception("file not found!")
    }
}

Hi @LiewJunTung, thanks for the report. It looks like Worker related issue.
Can you try to send it in Dispatcher.Unconfined?

Sorry for the late reply. I'm actually using the Dispatcher this way.

object MainLoopDispatcher: CoroutineDispatcher(){
    override fun dispatch(context: CoroutineContext, block: Runnable) {
        NSRunLoop.mainRunLoop().performBlock {
            block.run()
        }
    }
}

GlobalScope.launch(MainLoopDispatcher) {
            try {
                client.submitForm {
                    url("http://192.168.1.47:8000/api/images/")
                    method = HttpMethod.Put
                    header(HttpHeaders.Authorization, "JWT $token")

                    body = MultiPartFormDataContent(
                        formData {
                            append(
                                "image",
                                data,
                                Headers.build {
                                    append(HttpHeaders.ContentType, "image/jpg")
                                    append(HttpHeaders.ContentDisposition, " filename=hello.jpg")
                                }
                            )
                        }
                    )
                }
            } catch (e: Exception){
            }
        }

Hi @e5l. Can I bring your attention to this issue, please?

Hi @LiewJunTung, could you check it with 1.2.3? It doesn't look like ktor related issue because we don't use direct calls to malloc.

Here is a repository that you can use to replicate the problem
https://github.com/LiewJunTung/Ktor-Upload-Test

As stated above. It was working fine before version 1.2.0

Thanks, I'll take a look

Reproduced with:

iosApp(11353,0x116edf5c0) malloc: *** error for object 0x129f7f018: pointer being freed was not allocated
iosApp(11353,0x116edf5c0) malloc: *** set a breakpoint in malloc_error_break to debug
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000010b5272c6 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x000000010b57abf1 libsystem_pthread.dylib`pthread_kill + 284
    frame #2: 0x000000010b2ea01d libsystem_c.dylib`abort + 127
    frame #3: 0x000000010b440c78 libsystem_malloc.dylib`malloc_vreport + 545
    frame #4: 0x000000010b440e68 libsystem_malloc.dylib`malloc_report + 151
    frame #5: 0x000000010865b048 app`kfun:kotlinx.cinterop.nativeMemUtils.free(<this>=0x0000600003d3bb58, mem=0x0000000129f7f018) at NativeMem.kt:126:9
    frame #6: 0x000000010865ae12 app`kfun:kotlinx.cinterop.nativeHeap.free(<this>=0x0000600003d3bb08, mem=0x0000000129f7f018) at Utils.kt:36:56
    frame #7: 0x0000000108665f06 app`kfun:[email protected].(<this>=0x0000600003d3bb08, pointer=0x0000000129f7f018) at Utils.kt:30:70
  * frame #8: 0x0000000108665dd1 app`kfun:kotlinx.io.core.IoBuffer.Companion.object-1.recycle#internal(<this>=0x0000600003d1c1c8, instance=0x0000600001c2d728) at IoBufferNative.kt:1067:28
    frame #9: 0x0000000108662a07 app`kfun:kotlinx.io.core.IoBuffer.release(<this>=0x0000600001c2d728, pool=0x0000600003d1c1c8) at IoBufferNative.kt:1028:22
    frame #10: 0x000000010867c126 app`kfun:kotlinx.io.core.ByteReadPacketBase.releaseHead$kotlinx-io(<this>=0x0000600002a94308, head=0x0000600001c2d728)kotlinx.io.core.IoBuffer at Packet.kt:924:14
    frame #11: 0x00000001086d271c app`kfun:kotlinx.io.core.ByteReadPacketBase.afterRead#internal(<this>=0x0000600002a94308) at Packet.kt:914:13
    frame #12: 0x00000001086d2219 app`kfun:kotlinx.io.core.ByteReadPacketBase.readAsMuchAsPossible#internal(<this>=0x0000600002a94308, array=0x0000000125113008, offset=168, length=14865788, copied=168) at Packet.kt:653:13
    frame #13: 0x00000001086d223a app`kfun:kotlinx.io.core.ByteReadPacketBase.readAsMuchAsPossible#internal(<this>=0x0000600002a94308, array=0x0000000125113008, offset=0, length=14865956, copied=0) at Packet.kt:654:13
    frame #14: 0x00000001086d0a98 app`kfun:kotlinx.io.core.ByteReadPacketBase.readAvailable(<this>=0x0000600002a94308, dst=0x0000000125113008, offset=0, length=14865956)kotlin.Int at Packet.kt:233:16
    frame #15: 0x00000001086cfa90 app`kfun:kotlinx.io.core.ByteReadPacketBase.readFully(<this>=0x0000600002a94308, dst=0x0000000125113008, offset=0, length=14865956) at Packet.kt:240:18
    frame #16: 0x00000001086d528b app`kfun:[email protected].(kotlin.Int)kotlin.ByteArray [inlined] <inlined-out:<anonymous>> at Strings.kt:165:25
    frame #17: 0x00000001086d527a app`kfun:[email protected].(kotlin.Int)kotlin.ByteArray [inlined] kfun:kotlin.also@#GENERIC.(kotlin.Function1<#GENERIC,kotlin.Unit>)Generic at Standard.kt:106
    frame #18: 0x00000001086d527a app`kfun:[email protected].(<this>=0x0000600002a94308, n=14865956)kotlin.ByteArray at Strings.kt:165
    frame #19: 0x00000001086d511c app`kfun:[email protected].(<this>=0x0000600002a94308, n=0, $mask0=1)kotlin.ByteArray at Strings.kt:162:1
    frame #20: 0x00000001087597cf app`kfun:io.ktor.client.engine.ios.IosClientEngine.$execute$<anonymous>_53COROUTINE$5.invokeSuspend#internal(<this>=0x000060000140cd28, result=0x0000600002a94308) at IosClientEngine.kt:99:43
    frame #21: 0x0000000108636f85 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) [inlined] <inlined-out:<anonymous>> at ContinuationImpl.kt:30:39
    frame #22: 0x0000000108636f37 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) [inlined] kfun:kotlin.with(#GENERIC;kotlin.Function1<#GENERIC,#GENERIC>)Generic at Standard.kt:53
    frame #23: 0x0000000108636f37 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(<this>=0x0000600002a94388, result=0x0000000108811bb8) at ContinuationImpl.kt:26
    frame #24: 0x000000010863ba13 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] kfun:[email protected]<#GENERIC>.(#GENERIC)Generic at Continuation.kt:44:5
    frame #25: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] <inlined-out:<anonymous>> at Dispatched.kt:158
    frame #26: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] kfun:kotlinx.coroutines.withCoroutineContext$kotlinx-coroutines-core(kotlin.coroutines.CoroutineContext;kotlin.Any?;kotlin.Function0<#GENERIC>)Generic at CoroutineContext.kt:47
    frame #27: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run(<this>=0x0000600001c2d868) at Dispatched.kt:158
    frame #28: 0x000000010863a78d app`kfun:kotlinx.coroutines.EventLoop.processUnconfinedEvent(<this>=0x0000600001c2cc88)kotlin.Boolean at EventLoop.common.kt:68:14
    frame #29: 0x000000010863a12c app`kfun:kotlinx.coroutines.resumeCancellable$kotlinx-coroutines-core@kotlin.coroutines.Continuation<#GENERIC>.(#GENERIC)Generic [inlined] kfun:kotlinx.coroutines.runUnconfinedEventLoop#internal at Dispatched.kt:63:28
    frame #30: 0x000000010863a116 app`kfun:kotlinx.coroutines.resumeCancellable$kotlinx-coroutines-core@kotlin.coroutines.Continuation<#GENERIC>.(#GENERIC)Generic [inlined] kfun:kotlinx.coroutines.executeUnconfined#internal at Dispatched.kt:36
    frame #31: 0x000000010863a116 app`kfun:kotlinx.coroutines.resumeCancellable$kotlinx-coroutines-core@kotlin.coroutines.Continuation<#GENERIC>.(#GENERIC)Generic [inlined] kfun:kotlinx.coroutines.DispatchedContinuation.resumeCancellable(#GENERIC) at Dispatched.kt:121
    frame #32: 0x000000010863a116 app`kfun:kotlinx.coroutines.resumeCancellable$kotlinx-coroutines-core@kotlin.coroutines.Continuation<#GENERIC>.(<this>=0x0000600001c2dcc8, value=4437646264)Generic at Dispatched.kt:184
    frame #33: 0x000000010870e7a8 app`kfun:kotlinx.coroutines.intrinsics.startCoroutineCancellable$kotlinx-coroutines-core@kotlin.coroutines.SuspendFunction1<#GENERIC,#GENERIC>.(#GENERIC;kotlin.coroutines.Continuation<#GENERIC>)Generic [inlined] <inlined-out:<anonymous>> at Cancellable.kt:26:74
    frame #34: 0x000000010870e77c app`kfun:kotlinx.coroutines.intrinsics.startCoroutineCancellable$kotlinx-coroutines-core@kotlin.coroutines.SuspendFunction1<#GENERIC,#GENERIC>.(#GENERIC;kotlin.coroutines.Continuation<#GENERIC>)Generic [inlined] kfun:kotlinx.coroutines.intrinsics.runSafely#internal at Cancellable.kt:37
    frame #35: 0x000000010870e77c app`kfun:kotlinx.coroutines.intrinsics.startCoroutineCancellable$kotlinx-coroutines-core@kotlin.coroutines.SuspendFunction1<#GENERIC,#GENERIC>.(<this>=0x000060000140cc48, receiver=105553168400440, completion=0x00006000031b8038)Generic at Cancellable.kt:25
    frame #36: 0x000000010870e5ea app`kfun:kotlinx.coroutines.CoroutineStart.invoke(<this>=0x0000600003e19c48, block=0x000060000140cc48, receiver=105553168400440, completion=0x00006000031b8038)Generic at CoroutineStart.kt:109:45
    frame #37: 0x000000010870d7e2 app`kfun:kotlinx.coroutines.AbstractCoroutine.start(<this>=0x00006000031b8038, start=0x0000600003e19c48, receiver=105553168400440, block=0x000060000140cc48)Generic at AbstractCoroutine.kt:154:9
    frame #38: 0x000000010870d449 app`kfun:[email protected].(<this>=0x00006000031b0f38, context=0x0000600003f31188, start=0x0000600003e19c48, block=0x000060000140cc48)kotlinx.coroutines.Job at Builders.common.kt:54:15
    frame #39: 0x000000010870d198 app`kfun:kotlinx.coroutines.launch$default@kotlinx.coroutines.CoroutineScope.(<this>=0x00006000031b0f38, context=0x0000600003f31188, start=0x0000000000000000, block=0x000060000140cc48, $mask0=2)kotlinx.coroutines.Job at Builders.common.kt:45:8
    frame #40: 0x0000000108754bdf app`kfun:io.ktor.client.engine.ios.IosClientEngine.execute(io.ktor.client.request.HttpRequestData)io.ktor.client.request.HttpResponseData [inlined] <inlined-out:<anonymous>> at IosClientEngine.kt:93:9
    frame #41: 0x000000010875467a app`kfun:io.ktor.client.engine.ios.IosClientEngine.execute(io.ktor.client.request.HttpRequestData)io.ktor.client.request.HttpResponseData [inlined] <inlined-out:<anonymous>> at CancellableContinuation.kt:118
    frame #42: 0x000000010875467a app`kfun:io.ktor.client.engine.ios.IosClientEngine.execute(<this>=0x00006000031b0f38, data=0x0000600002a4f188)io.ktor.client.request.HttpResponseData at IosClientEngine.kt:16
    frame #43: 0x00000001087553ec app`kfun:io.ktor.client.engine.HttpClientEngine.$install$lambda-1COROUTINE$15.invokeSuspend#internal(<this>=0x000060000140fe28, result=0x0000000108811bb8) at HttpClientEngine.kt:49:32
    frame #44: 0x000000010875894a app`kfun:io.ktor.client.engine.HttpClientEngine.$install$lambda-1COROUTINE$15.invoke#internal(<this>=0x000060000141b8e8, <this>=0x0000600001c515e8, content=0x0000600001b02be8) at HttpClientEngine.kt:41:64
    frame #45: 0x00000001086f9685 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal [inlined] kfun:io.ktor.util.startCoroutineUninterceptedOrReturn3$ktor-utils@kotlin.coroutines.SuspendFunction2<#GENERIC,#GENERIC,kotlin.Unit>.(#GENERIC;#GENERIC;kotlin.coroutines.Continuation<kotlin.Unit>)Generic at CoroutinesUtilsNative.kt:20:21
    frame #46: 0x00000001086f960d app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal(<this>=0x0000600001c515e8, direct=true) at PipelineContext.kt:23
    frame #47: 0x00000001086fa283 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal [inlined] <inlined-out:<anonymous>> at PipelineContext.kt:141:13
    frame #48: 0x00000001086fa218 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal(<this>=0x0000600001c515e8) at PipelineContext.kt:18
    frame #49: 0x00000001086f9fdf app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.execute#internal(<this>=0x0000600001c515e8, initial=105553144589288) at PipelineContext.kt:161:16
    frame #50: 0x00000001086f8cc6 app`kfun:io.ktor.util.pipeline.Pipeline.execute(<this>=0x0000600002a4a708, context=105553160784520, subject=105553144589288)#GENERIC_kotlin.Any at Pipeline.kt:27:41
    frame #51: 0x00000001086f89c9 app`kfun:io.ktor.client.features.HttpSend.DefaultSender.$executeCOROUTINE$28.invokeSuspend#internal(<this>=0x0000600002a4f008, result=0x0000000108811bb8) at HttpSend.kt:90:40
    frame #52: 0x00000001086f8746 app`kfun:io.ktor.client.features.HttpSend.DefaultSender.execute#internal(<this>=0x0000600003fd72c8, requestBuilder=0x0000600002a74a88) at HttpSend.kt:86:26
    frame #53: 0x00000001086f818e app`kfun:io.ktor.client.features.HttpSend.Feature.$install$lambda-0COROUTINE$27.invokeSuspend#internal(<this>=0x0000600001131408, result=0x0000000108811bb8) at HttpSend.kt:62:42
    frame #54: 0x00000001086fa71a app`kfun:io.ktor.client.features.HttpSend.Feature.$install$lambda-0COROUTINE$27.invoke#internal(<this>=0x0000600001139208, <this>=0x0000600001c51818, content=0x0000600001b02be8) at HttpSend.kt:56:71
    frame #55: 0x00000001086f9685 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal [inlined] kfun:io.ktor.util.startCoroutineUninterceptedOrReturn3$ktor-utils@kotlin.coroutines.SuspendFunction2<#GENERIC,#GENERIC,kotlin.Unit>.(#GENERIC;#GENERIC;kotlin.coroutines.Continuation<kotlin.Unit>)Generic at CoroutinesUtilsNative.kt:20:21
    frame #56: 0x00000001086f960d app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal(<this>=0x0000600001c51818, direct=true) at PipelineContext.kt:23
    frame #57: 0x00000001086fa283 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal [inlined] <inlined-out:<anonymous>> at PipelineContext.kt:141:13
    frame #58: 0x00000001086fa218 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal(<this>=0x0000600001c51818) at PipelineContext.kt:18
    frame #59: 0x00000001086f9ea0 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceedWith#internal(<this>=0x0000600001c51818, subject=105553144589288) at PipelineContext.kt:151:16
    frame #60: 0x00000001086e1f14 app`kfun:io.ktor.client.features.HttpCallValidator.Companion.$install$lambda-0COROUTINE$19.invokeSuspend#internal(<this>=0x0000600001c51778, result=0x0000000108811bb8) at HttpCallValidator.kt:87:21
    frame #61: 0x00000001086e213a app`kfun:io.ktor.client.features.HttpCallValidator.Companion.$install$lambda-0COROUTINE$19.invoke#internal(<this>=0x0000600001c41a48, <this>=0x0000600001c51818, it=0x0000600001b02be8) at HttpCallValidator.kt:85:73
    frame #62: 0x00000001086f9685 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal [inlined] kfun:io.ktor.util.startCoroutineUninterceptedOrReturn3$ktor-utils@kotlin.coroutines.SuspendFunction2<#GENERIC,#GENERIC,kotlin.Unit>.(#GENERIC;#GENERIC;kotlin.coroutines.Continuation<kotlin.Unit>)Generic at CoroutinesUtilsNative.kt:20:21
    frame #63: 0x00000001086f960d app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.loop#internal(<this>=0x0000600001c51818, direct=true) at PipelineContext.kt:23
    frame #64: 0x00000001086fa283 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal [inlined] <inlined-out:<anonymous>> at PipelineContext.kt:141:13
    frame #65: 0x00000001086fa218 app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.proceed#internal(<this>=0x0000600001c51818) at PipelineContext.kt:18
    frame #66: 0x00000001086f9fdf app`kfun:io.ktor.util.pipeline.SuspendFunctionGun.execute#internal(<this>=0x0000600001c51818, initial=105553144589288) at PipelineContext.kt:161:16
    frame #67: 0x00000001086f8cc6 app`kfun:io.ktor.util.pipeline.Pipeline.execute(<this>=0x0000600002a4a508, context=105553160784520, subject=105553144589288)#GENERIC_kotlin.Any at Pipeline.kt:27:41
    frame #68: 0x0000000108717229 app`kfun:io.ktor.client.HttpClient.$executeCOROUTINE$7.invokeSuspend(<this>=0x0000600002a4f148, result=0x0000000108811bb8)kotlin.Any? at HttpClient.kt:141:25
    frame #69: 0x0000000108717056 app`kfun:io.ktor.client.HttpClient.execute(<this>=0x0000600001b0c548, builder=0x0000600002a74a88)io.ktor.client.call.HttpClientCall at HttpClient.kt:140:13
    frame #70: 0x0000000108716ef1 app`kfun:io.ktor.client.call.$callCOROUTINE$10.invokeSuspend(<this>=0x0000600001c518b8, result=0x0000000108811bb8)kotlin.Any? at HttpClientCall.kt:140:5
    frame #71: 0x0000000108716bd6 app`kfun:[email protected].(<this>=0x0000600001b0c548, block=0x0000600002a75048)io.ktor.client.call.HttpClientCall at HttpClientCall.kt:139:9
    frame #72: 0x0000000108710f7f app`kfun:[email protected].(<this>=0x0000600001b0c548, builder=0x0000600002a82888)io.ktor.client.call.HttpClientCall at utils.kt:30:76
    frame #73: 0x000000010870f5db app`kfun:org.liewjuntung.testktor.FooPresenter.$uploadStuff$lambda-2COROUTINE$0.invokeSuspend#internal [inlined] kfun:[email protected].()Generic at HttpClientCall.kt:22:13
    frame #74: 0x000000010870f4f8 app`kfun:org.liewjuntung.testktor.FooPresenter.$uploadStuff$lambda-2COROUTINE$0.invokeSuspend#internal [inlined] kfun:[email protected].(io.ktor.client.request.HttpRequestBuilder)Generic at builders.kt:22
    frame #75: 0x000000010870f4f8 app`kfun:org.liewjuntung.testktor.FooPresenter.$uploadStuff$lambda-2COROUTINE$0.invokeSuspend#internal [inlined] kfun:[email protected].(kotlin.Function1<io.ktor.client.request.HttpRequestBuilder,kotlin.Unit>)Generic at builders.kt:28
    frame #76: 0x000000010870f4f8 app`kfun:org.liewjuntung.testktor.FooPresenter.$uploadStuff$lambda-2COROUTINE$0.invokeSuspend#internal [inlined] kfun:io.ktor.client.request.forms.submitForm@io.ktor.client.HttpClient.(io.ktor.http.Parameters;kotlin.Boolean;kotlin.Function1<io.ktor.client.request.HttpRequestBuilder,kotlin.Unit>)Generic at formBuilders.kt:28
    frame #77: 0x000000010870f4f8 app`kfun:org.liewjuntung.testktor.FooPresenter.$uploadStuff$lambda-2COROUTINE$0.invokeSuspend#internal(<this>=0x000060000111a088, result=0x0000000108811bb8) at FooPresenter.kt:27
    frame #78: 0x0000000108636f85 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) [inlined] <inlined-out:<anonymous>> at ContinuationImpl.kt:30:39
    frame #79: 0x0000000108636f37 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(kotlin.Result<kotlin.Any?>) [inlined] kfun:kotlin.with(#GENERIC;kotlin.Function1<#GENERIC,#GENERIC>)Generic at Standard.kt:53
    frame #80: 0x0000000108636f37 app`kfun:kotlin.coroutines.native.internal.BaseContinuationImpl.resumeWith(<this>=0x000060000111a088, result=0x0000000108811bb8) at ContinuationImpl.kt:26
    frame #81: 0x000000010863ba13 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] kfun:[email protected]<#GENERIC>.(#GENERIC)Generic at Continuation.kt:44:5
    frame #82: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] <inlined-out:<anonymous>> at Dispatched.kt:158
    frame #83: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run() [inlined] kfun:kotlinx.coroutines.withCoroutineContext$kotlinx-coroutines-core(kotlin.coroutines.CoroutineContext;kotlin.Any?;kotlin.Function0<#GENERIC>)Generic at CoroutineContext.kt:47
    frame #84: 0x000000010863b9f2 app`kfun:kotlinx.coroutines.DispatchedTask.run(<this>=0x0000600001c33258) at Dispatched.kt:158
    frame #85: 0x0000000108728c80 app`kfun:org.liewjuntung.testktor.ThisCoroutineDispatcher.dispatch$lambda-0#internal(block=0x0000600001c33258) at CommonCoroutineContext.kt:15:23
    frame #86: 0x0000000108728c25 app`kfun:org.liewjuntung.testktor.ThisCoroutineDispatcher.$dispatch$lambda-0$FUNCTION_REFERENCE$3.invoke#internal(<this>=0x0000600003e1c748) at CommonCoroutineContext.kt:13:51
    frame #87: 0x0000000108728bf5 app`kfun:org.liewjuntung.testktor.ThisCoroutineDispatcher.$dispatch$lambda-0$FUNCTION_REFERENCE$3.$<bridge-UNN>invoke(<this>=0x0000600003e1c748)#internal at CommonCoroutineContext.kt:13:51
    frame #88: 0x000000010878ae9a app`platform_darwin_kniBridge202(p0=0x0000600003e1c760) at darwin.kt:24531:12
    frame #89: 0x00000001087a7499 app`__platform_darwin_kniBridge201_block_invoke + 25
    frame #90: 0x000000010b18dd7f libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #91: 0x000000010b18edb5 libdispatch.dylib`_dispatch_client_callout + 8
    frame #92: 0x000000010b19c080 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 1540
    frame #93: 0x000000010abada79 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #94: 0x000000010aba8126 CoreFoundation`__CFRunLoopRun + 2310
    frame #95: 0x000000010aba74d2 CoreFoundation`CFRunLoopRunSpecific + 626
    frame #96: 0x0000000112f7a2fe GraphicsServices`GSEventRunModal + 65
    frame #97: 0x000000010d74cfc2 UIKitCore`UIApplicationMain + 140
    frame #98: 0x000000010830e678 iosApp`main at AppDelegate.swift:4:7
    frame #99: 0x000000010b203541 libdyld.dylib`start + 1

@cy6erGn0m

To save anyone else time... this seems to be fixed on Ktor 1.3.0-beta-1

Thanks for the notice. Closed.

Was this page helpful?
0 / 5 - 0 ratings