Skip to content

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

Merged
kripken merged 1 commit intoWebAssembly:mainfrom
kripken:fuzz.throw.inf
Feb 14, 2025
Merged

[EH] Fuzzer: Fix infinite loop with nested exnrefs#7294
kripken merged 1 commit intoWebAssembly:mainfrom
kripken:fuzz.throw.inf

Conversation

@kripken
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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