Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a timeout in fuzzing #9475

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

alexcrichton
Copy link
Member

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 that memory.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.

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 that `memory.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.
@alexcrichton alexcrichton requested a review from a team as a code owner October 16, 2024 06:35
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team October 16, 2024 06:35
@alexcrichton alexcrichton changed the title Fix an timeout in fuzzing Fix a timeout in fuzzing Oct 16, 2024
@github-actions github-actions bot added the fuzzing Issues related to our fuzzing infrastructure label Oct 16, 2024
Copy link

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "fuzzing"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@fitzgen fitzgen added this pull request to the merge queue Oct 16, 2024
Merged via the queue into bytecodealliance:main with commit 8d32008 Oct 16, 2024
39 checks passed
@alexcrichton alexcrichton deleted the fix-timeout branch October 16, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzzing Issues related to our fuzzing infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants