summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-07-19 22:10:30 +0000
committerKostya Serebryany <kcc@google.com>2017-07-19 22:10:30 +0000
commit4a27b70ed51ce782ec8a6af45230228269103600 (patch)
tree75d77240c87497ba8c7cc43600a561249bb7221a
parent0e0b3c97dd07d67002538d29de22918319f1fb11 (diff)
downloadbcm5719-llvm-4a27b70ed51ce782ec8a6af45230228269103600.tar.gz
bcm5719-llvm-4a27b70ed51ce782ec8a6af45230228269103600.zip
[libFuzzer] enable reduce_inputs=1 by default (seems to be a big win usually)
llvm-svn: 308541
-rw-r--r--llvm/docs/LibFuzzer.rst3
-rw-r--r--llvm/lib/Fuzzer/FuzzerFlags.def4
-rw-r--r--llvm/lib/Fuzzer/test/shrink.test6
-rw-r--r--llvm/lib/Fuzzer/test/value-profile-load.test2
4 files changed, 9 insertions, 6 deletions
diff --git a/llvm/docs/LibFuzzer.rst b/llvm/docs/LibFuzzer.rst
index 0f0b0e2e6fb..b833c2a6cb9 100644
--- a/llvm/docs/LibFuzzer.rst
+++ b/llvm/docs/LibFuzzer.rst
@@ -345,6 +345,9 @@ possible event codes are:
``NEW``
The fuzzer has created a test input that covers new areas of the code
under test. This input will be saved to the primary corpus directory.
+``REDUCE``
+ The fuzzer has found a better (smaller) input that triggers previously
+ discovered features (set ``-reduce_inputs=0`` to disable).
``pulse``
The fuzzer has generated 2\ :sup:`n` inputs (generated periodically to reassure
the user that the fuzzer is still working).
diff --git a/llvm/lib/Fuzzer/FuzzerFlags.def b/llvm/lib/Fuzzer/FuzzerFlags.def
index 526805705b2..2887fd24d48 100644
--- a/llvm/lib/Fuzzer/FuzzerFlags.def
+++ b/llvm/lib/Fuzzer/FuzzerFlags.def
@@ -66,8 +66,8 @@ FUZZER_FLAG_INT(use_value_profile, 0,
"Experimental. Use value profile to guide fuzzing.")
FUZZER_FLAG_INT(use_cmp, 1, "Use CMP traces to guide mutations")
FUZZER_FLAG_INT(shrink, 0, "Experimental. Try to shrink corpus inputs.")
-FUZZER_FLAG_INT(reduce_inputs, 0, "Experimental. "
- "Try to reduce the size of inputs wile preserving their full feature sets")
+FUZZER_FLAG_INT(reduce_inputs, 1,
+ "Try to reduce the size of inputs while preserving their full feature sets")
FUZZER_FLAG_UNSIGNED(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn"
" this number of jobs in separate worker processes"
" with stdout/stderr redirected to fuzz-JOB.log.")
diff --git a/llvm/lib/Fuzzer/test/shrink.test b/llvm/lib/Fuzzer/test/shrink.test
index edb86cb1938..79355a8f71a 100644
--- a/llvm/lib/Fuzzer/test/shrink.test
+++ b/llvm/lib/Fuzzer/test/shrink.test
@@ -1,6 +1,6 @@
-RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=1 2>&1 | FileCheck %s --check-prefix=SHRINK1
-RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=0 2>&1 | FileCheck %s --check-prefix=SHRINK0
-RUN: LLVMFuzzer-ShrinkValueProfileTest -seed=1 -exit_on_item=aea2e3923af219a8956f626558ef32f30a914ebc -runs=100000 -shrink=1 -use_value_profile=1 2>&1 | FileCheck %s --check-prefix=SHRINK1_VP
+RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=1 -reduce_inputs=0 2>&1 | FileCheck %s --check-prefix=SHRINK1
+RUN: LLVMFuzzer-ShrinkControlFlowTest -seed=1 -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 -shrink=0 -reduce_inputs=0 2>&1 | FileCheck %s --check-prefix=SHRINK0
+RUN: LLVMFuzzer-ShrinkValueProfileTest -seed=1 -exit_on_item=aea2e3923af219a8956f626558ef32f30a914ebc -runs=100000 -shrink=1 -reduce_inputs=0 -use_value_profile=1 2>&1 | FileCheck %s --check-prefix=SHRINK1_VP
SHRINK0: Done 1000000 runs in
SHRINK1: INFO: found item with checksum '0eb8e4ed029b774d80f2b66408203801cb982a60', exiting.
diff --git a/llvm/lib/Fuzzer/test/value-profile-load.test b/llvm/lib/Fuzzer/test/value-profile-load.test
index 14d3109a24e..f4a5fd5a68e 100644
--- a/llvm/lib/Fuzzer/test/value-profile-load.test
+++ b/llvm/lib/Fuzzer/test/value-profile-load.test
@@ -1,3 +1,3 @@
CHECK: AddressSanitizer: global-buffer-overflow
-RUN: not LLVMFuzzer-LoadTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=10000000 2>&1 | FileCheck %s
+RUN: not LLVMFuzzer-LoadTest -seed=2 -use_cmp=0 -use_value_profile=1 -runs=20000000 2>&1 | FileCheck %s
OpenPOWER on IntegriCloud