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

Update some fuzzing defaults and infrastructure #1793

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

alexcrichton
Copy link
Member

  • Update wasm_smith::Config to default-enable some stage4+ proposals: exceptions, gc, reference_types, relaxed_simd, simd, tail_call, threads. These can still all be disabled via configuration and CLI flags.
  • All stage4+ proposals are now swarm-enabled through Arbitrary for Config
  • Default generation of modules in wasm-tools's own fuzzing no longer special-cases these proposals since they're all already handled.
  • The WasmFeatures used for validating fuzz-generated modules now starts with a minimal baseline set of features to ensure that all proposals are disabled in the validator if the corresponding wasm-smith configuration flag is disabled.
  • The wasm-mutate crate was updated to return errors instead of panicking for unsupported wasm proposals. All wasm proposals are now enabled when passing to wasm-mutate.

The primary motivation for this commit was this last point where I'm seeing panics on OSS-Fuzz for Wasmtime using wasm-mutate as a mutation hook because wasm-mutate is panicking on some GC types. When fixing that I noticed other fuzz-related things I wanted to clean up while I was here.

* Update `wasm_smith::Config` to default-enable some stage4+ proposals:
  `exceptions`, `gc`, `reference_types`, `relaxed_simd`, `simd`,
  `tail_call`, `threads`. These can still all be disabled via
  configuration and CLI flags.
* All stage4+ proposals are now swarm-enabled through
  `Arbitrary for Config`
* Default generation of modules in wasm-tools's own fuzzing no longer
  special-cases these proposals since they're all already handled.
* The `WasmFeatures` used for validating fuzz-generated modules now
  starts with a minimal baseline set of features to ensure that all
  proposals are disabled in the validator if the corresponding
  wasm-smith configuration flag is disabled.
* The `wasm-mutate` crate was updated to return errors instead of
  panicking for unsupported wasm proposals. All wasm proposals are now
  enabled when passing to `wasm-mutate`.

The primary motivation for this commit was this last point where I'm
seeing panics on OSS-Fuzz for Wasmtime using `wasm-mutate` as a mutation
hook because `wasm-mutate` is panicking on some GC types. When fixing
that I noticed other fuzz-related things I wanted to clean up while I
was here.
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Nice!

@alexcrichton alexcrichton added this pull request to the merge queue Sep 17, 2024
Merged via the queue into bytecodealliance:main with commit ebd4b68 Sep 17, 2024
30 checks passed
@alexcrichton alexcrichton deleted the fuzz-fixes branch September 17, 2024 22:48
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