summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer')
-rw-r--r--llvm/lib/Fuzzer/FuzzerCorpus.h2
-rw-r--r--llvm/lib/Fuzzer/FuzzerDriver.cpp1
-rw-r--r--llvm/lib/Fuzzer/FuzzerLoop.cpp3
3 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerCorpus.h b/llvm/lib/Fuzzer/FuzzerCorpus.h
index a46f1dccb45..382980b9fee 100644
--- a/llvm/lib/Fuzzer/FuzzerCorpus.h
+++ b/llvm/lib/Fuzzer/FuzzerCorpus.h
@@ -123,7 +123,7 @@ class InputCorpus {
assert(II.NumFeatures > 0);
II.NumFeatures--;
if (II.NumFeatures == 0) {
- II.U.clear();
+ Unit().swap(II.U);
if (FeatureDebug)
Printf("EVICTED %zd\n", SmallestElementPerFeature[Idx]);
}
diff --git a/llvm/lib/Fuzzer/FuzzerDriver.cpp b/llvm/lib/Fuzzer/FuzzerDriver.cpp
index fd88d50cfa8..336bdf0f859 100644
--- a/llvm/lib/Fuzzer/FuzzerDriver.cpp
+++ b/llvm/lib/Fuzzer/FuzzerDriver.cpp
@@ -516,6 +516,7 @@ int FuzzerDriver(int *argc, char ***argv, UserCallback Callback) {
Printf("INFO: A corpus is not provided, starting from an empty corpus\n");
}
F.ShuffleAndMinimize(&InitialCorpus);
+ InitialCorpus.clear(); // Don't need this memory any more.
F.Loop();
if (Flags.verbosity)
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp
index a1772412a32..49b58ddf5d5 100644
--- a/llvm/lib/Fuzzer/FuzzerLoop.cpp
+++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp
@@ -274,7 +274,7 @@ void Fuzzer::RssLimitCallback() {
GetPid(), GetPeakRSSMb(), Options.RssLimitMb);
Printf(" To change the out-of-memory limit use -rss_limit_mb=<N>\n\n");
if (EF->__sanitizer_print_memory_profile)
- EF->__sanitizer_print_memory_profile(50);
+ EF->__sanitizer_print_memory_profile(95);
DumpCurrentUnit("oom-");
Printf("SUMMARY: libFuzzer: out-of-memory\n");
PrintFinalStats();
@@ -324,6 +324,7 @@ void Fuzzer::PrintStats(const char *Where, const char *End, size_t Units) {
Printf(" units: %zd", Units);
Printf(" exec/s: %zd", ExecPerSec);
+ Printf(" rss: %zdMb", GetPeakRSSMb());
Printf("%s", End);
}
OpenPOWER on IntegriCloud