-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native-mt] suspendCoroutine: CoroutinesInternalError: Fatal exception in coroutines machinery for DispatchedContinuation #2363
Comments
This appears to be a similar bug report https://youtrack.jetbrains.com/issue/KT-42876 |
I've run your code with Kotlin 1.4.0 and coroutines If it's not, then it's likely to be a Swift interop issue that should be investigated separately |
@qwwdfsad Here is unit test reproducer (kotlin 1.4.20): import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import platform.darwin.dispatch_async
import platform.darwin.dispatch_get_global_queue
import platform.posix.QOS_CLASS_UTILITY
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
import kotlin.native.concurrent.freeze
import kotlin.test.Test
class CoroutinesTest {
@Test
fun testCoroutines() {
val job = CoroutineScope(Dispatchers.Default).launch {
val cl = MyClass()
cl.doWork()
}
while (job.isActive) {
}
}
}
class MyClass {
suspend fun doWork() {
suspendCoroutine<Unit> { continuation ->
continuation.freeze()
dispatch_async(dispatch_get_global_queue(QOS_CLASS_UTILITY.toLong(), 0), {
continuation.resume(Unit)
}.freeze())
}
}
} Fails with following error:
If we omit
|
@qwwdfsad I run into the same problem as described here. You can have a look at the ready to run project here (please note to also clone the contained submodule). When running and disconnecting the network, this line throws the following error:
I am using |
Any updates? our team has hit the same issue. |
The suggested workaround is to use non- |
I am seeing a crash occurring inside of a
suspendCoroutine
block using1.3.9-native-mt-2
. The issue is shown in this sample project https://github.com/shit-city/multiplatform/tree/suspendCoroutine with aREADME
explaining the relevant files.isolated example code:
The text was updated successfully, but these errors were encountered: