Use fewer threads for fuzz-until-converged when Hyper-Threading is enabled

This commit is contained in:
Chris Hennick 2024-06-07 22:55:25 +00:00
parent a53d8e3fbd
commit efb438cd37

View file

@ -1,12 +1,13 @@
#!/bin/bash #!/bin/bash
rm -r "fuzz/corpus/fuzz_$1_old" rm -r "fuzz/corpus/fuzz_$1_old"
ncpus=$(nproc || getconf NPROCESSORS_ONLN)
ncpus=$(( ncpus / ( 1 + $(cat /sys/devices/system/cpu/smt/active))))
MAX_ITERS_WITHOUT_IMPROVEMENT=3 MAX_ITERS_WITHOUT_IMPROVEMENT=3
iters_without_improvement=0 iters_without_improvement=0
while [[ $iters_without_improvement -lt $MAX_ITERS_WITHOUT_IMPROVEMENT ]]; do while [[ $iters_without_improvement -lt $MAX_ITERS_WITHOUT_IMPROVEMENT ]]; do
cp -r "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old" cp -r "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old"
cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \ cargo fuzz run --all-features "fuzz_$1" "fuzz/corpus/fuzz_$1" -- \
-dict=fuzz/fuzz.dict -max_len="$2" -rss_limit_mb=8192 \ -dict=fuzz/fuzz.dict -max_len="$2" -fork="$ncpus" \
-fork="$(nproc || getconf NPROCESSORS_ONLN)" -runs=15000000 \
-max_total_time=900 -max_total_time=900
./recursive-fuzz-cmin.sh "$1" "$2" ./recursive-fuzz-cmin.sh "$1" "$2"
if diff "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old"; then if diff "fuzz/corpus/fuzz_$1" "fuzz/corpus/fuzz_$1_old"; then