You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From Dan Kegel in the Tinygo slack: "Hey Aaron, I think gc on wasm is conservative-ish by default since tinygo-org/tinygo#1853, maybe remove mention of -gc=conservative? I dunno, I just work here 🙂 but I hear -scheduler=none and/or -gc=leaking are the flags to try when odd crashes happen..."
The text was updated successfully, but these errors were encountered:
You also don't need -wasm-abi=generic: this is the default for WASI.
# Note, some features aren't fully supported by WASI. So if you hit nil pointer references
# You may want to play around with the scheduler and gc flags. For example:
# "-scheduler=none -gc=conservative" or "-scheduler=coroutines -gc=leaking"
Some other notes:
It's not really WASI that causes these bugs, it's TinyGo. WebAssembly currently doesn't support direct access to the stack which is why TinyGo has to do things differently on WebAssembly compared to other architectures.
The default for WebAssembly is indeed -gc=conservative -scheduler=coroutines. You can inspect these values like this:
$ tinygo info wasi
LLVM triple: wasm32--wasi
GOOS: linux
GOARCH: arm
build tags: tinygo.wasm wasi tinygo math_big_pure_go gc.conservative scheduler.coroutines serial.none
garbage collector: conservative
scheduler: coroutines
cached GOROOT: /home/ayke/.cache/tinygo/goroot-go1.16.2-c80939e3ef7edbc184c2946545bb39c528b92e6385a60d8c810f1438cfb5211f-syscall
To rule out bugs in the GC or scheduler passes, you can try -gc=leaking or -scheduler=none, or both.
From Dan Kegel in the Tinygo slack: "Hey Aaron, I think gc on wasm is conservative-ish by default since tinygo-org/tinygo#1853, maybe remove mention of -gc=conservative? I dunno, I just work here 🙂 but I hear -scheduler=none and/or -gc=leaking are the flags to try when odd crashes happen..."
The text was updated successfully, but these errors were encountered: