[libFuzzer] deprecate -save_minimized_corpus, -merge can be used instead
authorKostya Serebryany <kcc@google.com>
Sat, 19 Dec 2015 03:42:16 +0000 (03:42 +0000)
committerKostya Serebryany <kcc@google.com>
Sat, 19 Dec 2015 03:42:16 +0000 (03:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256086 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LibFuzzer.rst
lib/Fuzzer/FuzzerDriver.cpp
lib/Fuzzer/FuzzerFlags.def

index e14ea67d652c32791694d1be75eb9f5858be2827..84adff3616f7da2cba8591095b9986ab7a54c664 100644 (file)
@@ -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.
index 872d2c88e6f2f9e20727bb254781164889b22eaf..dc5f8babbfe697a964806472656045a9f26032bf 100644 (file)
@@ -296,6 +296,11 @@ int FuzzerDriver(const std::vector<std::string> &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<std::string> &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();
index da7a2d3f5c779d76fc15d942cc0ea08fb78901b2..c2b506c3c8aa69a7c337954aa23b76511be41c68 100644 (file)
@@ -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")