Hello I use ktor-client/curl in KN/macos ``` ...
# kotlin-native
a
Hello I use ktor-client/curl in KN/macos
Copy code
return runBlocking {
            <http://client.post|client.post><String>(url) {
                contentType(ContentType.Application.Json)
                body = json
            }
        }
When server response 200 it’s OK But when I make wrong request and server response
400 Bad Request
I have got error on
<http://client.post|client.post><String>(url)
line
Copy code
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlin.collections.HashMap@d7847578
        at 0   xpoint-sdk.kexe                     0x0000000103325b07 kfun:kotlin.Throwable.<init>(kotlin.String?)kotlin.Throwable + 87 (/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/Throwable.kt:22:37)
        at 1   xpoint-sdk.kexe                     0x000000010331efb5 kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception + 85 (/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/Exceptions.kt:23:44)
        at 2   xpoint-sdk.kexe                     0x000000010331f155 kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException + 85 (/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/Exceptions.kt:34:44)
        at 3   xpoint-sdk.kexe                     0x0000000103353d75 kfun:kotlin.native.concurrent.InvalidMutabilityException.<init>(kotlin.String)kotlin.native.concurrent.InvalidMutabilityException + 85 (/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/concurrent/Freezing.kt:22:60)
        at 4   xpoint-sdk.kexe                     0x00000001033555f8 ThrowInvalidMutabilityException + 680 (/Users/teamcity3/buildAgent/work/4d622a065c544371/runtime/src/main/kotlin/kotlin/native/concurrent/Internal.kt:90:11)
...
What have I done wrong?
p
Have a look at this issue. Also contains a hotfix: https://github.com/ktorio/ktor/issues/1820
It says Windows but apparently it's a problem on all native platforms
a
@Patrick great, thank you!
n
That issue doesn't occur with the linuxX64 target although it used to occur in earlier Kotlin versions.