dicej opened PR #12282 from dicej:better-may-block-tracking to bytecodealliance:main:
Previously, we weren't updating or checking the may-block status of a task across sync-to-sync, guest-to-guest calls, meaning we were allowing blocking in cases we shouldn't have.
This fixes that by adding a new
task_may_blockfield toVMComponentContext, plus code to update it every time we switch threads or do a sync-to-sync, guest-to-guest call. We use that field as the source of truth about whether a blocking operation is permitted.I've updated various tests to match, and Luke has an item on his to-do list to add sad-path coverage for various cases to the upstream
component-modeltest suite.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej has marked PR #12282 as ready for review.
dicej requested alexcrichton for a review on PR #12282.
dicej requested wasmtime-compiler-reviewers for a review on PR #12282.
dicej requested wasmtime-core-reviewers for a review on PR #12282.
dicej updated PR #12282.
alexcrichton submitted PR review:
Test-wise, to confirm, you feel that the upstream spec tests adequately cover this? And/or the test updates that were required here? Or should some dedicated tests be written as well?
alexcrichton created PR review comment:
While technically this should work, I think this'll want to be
ret.ptr.size_of_vmglobal_definition()because we view this allocation region as a global, right?
alexcrichton created PR review comment:
Can you update the comment at the top of the file to match this pseudo-struct?
alexcrichton created PR review comment:
The old
InstanceFlagsstructure is pretty unsafe due to retaining a long-lived pointer disconnected from theComponentInstance, so ideally we wouldn't model this after that if we don't need to. Would it be possible to have safe get/set/as_raw methods onComponentInstanceand avoid having this type entirely?
dicej updated PR #12282.
dicej updated PR #12282.
dicej updated PR #12282.
dicej updated PR #12282.
dicej updated PR #12282.
dicej merged PR #12282.
Last updated: Jan 09 2026 at 13:15 UTC