You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2026/10/25 18:57:11 UTC

(poi) 05/08: Fuzzing: Add script to run all fuzzers for some time

This is an automated email from the ASF dual-hosted git repository.

centic9 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git

commit 8bdecdac889e261936eca890b77d4f85a04a45b2
Author: Dominik Stadler <ce...@apache.org>
AuthorDate: Sun Oct 25 10:40:15 2026 +0100

    Fuzzing: Add script to run all fuzzers for some time
    
    This allows to run fuzzing on all targets locally
    to verify for newly introduced crashes even before
    committing changes
---
 poi-fuzz/fuzzAll.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/poi-fuzz/fuzzAll.sh b/poi-fuzz/fuzzAll.sh
new file mode 100755
index 0000000000..d0cbec10b5
--- /dev/null
+++ b/poi-fuzz/fuzzAll.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+set -eu
+
+../gradlew shadowJar
+
+for i in src/main/java/org/apache/poi/fuzz/*Fuzzer.java;do
+  CLASS=`basename $i | sed -e 's/.java//g'`
+  CORPUS=corpus`echo ${CLASS} | sed -e 's/Fuzzer//g' | sed -e 's/POI//g'`
+
+  # no separate corpus for this one
+  if [ "${CLASS}" == "XLSX2CSVFuzzer" ]; then
+    CORPUS=corpusXSSF
+  elif [ "${CLASS}" == "POIFileHandlerFuzzer" ]; then
+    CORPUS=corpus
+  fi
+
+  echo Running ${CLASS} with corpus ${CORPUS}
+
+  mkdir -p ${CORPUS}
+
+  case "${CLASS}" in
+    POIFuzzer)
+      cp -a ../test-data corpus
+      ;;
+    POIHDGFFuzzer)
+      cp corpus/diagram/*.vsd corpusHDGF/
+      ;;
+    POIHMEFFuzzer)
+      cp -a corpus/hmef/* corpusHMEF/
+      ;;
+    POIHPBFFuzzer)
+      cp -a corpus/publisher/* corpusHPBF/
+      ;;
+    POIHPSFFuzzer)
+      cp corpus/hpsf/* corpusHPSF/
+      ;;
+    POIHSLFFuzzer)
+      cp corpus/slideshow/*.ppt corpusHSLF/
+      ;;
+    POIHSMFFuzzer)
+      cp -a corpus/hsmf/* corpusHSMF/
+      ;;
+    POIHSSFFuzzer)
+      cp corpus/spreadsheet/*.xls corpusHSSF/
+      ;;
+    POIHWPFFuzzer)
+      cp corpus/document/*.doc corpus/document/*.DOC corpusHWPF/
+      ;;
+    POIOldExcelFuzzer)
+      cp corpus/spreadsheet/*.xls corpus/spreadsheet/*.bin corpusOldExcel/
+      ;;
+    POIRleFuzzer)
+      ;;
+    POIVisioFuzzer)
+      cp corpus/diagram/* corpusVisio/
+      ;;
+    POIXSLFFuzzer)
+      cp corpus/slideshow/* corpus/integration/*.pptx corpusXSLF/
+      ;;
+    POIXSSFBFuzzer)
+      cp corpus/spreadsheet/*.xlsb corpusXSSFB/
+      ;;
+    POIXSSFFuzzer)
+      cp corpus/spreadsheet/* corpus/integration/*.xlsx corpusXSSF/
+      ;;
+    POIXWPFFuzzer)
+      cp corpus/document/* corpus/integration/*.docx corpusXWPF/
+      ;;
+    XLSX2CSVFuzzer)
+      cp corpus/spreadsheet/* corpusXSSF/
+      ;;
+  esac
+
+  nice -n 19 ./jazzer \
+    --cp=build/libs/poi-fuzz-all.jar \
+    "--instrumentation_includes=org.apache.poi.**:org.apache.xmlbeans.**" \
+    --target_class=org.apache.poi.fuzz.${CLASS} \
+    -rss_limit_mb=2560 \
+    -timeout=600 \
+    -max_total_time=600 \
+    ${CORPUS}
+done
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org