From c458eb9df56646d8abc607906cc4dc20a70f8cab Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Fri, 7 Jun 2024 18:00:56 +0000 Subject: [PATCH] Tweak fuzz-until-converged: try 5 iterations before quitting, and set iteration to 5 minutes --- fuzz-until-converged.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fuzz-until-converged.sh b/fuzz-until-converged.sh index c16e0861..4d562382 100755 --- a/fuzz-until-converged.sh +++ b/fuzz-until-converged.sh @@ -1,13 +1,17 @@ #!/bin/bash rm -r "fuzz/corpus/fuzz_$1_old" -updated=1 -while [[ $updated ]]; do - updated=0 +MAX_ITERS_WITHOUT_IMPROVEMENT=5 +iters_without_improvement=0 +while [[ $iters_without_improvement -lt $MAX_ITERS_WITHOUT_IMPROVEMENT ]]; do cp -r "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old" cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ -dict=fuzz/fuzz.dict -max_len="$2" -rss_limit_mb=8192 \ - -fork="$(nproc || getconf NPROCESSORS_ONLN)" -runs=1000000 + -fork="$(nproc || getconf NPROCESSORS_ONLN)" -max_total_time=300 ./recursive-fuzz-cmin.sh "$1" "$2" - updated=$(diff "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old") + if diff "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old"; then + iters_without_improvement=$(( iters_without_improvement + 1 )) + else + iters_without_improvement=0 + fi rm -r "fuzz/corpus/fuzz_$1_old" done