Howdy! Is there a way to ask for more wasm stack space?
Error: failed to run main module `build-release/wasi/bin/zig.wasm`
Caused by:
0: failed to invoke command default
1: wasm trap: call stack exhausted
wasm backtrace:
...
@Andrew Kelley there is the Config::max_wasm_stack
configuration setting that controls how much stack space is allowed (from the very first transition from host to wasm); note that synchronous guests run on the same stack as the host does, so you'll need to ensure that 1) there's enough stack space for OS thread the host/guest are running on too and 2) your host stack usage doesn't contribute to also exceeding the limit
that looks like something the library API has access to yeah? or is there a way to pass that as a flag to the CLI?
The --max-wasm-stack
option should set that config setting
Note that Wasmtime will not adjust the OS thread stack space, so that value should not exceed it (or realistically come close to doing so since the CLI will also consume some of it)
Thanks!
for what it's worth, wasmtime run --help
is missing this setting
Note thought that --max-wasm-stack
was added quite recently as a CLI option, so if it's not in --help
you probably need to update the wasmtime
executable
I think 3.0.0, the most recent release, is the only one with the flag
aha that makes perfect sense. thanks again :thumbs_up:
Last updated: Dec 23 2024 at 12:05 UTC