diff --git a/build-fuzz-corpus-multiple-restarts.sh b/build-fuzz-corpus-multiple-restarts.sh index f2aac884..8d584d60 100755 --- a/build-fuzz-corpus-multiple-restarts.sh +++ b/build-fuzz-corpus-multiple-restarts.sh @@ -8,35 +8,35 @@ mkdir "fuzz/corpus/fuzz_$1_pre_fresh_blood" find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_pre_fresh_blood" ';' || true for i in $(seq 1 $NORMAL_RESTARTS); do find "fuzz/corpus/fuzz_$1_restart_${i}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_pre_fresh_blood" ';' || true + rm -rf "fuzz/corpus/fuzz_$1_restart_${i}" || true echo "$(date): RESTART ${i}" mkdir "fuzz/corpus/fuzz_$1" || true cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ -dict=fuzz/fuzz.dict -max_len="$2" -fork="$ncpus" \ -max_total_time=5100 -runs=100000000 - mkdir "fuzz/corpus/fuzz_$1_restart_${i}" || true - find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_restart_${i}" ';' + mv "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_restart_${i}" + mkdir "fuzz/corpus/fuzz_$1" done find "fuzz/corpus/fuzz_$1_restart_dictionaryless" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_pre_fresh_blood" ';' || true rm -rf "fuzz/corpus/fuzz_$1_restart_dictionaryless" || true -mkdir "fuzz/corpus/fuzz_$1_restart_dictionaryless" || true echo "$(date): DICTIONARY-LESS RESTART" cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ -max_len="$2" -fork="$ncpus" -max_total_time=5100 -runs=100000000 -find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_restart_dictionaryless" ';' +mv "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_restart_dictionaryless" +mkdir "fuzz/corpus/fuzz_$1" find "fuzz/corpus/fuzz_$1_restart_dictionaryless_012byte" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_pre_fresh_blood" ';' || true rm -rf "fuzz/corpus/fuzz_$1_restart_dictionaryless_012byte" || true -mkdir "fuzz/corpus/fuzz_$1_restart_dictionaryless_012byte" || true echo "$(date): DICTIONARY-LESS RESTART WITH 0-2 BYTE CORPUS" tar -xvzf "fuzz/012byte.tar.gz" -C "fuzz/corpus/fuzz_$1" cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ -max_len="$2" -fork="$ncpus" -max_total_time=5100 -runs=100000000 -find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_restart_dictionaryless_012byte" ';' +mv "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_restart_dictionaryless_012byte" +mkdir "fuzz/corpus/fuzz_$1" find "fuzz/corpus/fuzz_$1_restart_012byte" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_pre_fresh_blood" ';' || true rm -rf "fuzz/corpus/fuzz_$1_restart_012byte" || true -mkdir "fuzz/corpus/fuzz_$1_restart_012byte" || true echo "$(date): RESTART WITH DICTIONARY AND 0-2 BYTE CORPUS" tar -xvzf "fuzz/012byte.tar.gz" -C "fuzz/corpus/fuzz_$1" cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ diff --git a/recursive-fuzz-cmin.sh b/recursive-fuzz-cmin.sh index b95ef387..466e0d7e 100755 --- a/recursive-fuzz-cmin.sh +++ b/recursive-fuzz-cmin.sh @@ -2,8 +2,8 @@ set -euxo pipefail i=0 rm -rf "fuzz/corpus/fuzz_$1_iter_0" || true -mkdir "fuzz/corpus/fuzz_$1_iter_0" -find "fuzz/corpus/fuzz_$1" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1_iter_0" ';' +mv "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_iter_0" +mkdir "fuzz/corpus/fuzz_$1" while true; do j=$((i + 1)) rm -rf "fuzz/corpus/fuzz_$1_iter_${i}.bak" || true @@ -15,8 +15,7 @@ while true; do if diff "fuzz/corpus/fuzz_$1_iter_${i}.bak" "fuzz/corpus/fuzz_$1_iter_${j}"; then # Last iteration made no difference, so we're done rm -rf "fuzz/corpus/fuzz_$1" - mkdir "fuzz/corpus/fuzz_$1" - find "fuzz/corpus/fuzz_$1_iter_${j}" -type f -exec mv '{}' "fuzz/corpus/fuzz_$1" ';' + mv "fuzz/corpus/fuzz_$1_iter_${j}" "fuzz/corpus/fuzz_$1" rm -rf "fuzz/corpus/fuzz_$1_iter_${i}.bak" exit 0 fi