diff options
author | 2020-08-17 11:34:21 -0700 | |
---|---|---|
committer | 2020-08-17 11:34:21 -0700 | |
commit | d250f4ffbbdd04554df9e497fc452df2d2cdbd43 (patch) | |
tree | 4a335d680d68ff8426cfd689674c919602778a30 /infra | |
parent | f686d962570d18f042e11968a1cb0a1b5a8e4b0d (diff) |
[infra] Upgrade reproduce command to re-use run_fuzzer functionality. (#4324)
* [infra] Upgrade reproduce command to re-use run_fuzzer functionality.
* fix a typo
* add missing quotes
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/base-images/base-runner/reproduce | 8 | ||||
-rwxr-xr-x | infra/base-images/base-runner/run_fuzzer | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/infra/base-images/base-runner/reproduce b/infra/base-images/base-runner/reproduce index 5e71eefe..0b4357bd 100755 --- a/infra/base-images/base-runner/reproduce +++ b/infra/base-images/base-runner/reproduce @@ -15,7 +15,6 @@ # ################################################################################ -DEBUGGER=${DEBUGGER:-} FUZZER=$1 shift @@ -28,6 +27,7 @@ if [ ! -f $TESTCASE ]; then exit 1 fi -export PATH=$OUT:$PATH -cd $OUT -$DEBUGGER $OUT/$FUZZER $FUZZER_ARGS $@ $TESTCASE +export RUN_FUZZER_MODE="interactive" +export FUZZING_ENGINE="libfuzzer" + +run_fuzzer $FUZZER $@ $TESTCASE diff --git a/infra/base-images/base-runner/run_fuzzer b/infra/base-images/base-runner/run_fuzzer index cebcebbd..15cb0d80 100755 --- a/infra/base-images/base-runner/run_fuzzer +++ b/infra/base-images/base-runner/run_fuzzer @@ -21,11 +21,20 @@ export PATH=$OUT:$PATH cd $OUT +DEBUGGER=${DEBUGGER:-} + FUZZER=$1 shift CORPUS_DIR="/tmp/${FUZZER}_corpus" +SANITIZER=${SANITIZER:-} +if [ -z $SANITIZER ]; then + # If $SANITIZER is not specified (e.g. calling from `reproduce` command), it + # is not important and can be set to any value. + SANITIZER="default" +fi + if [[ "$RUN_FUZZER_MODE" = interactive ]]; then FUZZER_OUT="$OUT/${FUZZER}_${FUZZING_ENGINE}_${SANITIZER}_out" else @@ -129,5 +138,9 @@ echo $CMD_LINE # Unset OUT so the fuzz target can't rely on it. unset OUT +if [ ! -z "$DEBUGGER" ]; then + CMD_LINE="$DEBUGGER $CMD_LINE" +fi + bash -c "$CMD_LINE" |