about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2025-01-30 07:38:40 +0900
committerNguyễn Gia Phong <cnx@loang.net>2025-01-30 07:38:40 +0900
commit7cf416a727f48b78afd820c68ac78e84c4919404 (patch)
tree447bdc3981ec3415a00eaa259c240b6b4e8ccc38
parent5468f737e1eb021f8a69fe3ba559c43aa22d1455 (diff)
downloadtaosc-7cf416a727f48b78afd820c68ac78e84c4919404.tar.gz
Allow passing of reproducer arguments
-rw-r--r--fix.m411
1 files changed, 6 insertions, 5 deletions
diff --git a/fix.m4 b/fix.m4
index 4647d00..471b9f0 100644
--- a/fix.m4
+++ b/fix.m4
@@ -18,15 +18,16 @@
 # along with taosc.  If not, see <https://www.gnu.org/licenses/>.
 
 set -ex
-if test $# -ne 3
+if test $# -lt 3
 then
-  echo Usage: taosc-fix binary address workdir
+  echo Usage: taosc-fix binary address workdir option...
   exit 1
 fi
 binary="$(realpath $1)"
 address="$2"
 wd="$(realpath $3)"
 bin="$wd/$(basename $binary)"
+opts="${@:4}"
 
 afl-dyninst -x "$binary" "$bin.fuzzee"
 pushd DATA_DIR > /dev/null
@@ -38,9 +39,9 @@ e9tool -M addr=$address -P 'if dest(state)@patch goto'\
 
 # TODO: augment number of executions
 afl-dyninst-env afl-fuzz -i "$wd/fuzz/exploits" -o "$wd/fuzz/crashes"\
-  -CE 10000 -- "$bin.fuzzee" -d @@
-find "$wd/fuzz/crashes/default/crashes" -name id:* |
-  parallel TAOSC_OUTPUT="$wd/vars/neg/"'$(basename {})' "$bin.collect" -d {}
+  -CE 10000 -- "$bin.fuzzee" $opts @@
+find "$wd/fuzz/crashes/default/crashes" -name id:* | parallel\
+  TAOSC_OUTPUT="$wd/vars/neg/"'$(basename {})' "$bin.collect" $opts {} || true
 time taosc-synth "$wd/vars" > "$wd/predicates"
 taosc-scout "$binary" "$address" > "$wd/destinations"