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