[PATCH] D42932: [libFuzzer] Set -experimental_len_control=1000 as default.
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 12:55:40 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325050: [libFuzzer] Set -experimental_len_control=1000 as default. (authored by morehouse, committed by ).
Herald added a subscriber: delcypher.
Changed prior to commit:
https://reviews.llvm.org/D42932?vs=134102&id=134104#toc
Repository:
rL LLVM
https://reviews.llvm.org/D42932
Files:
compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
compiler-rt/trunk/lib/fuzzer/FuzzerFlags.def
compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp
compiler-rt/trunk/lib/fuzzer/FuzzerOptions.h
Index: compiler-rt/trunk/lib/fuzzer/FuzzerFlags.def
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerFlags.def
+++ compiler-rt/trunk/lib/fuzzer/FuzzerFlags.def
@@ -17,7 +17,10 @@
FUZZER_FLAG_INT(max_len, 0, "Maximum length of the test input. "
"If 0, libFuzzer tries to guess a good value based on the corpus "
"and reports it. ")
-FUZZER_FLAG_INT(experimental_len_control, 0, "experimental flag")
+FUZZER_FLAG_INT(len_control, 1000, "Try generating small inputs first, "
+ "then try larger inputs over time. Specifies the rate at which the length "
+ "limit is increased (smaller == faster). If 0, immediately try inputs with "
+ "size up to max_len.")
FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.")
FUZZER_FLAG_INT(mutate_depth, 5,
"Apply this number of consecutive mutations to each input.")
Index: compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
+++ compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp
@@ -567,7 +567,7 @@
FuzzingOptions Options;
Options.Verbosity = Flags.verbosity;
Options.MaxLen = Flags.max_len;
- Options.ExperimentalLenControl = Flags.experimental_len_control;
+ Options.LenControl = Flags.len_control;
Options.UnitTimeoutSec = Flags.timeout;
Options.ErrorExitCode = Flags.error_exitcode;
Options.TimeoutExitCode = Flags.timeout_exitcode;
Index: compiler-rt/trunk/lib/fuzzer/FuzzerOptions.h
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerOptions.h
+++ compiler-rt/trunk/lib/fuzzer/FuzzerOptions.h
@@ -18,7 +18,7 @@
struct FuzzingOptions {
int Verbosity = 1;
size_t MaxLen = 0;
- size_t ExperimentalLenControl = 0;
+ size_t LenControl = 1000;
int UnitTimeoutSec = 300;
int TimeoutExitCode = 77;
int ErrorExitCode = 77;
Index: compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp
===================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp
+++ compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp
@@ -755,15 +755,15 @@
break;
// Update TmpMaxMutationLen
- if (Options.ExperimentalLenControl) {
+ if (Options.LenControl) {
if (TmpMaxMutationLen < MaxMutationLen &&
TotalNumberOfRuns - LastCorpusUpdateRun >
- Options.ExperimentalLenControl * Log(TmpMaxMutationLen)) {
+ Options.LenControl * Log(TmpMaxMutationLen)) {
TmpMaxMutationLen =
Min(MaxMutationLen, TmpMaxMutationLen + Log(TmpMaxMutationLen));
if (TmpMaxMutationLen <= MaxMutationLen)
Printf("#%zd\tTEMP_MAX_LEN: %zd (%zd %zd)\n", TotalNumberOfRuns,
- TmpMaxMutationLen, Options.ExperimentalLenControl,
+ TmpMaxMutationLen, Options.LenControl,
LastCorpusUpdateRun);
LastCorpusUpdateRun = TotalNumberOfRuns;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42932.134104.patch
Type: text/x-patch
Size: 3008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/dd23bc48/attachment.bin>
More information about the llvm-commits
mailing list