https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

Christian Sousa

10/12/2020, 4:09 PM
Hey guys, I’m investigating for the company I work for if we can upgrade to Kotlin 1.4 (we are using Kotlin 1.3.70 right now), but when updating for 1.4.10 or even 1.4.20-M1 I get the following on iOS (we are building a multiplatform project):
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Does anyone knows what might be causing this? This is not happening on our current implementation using 1.3.70, so it might be something that might’ve changed in this new release. Any help would be really nice! Thanks in advance!
a

aleksey.tomin

10/12/2020, 4:17 PM
I think you have some problem in your code with concurrent. 1.4 is more strong on this. For example you cannot use runBlocking as often as before. You have to review all your code for concurrent problems
👍 1
c

Christian Sousa

10/12/2020, 4:19 PM
Do you think it might be related to this:
Copy code
actual val ApplicationDispatcher: CoroutineDispatcher = NsQueueDispatcher(dispatch_get_main_queue())

internal class NsQueueDispatcher(
    private val dispatchQueue: dispatch_queue_t
) : CoroutineDispatcher() {
    override fun dispatch(context: CoroutineContext, block: Runnable) {
        dispatch_async(dispatchQueue) {
            block.run()
        }
    }
}
?
a

aleksey.tomin

10/12/2020, 4:24 PM
I don’t know. I’ve fixed my code but will not find your problem.
c

Christian Sousa

10/12/2020, 4:34 PM
I was asking this because this is the only place where I do something related to blocking.. I’ve even changed it to:
Copy code
actual val ApplicationDispatcher: CoroutineDispatcher = Dispatchers.Main
But I’m getting the same outcome..
7 Views