alexcrichton opened PR #13650 from alexcrichton:fix-fd-renumber to bytecodealliance:main:
This commit fixes a file descriptor leak in the WASIp1 implementation of
fd_renumberin thewasmtime-wasicrate. Notably the previous implementation did not fully close the file descriptor being renumbered-to which meant that the host's resources for the file, including the file descriptor, stayed alive. The fix here is to validate both fds exist and then delegate to thefd_closecall to close the destination.<!--
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 dicej for a review on PR #13650.
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #13650.
alexcrichton requested wasmtime-core-reviewers for a review on PR #13650.
:thumbs_up: dicej submitted PR review.
alexcrichton added PR #13650 Fix leak in fd_renumber to the merge queue
alexcrichton updated PR #13650.
alexcrichton added PR #13650 Fix leak in fd_renumber to the merge queue
alexcrichton has enabled auto merge for PR #13650.
alexcrichton updated PR #13650.
github-merge-queue[bot] removed PR #13650 Fix leak in fd_renumber from the merge queue
github-merge-queue[bot] removed PR #13650 Fix leak in fd_renumber from the merge queue
alexcrichton added PR #13650 Fix leak in fd_renumber to the merge queue
:check: alexcrichton merged PR #13650.
alexcrichton removed PR #13650 Fix leak in fd_renumber from the merge queue
Last updated: Jul 29 2026 at 05:03 UTC