alexcrichton opened PR #14580 from alexcrichton:track-more-borrows to bytecodealliance:main:
Since resources were originally implemented in Wasmtime it's only ever tracked lends of
ownhandles. This was all that was necessary in a fully synchronous world, but with async no in the picture this is no longer sufficient. Notably lends of borrows need to be tracked due to the nature of async functions. The spec has always tracked lends of everything, and it's just Wasmtime's historical optimization that's no longer applicable.This is a behavior change for guests, but guests which now run into a trap were already likely running into odd behavior. Guest tables could get corrupt in the face of async with mismatched lends and such. This could cause spurious traps or crashes within the guest itself, but this never results in host-side crashing behavior.
<!--
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
-->
alexcrichton requested pchickey for a review on PR #14580.
alexcrichton requested wasmtime-core-reviewers for a review on PR #14580.
:thumbs_up: pchickey submitted PR review.
alexcrichton has enabled auto merge for PR #14580.
alexcrichton added PR #14580 Track lends of borrows in the face of async to the merge queue.
github-merge-queue[bot] removed PR #14580 Track lends of borrows in the face of async from the merge queue.
alexcrichton added PR #14580 Track lends of borrows in the face of async to the merge queue.
:check: alexcrichton merged PR #14580.
alexcrichton removed PR #14580 Track lends of borrows in the face of async from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC