Skip to content

Audit fuzzing of wasm GC and support that wasm-smith might generate #10596

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

Open
2 tasks
alexcrichton opened this issue Apr 16, 2025 · 1 comment
Open
2 tasks
Labels
fuzzing Issues related to our fuzzing infrastructure wasm-proposal:gc Issues with the implementation of the gc wasm proposal

Comments

@alexcrichton
Copy link
Member

I wanted to file a tracking issue for support of fuzzing wasm-gc with wasm-smith. Currently this is enabled on OSS-Fuzz but I believe that wasm-smith is still lacking some somewhat major features for fuzzing the GC proposal. The purpose of this issue is to track various items we know we need to fuzz but haven't implemented yet.

  • One thing I've just noticed when reading over wasm-smith is the support for constant expressions. Currently only a pretty small set of opcodes are generated and this additionally doesn't include opcodes such as any.convert_extern or extern.convert_any (a recent addition to the spec to clarify these are intended happened recently)
  • I don't believe that wasm-smith has much support for non-nullable types given that they don't have a great default, but that also means that non-nullable types I don't think are fuzzed too much with wasm-smith.
@alexcrichton alexcrichton added fuzzing Issues related to our fuzzing infrastructure wasm-proposal:gc Issues with the implementation of the gc wasm proposal labels Apr 16, 2025
@fitzgen
Copy link
Member

fitzgen commented Apr 18, 2025

Currently only a pretty small set of opcodes are generated and this additionally doesn't include opcodes such as any.convert_extern or extern.convert_any (a recent addition to the spec to clarify these are intended happened recently)

This should be pretty easy to address.

I don't believe that wasm-smith has much support for non-nullable types given that they don't have a great default, but that also means that non-nullable types I don't think are fuzzed too much with wasm-smith.

This is correct, but is a bit trickier to fix. We could potentially keep track of, for each type, whether a type is part of a non-nullable cycle or not, and avoid generating globals and what not of that type. And also add a code path to recursively create instances of a particular type in a top-down style. This is a bit of a heavy hammer, but I can't think of a better alternative off the top of my head.

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 wasm-proposal:gc Issues with the implementation of the gc wasm proposal
Projects
None yet
Development

No branches or pull requests

2 participants