Stream: git-wasmtime

Topic: wasmtime / PR #12888 Handle more failures deallocating po...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 08:20):

alexcrichton opened PR #12888 from alexcrichton:handle-pooled-deallocation-failure to bytecodealliance:main:

This commit replaces a few panics in the pooling allocator with error-handling of what happens at runtime. This is a defense-in-depth measure to ensure that the pooling allocator doesn't panic at runtime and instead handles errors where possible.

The first path fixed is in deallocate_memory where resetting a slot could result in an error being returned on non-Linux platforms, and if this happened it would cause a panic. The error is instead gracefully handled by continuing slot deallocation but avoiding putting the image itself back into memory. This leaves the slot in an Unknown state which is already handled by resetting the state upon reuse. The main consequence here is that future statistics about resident bytes won't be accurate, but these are already inaccurate on non-Linux platforms anyway, so there's no loss.

The second path fixes is in flushing a DecommitQueue where decommit_pages was asserted to succeed. Instead now the error is handled by dropping all images and leaving slots in an Unknown state, similar to deallocate_memory.

<!--
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 (Mar 30 2026 at 08:20):

alexcrichton requested cfallin for a review on PR #12888.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 08:20):

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

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 11:03):

github-actions[bot] added the label wasmtime:api on PR #12888.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 14:23):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 14:23):

cfallin created PR review comment:

Could we return a Result<()> here and propagate the error? I know we won't use it in upper layers but it's still a bit more idiomatic IMHO. (Of course we can't use ? inside because we still want to at least attempt all deallocations)

Or if we really want the efficiency then core::result::Result<(), ()> -- basically I don't want the ambiguity of true == success or true == failure...

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 15:08):

alexcrichton updated PR #12888.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 15:09):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 15:09):

alexcrichton created PR review comment:

Good point yeah -- I changed this to io::Result<()> to avoid boxing up a wasmtime::Result and it was pretty easy to handle, and looks better too!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 15:09):

alexcrichton has enabled auto merge for PR #12888.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 15:20):

alexcrichton added PR #12888 Handle more failures deallocating pooled memroy to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 17:59):

github-merge-queue[bot] removed PR #12888 Handle more failures deallocating pooled memroy from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 18:16):

alexcrichton added PR #12888 Handle more failures deallocating pooled memroy to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 20:47):

github-merge-queue[bot] removed PR #12888 Handle more failures deallocating pooled memroy from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 23:50):

alexcrichton added PR #12888 Handle more failures deallocating pooled memroy to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 31 2026 at 00:26):

alexcrichton merged PR #12888.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 31 2026 at 00:26):

alexcrichton removed PR #12888 Handle more failures deallocating pooled memroy from the merge queue.


Last updated: Apr 12 2026 at 23:10 UTC