-
Notifications
You must be signed in to change notification settings - Fork 3
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
Chasm 0.9.3: execution fails with MissingStackFrame on exception handling #77
Comments
Hey @illarionov 👋🏼 When I run the repro locally it seems to work: Weh Demo Resultswehdemo on exceptionBug via 🅶 v8.12 via ☕ v23.0.1 via 🅺 v2.1.0 via 💎 v3.2.2
❯ ./gradlew chasm-runner:jvmRun
Welcome to Gradle 8.12!
Here are the highlights of this release:
- Enhanced error and warning reporting with the Problems API
- File-system watching support on Alpine Linux
- Build and test Swift 6 libraries and apps
For more details see https://docs.gradle.org/8.12/release-notes.html
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details
> Task :chasm-runner:jvmRun
Hello from Kotlin via WASI
Current 'realtime' timestamp is: 1736584599455000000
Current 'monotonic' timestamp is: 148771049690166
Day 1
14808
0
Day 2
2
2
Day 3
96225
96225
Day 4
2
0
Day 5
22
30
Day 6
3
0
Day 7
26936
26936
BUILD SUCCESSFUL in 2m 11s
6 actionable tasks: 6 executed
I also tried using the binary you provided with the latest chasm snapshot injecting my own stub functions like this: val imports = imports(store) {
function {
moduleName = "wasi_snapshot_preview1"
entityName = "fd_write"
type {
params {
i32()
i32()
i32()
i32()
}
results {
i32()
}
}
reference { values ->
listOf(NumberValue.I32(0))
}
}
function {
moduleName = "wasi_snapshot_preview1"
entityName = "random_get"
type {
params {
i32()
i32()
}
results {
i32()
}
}
reference { values ->
listOf(NumberValue.I32(0))
}
}
}
invoke(store, instance, "_initialize", emptyList()) And this also returned a Success. What does the exceptionBug branch of the wah demo produce for you? |
This is strange, because in the My local output is the same as here: https://github.com/illarionov/wehdemo/actions/runs/12721599169/job/35464696333#step:5:59 I'll check with with the latest chasm snapshot later too. |
I updated the Chasm to 0.9.4 and this is still reproducible. I also simplified the code a bit to reduce the binary size. Given the following code: import kotlin.wasm.unsafe.UnsafeWasmMemoryApi
import kotlin.wasm.unsafe.withScopedMemoryAllocator
@OptIn(UnsafeWasmMemoryApi::class)
suspend fun main() {
withScopedMemoryAllocator { }
try {
try { error("Test exception") } catch (ise: RuntimeException) { }
test()
} catch (ex: Throwable) {
}
}
suspend fun test() {} Fails with Updates are on the Run on Github Actions: https://github.com/illarionov/wehdemo/actions/runs/12762622996/job/35571430113#step:5:57 Generated binaries: https://github.com/illarionov/wehdemo/actions/runs/12762622996/artifacts/2426529411
|
Given the following Kotlin/WASI code compiled with Kotlin/WASM 2.1.0 and
-Xwasm-use-new-exception-proposal
:The execution of this code with Chasm fails with
ExecutionError(error=MissingStackFrame)
.Reproduction example: https://github.com/illarionov/wehdemo/tree/exceptionBug
Steps to reproduce:
Run on Github Actions: https://github.com/illarionov/wehdemo/actions/runs/12721599169
Just in case, I also attach the generated WASM binary files : wasm-binaries.zip
This error is reproduced on both debug and production optimized files.
The text was updated successfully, but these errors were encountered: