From efd53ad5c9d9ab7a04731226a0d1742961f45057 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Tue, 17 Feb 2015 19:32:38 +0100 Subject: [PATCH] Fuzz test : Add -a(SAN) option to disable ulimit when fuzzing from https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer#ulimit_-v The ulimit -v command makes little sense with ASan-ified binaries because ASan consumes 20 terabytes of virtual memory (plus a bit). Change-Id: I8c8c77dd51d5440fb2f9bd95f90873e59a64d409 Reviewed-on: https://code.wireshark.org/review/7204 Reviewed-by: Peter Wu Reviewed-by: Evan Huus --- tools/fuzz-test.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh index b2d2c9e9a1..f31ec987d9 100755 --- a/tools/fuzz-test.sh +++ b/tools/fuzz-test.sh @@ -45,14 +45,18 @@ CONFIG_PROFILE= # Run under valgrind ? VALGRIND=0 +# Run under AddressSanitizer ? +ASAN=0 + # The maximum permitted amount of memory leaked. Eventually this should be # worked down to zero, but right now that would fail on every single capture. # Only has effect when running under valgrind. MAX_LEAK=`expr 1024 \* 100` # To do: add options for file names and limits -while getopts ":2b:C:d:e:gp:P:" OPTCHAR ; do +while getopts "2b:C:d:e:agp:P:" OPTCHAR ; do case $OPTCHAR in + a) ASAN=1 ;; 2) TWO_PASS="-2 " ;; b) BIN_DIR=$OPTARG ;; C) CONFIG_PROFILE="-C $OPTARG " ;; @@ -109,7 +113,7 @@ if [ $FOUND -eq 0 ] ; then cat < /dev/null 2>> $TMP_DIR/$ERR_FILE )