Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Mar 28, 2024

To avoid slow-running fuzz cases, we report a host limit when interpreting
atomic.wait with any non-zero timeout. However, in the allowed case where the
timeout is zero, we were incorrectly interpreting the wait as returning 0,
meaning that it was woken up, instead of 2, meaning that the timeout expired.
Fix it to return 2.

To avoid slow-running fuzz cases, we report a host limit when interpreting
atomic.wait with any non-zero timeout. However, in the allowed case where the
timeout is zero, we were incorrectly interpreting the wait as returning 0,
meaning that it was woken up, instead of 2, meaning that the timeout expired.
Fix it to return 2.
@tlively tlively requested a review from kripken March 28, 2024 20:25
@tlively
Copy link
Member Author

tlively commented Mar 28, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tlively and the rest of your teammates on Graphite Graphite

@tlively tlively linked an issue Mar 28, 2024 that may be closed by this pull request
hostLimit("threads support");
}
return Literal(int32_t(0)); // equal
return Literal(int32_t(2)); // Timed out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow - if there is no timeout, how can we timeout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout is zero nanoseconds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, reading the spec more carefully indeed 0 is just a brief timeout in effect...

hostLimit("threads support");
}
return Literal(int32_t(0)); // equal
return Literal(int32_t(2)); // Timed out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, reading the spec more carefully indeed 0 is just a brief timeout in effect...

@tlively tlively merged commit 08a18cd into main Mar 29, 2024
@tlively tlively deleted the atomic-wait-timeout branch March 29, 2024 20:12
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fuzz bug with atomic wait

3 participants