Stream: git-wasmtime

Topic: wasmtime / PR #15092 component model async: increment err...


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

ToscaLorno opened PR #15092 from ToscaLorno:fix/component-model-async-error-context-refcount to bytecodealliance:main:

Summary

Fixes bytecodealliance/wasmtime#14674.

When an error-context handle is transferred across component instances via an async future or stream, lowering it into the recipient instance inserts a local handle entry pointing to the underlying global error context table. However, lower_error_context_to_index previously omitted incrementing the cross-subcomponent global_ref_count.

As a consequence, when the recipient instance subsequently invoked error-context.drop, the global reference count was decremented to zero prematurely, deleting the global error context tracking while the sending instance still retained its handle.

This patch updates lower_error_context_to_index to increment the global reference count on insertion, mirroring the semantics of error_context_transfer.

Testing

Added regression test tests/misc_testsuite/component-model/async/error-context-future.wast, verifying that dropping the received error-context in a recipient instance does not invalidate or break subsequent drops in the sender.

Ran test suite:

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

ToscaLorno removed the review request for wasmtime-core-reviewers from PR #15092.

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

ToscaLorno requested pchickey for a review on PR #15092.

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

ToscaLorno requested wasmtime-core-reviewers for a review on PR #15092.

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

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

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2026 at 21:24):

alexcrichton commented on PR #15092:

Thanks for the PR, but I'm personally hesitant to try to fixup error-context piecemeal like this. I know LLMs are good at generating code, but the prompt here of "fix the bug" I feel is not complete enough. The error-context type is pretty under-baked right now and likely needs some deeper redesign. The logged issues we have are an attempt to catalogue known issues with it but I wouldn't recommend new contributors try to take them on

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

ToscaLorno commented on PR #15092:

Thanks for the context @alexcrichton! Completely makes sense that error-context needs a deeper architectural overhaul rather than piecemeal localized fixes. Appreciate your time and insight!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2026 at 21:02):

ToscaLorno commented on PR #15092:

Closing this PR per the discussion above to leave space for the broader architectural redesign of error-context. Thanks again @alexcrichton!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2026 at 21:02):

:cross_mark: ToscaLorno closed without merge PR #15092.


Last updated: Oct 31 2026 at 23:03 UTC