alexcrichton opened PR #13634 from alexcrichton:fix-gc-slot-leak to bytecodealliance:main:
This commit fixes a bugs
Store::allocate_gc_storewhere a linear memory slot could be allocate but a failure allocating a GC heap slot would cause the linear memory to get leaked (not properly deallocated within the pooling allocator). The fix here is to juggle ownership slightly differently, notably deferring theattachoperation to only after the GC heap is successfully allocated. This enables gracefully handling the error of allocating a GC heap and deallocating the memory.<!--
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
-->
alexcrichton requested pchickey for a review on PR #13634.
alexcrichton requested wasmtime-core-reviewers for a review on PR #13634.
github-actions[bot] added the label wasmtime:api on PR #13634.
:thumbs_up: pchickey submitted PR review.
alexcrichton added PR #13634 Fix leaking GC heap slots on errors to the merge queue.
:check: alexcrichton merged PR #13634.
alexcrichton removed PR #13634 Fix leaking GC heap slots on errors from the merge queue.
Last updated: Jul 29 2026 at 05:03 UTC