alexcrichton opened PR #9475 from alexcrichton:fix-timeout
to bytecodealliance:main
:
This commit fixes a timeout that was found by OSS-Fuzz recently where a module was calling
memory.grow
many times, presumably in a loop, with a modest amount each time. This meant thatmemory.grow
was taking, in total, a quadratic amount of time because Wasmtime was configured with dynamic memories and no memory was reserved for growth. That in turn meant that the test case eventually timed out due to this quadratic behavior.To fix this in addition to the memory allocation cap that we already track a new cap for the number of times memories/tables can be grown was also added. Any growth beyond this limit is rejected and helps prevent this quadratic 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 ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #9475.
alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #9475.
Last updated: Nov 22 2024 at 17:03 UTC