Stream: git-wasmtime

Topic: wasmtime / PR #1509 Add a spec test fuzzer for Config


view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 20:03):

alexcrichton opened PR #1509 from spectests-fuzzer to master:

This commit adds a new fuzzer which is intended to run on oss-fuzz. This
fuzzer creates and arbitrary Config which should pass spec tests and
then asserts that it does so. The goal here is to weed out any
accidental bugs in global configuration which could cause
non-spec-compliant behavior.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 20:03):

alexcrichton requested fitzgen for a review on PR #1509.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen created PR Review Comment:

Let's move the body of this into a function in wasmtime/crates/fuzzing/src/oracles.rs so that it could (theoretically) be reused with other fuzzer engines, and is consistent with how our other fuzz targets are defined.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen created PR Review Comment:

Taking the mod won't result in a uniform distribution. Instead, this should be part of the Arbitrary impls:

struct SpecFile {
    file: &'static str,
    contents: &'static str,
}

impl Arbitrary for SpecFile {
    fn arbitrary(u: &mut Unstructured) -> arbitrary::Result<Self> {
        // NB: this does get a uniform value in the provided range.
        let i = u.int_in_range(0, FILES.len())?;
        let (file, contents) = FILES[i];
        Ok(SpecFile { file, contents })
    }

    fn size_hint(_depth: usize) -> (usize, Option<usize>) {
        (1, Some(std::mem::size_of::<usize>()))
    }
}

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen created PR Review Comment:

This should be in wasmtime/crates/fuzzing/src/generators.rs with the rest of the test case generators. This allows us to reuse the concept "a spec compliant config" across different oracles, and is consistent with the rest of the infra.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 14 2020 at 21:37):

fitzgen created PR Review Comment:

This should be a log::debug! so that it doesn't print except when we're debugging the test case and actually looking at the output. This should allow the fuzz target to run faster under oss-fuzz.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 15 2020 at 12:52):

alexcrichton updated PR #1509 from spectests-fuzzer to master:

This commit adds a new fuzzer which is intended to run on oss-fuzz. This
fuzzer creates and arbitrary Config which should pass spec tests and
then asserts that it does so. The goal here is to weed out any
accidental bugs in global configuration which could cause
non-spec-compliant behavior.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 15 2020 at 12:53):

alexcrichton updated PR #1509 from spectests-fuzzer to master:

This commit adds a new fuzzer which is intended to run on oss-fuzz. This
fuzzer creates and arbitrary Config which should pass spec tests and
then asserts that it does so. The goal here is to weed out any
accidental bugs in global configuration which could cause
non-spec-compliant behavior.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 15 2020 at 13:29):

alexcrichton merged PR #1509.


Last updated: Dec 23 2024 at 13:07 UTC