Skip to content

!exception[tag=3587](<ref struct #35>) #636

Description

@alex28sh

Hi! We've been trying to run our Kotlin example https://github.com/Kotlin/kotlin-wasm-nodejs-template/tree/wasi/wasmtime.

We tried the following configurations of running project:

  • Coroutines compiled with Stack Switching proposal; using legacy eh for kotlin exceptions.
    Running via wizeng.x86-64-linux --ext:legacy-eh --ext:stack-switching
  • Coroutines compiled with Stack Switching proposal; using wasm exception handling proposal for kotlin exceptions.
    Running via wizeng.x86-64-linux --ext:exception-handling --ext:stack-switching
  • Coroutines compiled with default State Machine; using legacy eh for kotlin exceptions.
    Running via wizeng.x86-64-linux --ext:legacy-eh
  • Coroutines compiled with default State Machine; using wasm exception handling proposal for kotlin exceptions.
    Running via wizeng.x86-64-linux --ext:exception-handling

For every configuration we got the following error:

Hello from Kotlin/Wasm

--- Sequence aka generator ---
Sum: -1612145124
Duration: 16380ms

--- Coroutines ---
!exception[tag=3587](<ref struct #35>) (numbers for tag are varying)

In the archive attached, you can run example compiled to WebAssembly with wizeng.x86-64-linux --ext:exception-handling --ext:stack-switching kotlin-wasm-nodejs-example.wasm
kotlin.zip

Alternatively, one can play with turning off/on exception/coroutine flags in the example repo. To compile the example, you would need to publish to maven local kotlin branch with stack switching support https://github.com/JetBrains/kotlin/tree/shefer/coroutines-stack-switching-optional-prod via ./gradlew publishToMavenLocal. Then run ./gradlew compileDevelopmentExecutableKotlinWasmWasi - in build/compileSync/wasmWasi/main/developmentExecutable/kotlin you will find the compiled binaries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions