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

[EH] Fuzzer: Fix infinite loop with nested exnrefs #7294

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

kripken
Copy link
Member

@kripken kripken commented Feb 13, 2025

When we need an exnref value we may create a try-catch with a throw (so
when we catch it, we get an exnref). But if the exception tag contains an
exnref, then we will try to create another exnref in the throw, leading to
recursion (possibly infinite). To avoid this, just create a trivial tag with no
values when we just want a trivial value.

@kripken kripken requested a review from aheejin February 13, 2025 19:12
Copy link
Member

@aheejin aheejin left a comment

Choose a reason for hiding this comment

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

LGTM. By the way I think we had a restriction that that when GC is not enabled, a tag type cannot contain exnref because it can for cycles (and when there's no GC we have to rely on refcounting)... But I don't think we ended up actually writing that in the spec because we don't have "EH spec without GC" version. Not sure whether that's worth implementing in the fuzzing purpose though.

@kripken
Copy link
Member Author

kripken commented Feb 14, 2025

Oh, interesting about cycles. I guess disallowing exnref in tags in the fuzzer could have also avoided this, at least for non-GC... but the PR should handle the GC case too, so that's probably enough.

@kripken kripken merged commit 2bee4bb into WebAssembly:main Feb 14, 2025
14 checks passed
@kripken kripken deleted the fuzz.throw.inf branch February 14, 2025 01:20
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.

2 participants