adamrk opened PR #15069 from adamrk:abk/start-fn-poisoned-store to bytecodealliance:main:
There is an existing bug where the start function on will run when trying to instantiate a component in a poisoned
Store. This fixes that by adding a check tomay_enterwithininvoke_wasm_and_catch_trapsso that any Wasm execution will be prevented if the store has been poisoned.Core Wasm modules should be able to still run after trapping (this is required by some wast tests), so we add an additional flag
has_componentswhich will be false as long as no components where initialized in the store. In order to prevent checking two bools on every entry to Wasm, we only check thehas_componentsbool when a trap occurs to decide the trap should cause theStoreto be poisoned.Two calls to
may_enterare removed because they are now redundant. Another calls is kept even though it's techinically redundant because it leaves a better error message.<!--
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 review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
adamrk removed the review request for wasmtime-core-reviewers from PR #15069.
adamrk requested pchickey for a review on PR #15069.
adamrk requested wasmtime-core-reviewers for a review on PR #15069.
github-actions[bot] added the label wasmtime:api on PR #15069.
pchickey removed the review request for pchickey from PR #15069.
pchickey requested alexcrichton for a review on PR #15069.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #15069 component: centralize may_enter check to the merge queue.
:check: alexcrichton merged PR #15069.
alexcrichton removed PR #15069 component: centralize may_enter check from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC