From 62663ee66ebb56c586e55b7342546f3bd74c279f Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Sat, 19 Dec 2015 03:42:16 +0000 Subject: [PATCH] [libFuzzer] deprecate -save_minimized_corpus, -merge can be used instead git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256086 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibFuzzer.rst | 1 - lib/Fuzzer/FuzzerDriver.cpp | 9 ++++++--- lib/Fuzzer/FuzzerFlags.def | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/LibFuzzer.rst b/docs/LibFuzzer.rst index e14ea67d652..84adff3616f 100644 --- a/docs/LibFuzzer.rst +++ b/docs/LibFuzzer.rst @@ -63,7 +63,6 @@ The most important flags are:: timeout 1200 Timeout in seconds (if positive). If one unit runs more than this number of seconds the process will abort. max_total_time 0 If positive, indicates the maximal total time in seconds to run the fuzzer. help 0 Print help. - save_minimized_corpus 0 If 1, the minimized corpus is saved into the first input directory. Example: ./fuzzer -save_minimized_corpus=1 NEW_EMPTY_DIR OLD_CORPUS merge 0 If 1, the 2-nd, 3-rd, etc corpora will be merged into the 1-st corpus. Only interesting units will be taken. 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. workers 0 Number of simultaneous worker processes to run the jobs. If zero, "min(jobs,NumberOfCpuCores()/2)" is used. diff --git a/lib/Fuzzer/FuzzerDriver.cpp b/lib/Fuzzer/FuzzerDriver.cpp index 872d2c88e6f..dc5f8babbfe 100644 --- a/lib/Fuzzer/FuzzerDriver.cpp +++ b/lib/Fuzzer/FuzzerDriver.cpp @@ -296,6 +296,11 @@ int FuzzerDriver(const std::vector &Args, exit(0); } + if (Flags.save_minimized_corpus) { + Printf("The flag -save_minimized_corpus is deprecated; use -merge=1\n"); + exit(1); + } + if (Flags.merge) { F.Merge(*Inputs); exit(0); @@ -317,9 +322,7 @@ int FuzzerDriver(const std::vector &Args, if (F.CorpusSize() == 0) F.AddToCorpus(Unit()); // Can't fuzz empty corpus, so add an empty input. F.ShuffleAndMinimize(); - if (Flags.save_minimized_corpus) - F.SaveCorpus(); - else if (Flags.drill) + if (Flags.drill) F.Drill(); else F.Loop(); diff --git a/lib/Fuzzer/FuzzerFlags.def b/lib/Fuzzer/FuzzerFlags.def index da7a2d3f5c7..c2b506c3c8a 100644 --- a/lib/Fuzzer/FuzzerFlags.def +++ b/lib/Fuzzer/FuzzerFlags.def @@ -32,10 +32,7 @@ FUZZER_FLAG_INT( FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total " "time in seconds to run the fuzzer.") FUZZER_FLAG_INT(help, 0, "Print help.") -FUZZER_FLAG_INT( - save_minimized_corpus, 0, - "If 1, the minimized corpus is saved into the first input directory. " - "Example: ./fuzzer -save_minimized_corpus=1 NEW_EMPTY_DIR OLD_CORPUS") +FUZZER_FLAG_INT(save_minimized_corpus, 0, "Deprecated. Use -merge=1") FUZZER_FLAG_INT(merge, 0, "If 1, the 2-nd, 3-rd, etc corpora will be " "merged into the 1-st corpus. Only interesting units will be taken.") FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters") -- 2.34.1