bytecodealliance / wasm-tools

CLI and Rust libraries for low-level manipulation of WebAssembly modules
Apache License 2.0
1.35k stars 245 forks source link

fuzz: crash with WIT multi-returns #1757

Closed abrown closed 2 months ago

abrown commented 2 months ago

While working on #1756, the following command found a fuzz bug:

$ cargo +nightly fuzz run run

I am able to reproduce on main with:

$ cargo +nightly fuzz run run fuzz/artifacts/run/crash-fe711ff55b91f020003ba1205eb829d1b70fe0a0

The failure is unrelated to threads entirely, something to do with WIT multi-returns:

Running: fuzz/artifacts/run/crash-fe711ff55b91f020003ba1205eb829d1b70fe0a0
thread '<unnamed>' panicked at fuzz/src/wit64.rs:14:47:
called `Result::unwrap()` on an `Err` value: multiple returns on a function is now a gated feature -- https://github.com/WebAssembly/component-model/pull/368 (at offset 0x1fc)

It's surprising this hasn't been found previously since #1670 was introduced two months ago.

crash-fe711ff55b91f020003ba1205eb829d1b70fe0a0.txt