I think I’ve found a problem in the kotlin native ...
# kotlin-native
c
I think I’ve found a problem in the kotlin native runtime, I have a test failing (specifically segfaulting) on native that passes on JVM and this code is written entirely in common code with no threading. The gradle output was garbled but after running lldb on the test binary I was able to get back:
Copy code
Process 22710 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f603d58)
    frame #0: 0x00000001000f8ee0 test.kexe`kfun:io.github.charlietap.chasm.executor.invoker.instruction.memory.store#I32StoreSizedExecutorImpl(io.github.charlietap.chasm.executor.runtime.store.Store;io.github.charlietap.chasm.executor.runtime.Stack;io.github.charlietap.chasm.ast.instruction.MemArg;kotlin.Int){}com.github.michaelbull.result.Result<kotlin.Unit,io.github.charlietap.chasm.executor.runtime.error.InvocationError> + 16
test.kexe`kfun:io.github.charlietap.chasm.executor.invoker.instruction.memory.store#I32StoreSizedExecutorImpl(io.github.charlietap.chasm.executor.runtime.store.Store;io.github.charlietap.chasm.executor.runtime.Stack;io.github.charlietap.chasm.ast.instruction.MemArg;kotlin.Int){}com.github.michaelbull.result.Result<kotlin.Unit,io.github.charlietap.chasm.executor.runtime.error.InvocationError>:
->  0x1000f8ee0 <+16>: str    x4, [sp, #0x678]
    0x1000f8ee4 <+20>: str    w3, [sp, #0x684]
    0x1000f8ee8 <+24>: str    x2, [sp, #0x688]
    0x1000f8eec <+28>: str    x1, [sp, #0x690]
Target 0: (test.kexe) stopped.
Process 22710 launched: 'chasm/chasm/build/bin/macosArm64/debugTest/test.kexe' (arm64)
This can be recreated by checking out the branch here: https://github.com/CharlieTap/chasm/tree/wasm-testsuite-gen and running macosArm64Test or any native test over the chasm sources For context on the test thats failing, its wast wasm script test thats being converted to a kotlin multiplatform test and being run against chasm (wasm runtime).