Reduce wasm invocations in the stacks fuzzer (#4595)

On oss-fuzz a test case has been found that executes 30k iterations of a
wasm trap which with a 60s timeout leaves 2ms for each invocation which
under fuzzing instrumentation is a bit of a stretch with a ~20x
slowdown. This commit places a limit on the number of inputs to the
fuzzer at 200 to keep it reasonably sized.
This commit is contained in:
Alex Crichton
2022-08-03 11:08:36 -05:00
committed by GitHub
parent 55215bbd1e
commit f587b10eb9

View File

@@ -35,7 +35,7 @@ enum Op {
impl<'a> Arbitrary<'a> for Stacks {
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
let funcs = Self::arbitrary_funcs(u)?;
let n = u.len();
let n = u.len().min(200);
let inputs = u.bytes(n)?.to_vec();
Ok(Stacks { funcs, inputs })
}