Alexey Zolotarev
12/04/2024, 2:15 PMGC heap out of memory
errors. I'm trying WasmEdge and in standalone mode it seems to work but when embedded in Rust any non-trivial Wasm function call ends up with an error. E.g. calling this function
fun main() {
println("test")
}
or this:
fun main() {
val x = "test"
check(x[0] != 'x')
}
results in this:
[2024-12-04 14:44:27.909] [error] execution failed: null structure reference, Code: 0x414
[2024-12-04 14:44:27.910] [error] In instruction: struct.get (0xc9) , Bytecode offset: 0x00001ede
Error: Core(Execution(AccessNullStruct)
Maybe someone encountered this?
Same embedded instance seem to be fine executing wasm binaries generated by Rust or AssemblyScript.Artem Kobzar
12/04/2024, 2:21 PMAlexey Zolotarev
12/04/2024, 2:25 PMprerelease
version before too and it had the same issues.
It can init a Kotlin-generated module but then it fails with this https://github.com/bytecodealliance/wasmtime/issues/9701 or this https://github.com/bytecodealliance/wasmtime/issues/9714#issuecomment-2517004021Alexey Zolotarev
12/04/2024, 2:28 PMwasmedge --enable-function-reference --enable-gc --enable-exception-handling
but the embedded version which should be using the same shared lib fails with an error I mentioned above. Not clear how to debug it either - no stacktrace, nothing 🤕Artem Kobzar
12/04/2024, 2:48 PMbashor
12/04/2024, 7:23 PMbashor
12/04/2024, 7:23 PMAlexey Zolotarev
12/05/2024, 6:33 AMCharlie Tapping
12/05/2024, 11:12 AMAlexey Zolotarev
12/05/2024, 11:26 AMCharlie Tapping
12/05/2024, 11:30 AMAlexey Illarionov
01/10/2025, 9:11 AMwasm-code
module compiles Kotlin/Wasm code that uses WASI Preview 1 functions
* The chasm-runner
module runs the compiled WASM binary in Chasm on JVM, macOS, Linux, and Windows targets.
For test code, I used the MonotonicTime example from the kotlin-wasm-wasi-template, and also some solutions for Advent Of Code 2024 puzzles by @ephemient (which are compiled for the wasmWASI target and include file reading).
At the moment, it’s difficult to find practical use for this. It’s mainly intended to demonstrate that, in the future, WASM/WASI code can be embedded into any other native code. Unfortunately, the performance of an Chasm interpreter is still not enough to be used in real projects for now.
In any case, feel free to try it out and share your feedback.Michael Paus
01/10/2025, 10:27 AMAlexey Illarionov
01/10/2025, 10:54 AM