Stream: git-wasmtime

Topic: wasmtime / PR #13949 Configure async task context on `rea...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 22:57):

alexcrichton opened PR #13949 from alexcrichton:reset-realloc-context to bytecodealliance:main:

This commit is an implementation of WebAssembly/component-model#680 which is a semantic change for invocations of the realloc canonical ABI option. Previously when this function was invoked the configured context-storage was whatever happened to run last in the store and in general wasn't well-defined. Additionally the context of the thread being run in was whatever happened to run last. The goal of the upstream spec change, and this commit, is to fully define what happens in this situation. Specifically:

These changes combined mean that it's not actually possible for realloc to witness anything about its thread identity. This means that we don't actually have to allocate anything, all that's necessary is to save/restore context around invocation of cabi_realloc.

While this is a breaking change it's not expected to be observable in the ecosystem. This only affects context slots which are primarily only used for the WASIp3 ABI as the stack pointer and TLS base. There is no shipping WASIp3 target anywhere right now, so this breakage should not be observable.

<!--
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 (Jul 23 2026 at 22:57):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 22:57):

alexcrichton requested cfallin for a review on PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 22:57):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:06):

:thumbs_up: cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:06):

:speech_balloon: cfallin created PR review comment:

Do we need a drop-guard to restore the context if an error is returned (e.g. the bail! above), or are those always trap-cases I guess?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:08):

alexcrichton updated PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:09):

alexcrichton updated PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:10):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:10):

:speech_balloon: alexcrichton created PR review comment:

We should be good in this case because once a component traps everything internally is inaccessible and no longer able to be seen by a guest. There's a fair number of locations in concurrent.rs that do this as well (don't restore on trap/panic) as well. I've added a comment now to that effect though for future readers

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:10):

alexcrichton has enabled auto merge for PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:19):

alexcrichton added PR #13949 Configure async task context on realloc calls to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:44):

github-merge-queue[bot] removed PR #13949 Configure async task context on realloc calls from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:46):

alexcrichton commented on PR #13949:

Heh well @dicej maybe your Windows-specific failure wasn't Windows-specific after all (failing test on macOS)

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2026 at 23:46):

alexcrichton added PR #13949 Configure async task context on realloc calls to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2026 at 00:11):

:check: alexcrichton merged PR #13949.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2026 at 00:11):

alexcrichton removed PR #13949 Configure async task context on realloc calls from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC