99# different architectures or even different OS versions, which come with
1010# different library packages, but this is left as a future improvement.
1111
12- export FUZZ_INPUTS_DIR= " fuzz_seed_corpus "
12+ export FUZZ_CORPORA_DIR= " fuzz_corpora "
1313
1414set -e
1515
@@ -33,7 +33,7 @@ make -C AFLplusplus LLVM_CONFIG=llvm-config-$LLVM_VERSION PERFORMANCE=1 install
3333git clone --depth=1 https://github.com/bitcoin-core/qa-assets.git
3434(
3535 cd qa-assets
36- mv ./" ${FUZZ_INPUTS_DIR } " ../all_inputs
36+ mv ./" ${FUZZ_CORPORA_DIR } " ../all_inputs
3737 git config user.name " delete_nonreduced_inputs script"
3838 git config user.email
" [email protected] " 3939 git commit -a -m " Delete fuzz inputs"
@@ -56,17 +56,17 @@ git clone --depth=1 https://github.com/bitcoin/bitcoin.git
5656 readarray FUZZ_TARGETS < " /tmp/a"
5757 for fuzz_target in ${FUZZ_TARGETS[@]} ; do
5858 if [ -d " ../all_inputs/$fuzz_target " ]; then
59- mkdir --parents ../qa-assets/" ${FUZZ_INPUTS_DIR } " /$fuzz_target
59+ mkdir --parents ../qa-assets/" ${FUZZ_CORPORA_DIR } " /$fuzz_target
6060 # Allow timeouts and crashes with "-A", "-T all" to use all available cores
61- FUZZ=$fuzz_target afl-cmin -T all -A -i ../all_inputs/$fuzz_target -o ../qa-assets/" ${FUZZ_INPUTS_DIR } " /$fuzz_target -- ./build_fuzz/src/test/fuzz/fuzz
61+ FUZZ=$fuzz_target afl-cmin -T all -A -i ../all_inputs/$fuzz_target -o ../qa-assets/" ${FUZZ_CORPORA_DIR } " /$fuzz_target -- ./build_fuzz/src/test/fuzz/fuzz
6262 else
6363 echo " No input corpus for $fuzz_target (ignoring)"
6464 fi
6565 done
6666
6767 (
6868 cd ../qa-assets
69- git add " ${FUZZ_INPUTS_DIR } "
69+ git add " ${FUZZ_CORPORA_DIR } "
7070 git commit -m " Reduced inputs for afl-cmin"
7171 )
7272
@@ -79,11 +79,11 @@ git clone --depth=1 https://github.com/bitcoin/bitcoin.git
7979 -DBUILD_FOR_FUZZING=ON -DSANITIZERS=" $sanitizer "
8080 cmake --build build_fuzz -j$( nproc)
8181
82- ( cd build_fuzz; ./test/fuzz/test_runner.py -l DEBUG --par=$( nproc) --m_dir=../../all_inputs ../../qa-assets/" ${FUZZ_INPUTS_DIR } " )
82+ ( cd build_fuzz; ./test/fuzz/test_runner.py -l DEBUG --par=$( nproc) --m_dir=../../all_inputs ../../qa-assets/" ${FUZZ_CORPORA_DIR } " )
8383
8484 (
8585 cd ../qa-assets
86- git add " ${FUZZ_INPUTS_DIR } "
86+ git add " ${FUZZ_CORPORA_DIR } "
8787 git commit -m " Reduced inputs for ${sanitizer} "
8888 )
8989 done
0 commit comments