Stream: git-wasmtime

Topic: wasmtime / PR #9304 Print an error on async stack overflow


view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:18):

alexcrichton opened PR #9304 from alexcrichton:print-async-stack-overflow to bytecodealliance:main:

This commit updates Wasmtime's handling of traps on Unix platforms to print an error message on stack overflow when the guard page is hit. This is distinct from stack overflow in WebAssembly which raises a normal trap and can be caught. This is instead to be used on misconfigured hosts where the async stack is too small or wasm was allowed to take up too much of the async stack. Currently no error message is printed and the program simply aborts with a core dump which can be difficult to debug.

This instead registers the range of the async guard page with the trap handling infrastructure to test the faulting address and if it lies within this range. If so then a small message is printed and then the program is aborted with libc::abort().

This does not impact the safety of any prior embedding or fix any issues. It's instead intended purely as a diagnostic tool to help users more quickly understand that stack size configuration settings are the likely culprit.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:18):

alexcrichton requested elliottt for a review on PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:18):

alexcrichton requested wasmtime-core-reviewers for a review on PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:19):

alexcrichton commented on PR #9304:

This is inspired by https://github.com/bytecodealliance/wasmtime/issues/9298 where stack overflows on the CLI in async fibers might be more common now.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:33):

alexcrichton updated PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:57):

alexcrichton updated PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 21:22):

alexcrichton updated PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2024 at 00:44):

alexcrichton updated PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2024 at 14:38):

alexcrichton updated PR #9304.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2024 at 20:19):

elliottt submitted PR review:

This all seems reasonable to me!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 26 2024 at 04:27):

alexcrichton merged PR #9304.


Last updated: Dec 23 2024 at 12:05 UTC