Skip to content

Commit

Permalink
oss-fuzz: allow switching between "dev" and "release" mode easily
Browse files Browse the repository at this point in the history
Mostly to be able to experiment with the fuzz target by injecting
trivial bugs catchable by ASan to make sure that they aren't
compiled out.

It should help to track down weird issues like
google/oss-fuzz#5865 (comment)
  • Loading branch information
evverx authored and mayhem-bot committed Jul 27, 2022
1 parent cf487cd commit a75f891
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fuzz/oss-fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

set -eux

cargo fuzz build -O --verbose
cp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_from_to_string $OUT/fuzz_from_to_string
build_type=${1:-"release"}
build_args="--release"
if [[ "$build_type" =~ "dev" ]]; then
build_type="debug"
build_args="--dev"
fi

cargo fuzz build $build_args --verbose
cp "fuzz/target/x86_64-unknown-linux-gnu/$build_type/fuzz_from_to_string" $OUT/fuzz_from_to_string
wget https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/toml.dict -O $OUT/fuzz_from_to_string.dict
zip -r $OUT/fuzz_from_to_string_seed_corpus.zip test-suite/tests

0 comments on commit a75f891

Please sign in to comment.