alexcrichton opened PR #13566 from alexcrichton:swap-order to bytecodealliance:main:
For the WASIp1 implementation of
poll_oneoffwitha "realtime" clock specified in an absolute value the implementation had a typo where the order of subtraction was reversed by accident. This can lead to a subtraction overflow in debug mode and a sleep-too-long in release mode. This requires an extremely long sleep to trigger, however, so it's either really long sleep A or really long sleep B. Regardless seems good to fix, but not easy to test.<!--
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 #13566.
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #13566.
github-actions[bot] added the label wasi on PR #13566.
:thumbs_up: dicej submitted PR review.
alexcrichton added PR #13566 Fix subtraction order in poll_oneoff to the merge queue
:check: alexcrichton merged PR #13566.
alexcrichton removed PR #13566 Fix subtraction order in poll_oneoff from the merge queue
Last updated: Jul 29 2026 at 05:03 UTC