<div dir="ltr">r316627 bumps the number of runs, let's see if it helps. </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 25, 2017 at 4:20 PM, Steven Wu <span dir="ltr"><<a href="mailto:stevenwu@apple.com" target="_blank">stevenwu@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">I tried -purge_allocator_<wbr>interval=-1 already and it doesn't really have visible effects. It still takes about 800000 iterations. But reverting the commit will dramatically reduce the number.<div><br></div><div>I couldn't reproduce any of the above behavior on a macOS 10.13 machine but the bot is running 10.11 and I don't think it is going to be upgraded soon.</div><div><br></div><div>Here is 100 runs with random seed on the node:</div><div>27678, 86464, 292063, 223933, 270628, 369673, 69198, 104383, 360948, 493949, 201033, 69598, 38278, 369223, 1447353, 141653, 287133, 102902, 42483, 232098, 322363, 221209, 1351098, 334748, 133003, 154933, 283288, 53163, 142843, 684879, 231868, 129793, 65793, 289628, 661468, 39453, 1060768, 56888, 597893, 420758, 83254, 423834, 254628, 259539, 353788, 311658, 223364, 902998, 264956, 187758, 342088, 225504, 104525, 258820, 428398, 15638, 872103, 383763, 34288, 744653, 603998, 67733, 283263, 127868, 29828, 250905, 752238, 66483, 756183, 180353, 269019, 222198, 26859, 1542408, 77888, 300393, 370358, 382433, 173995, 186238, 218598, 215368, 166723, 427288, 147498, 255508, 215403, 181738, 524928, 74126, 48463, 278483, 533148, 27683, 200058, 127196, 405728, 203908, 487173, 104873</div><div><br></div><div>Let me know what else I can help.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Steven</div></font></span><div><div class="h5"><div><br><div><br><blockquote type="cite"><div>On Oct 25, 2017, at 4:00 PM, Kostya Serebryany <<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>> wrote:</div><br class="m_-7967190534120840566Apple-interchange-newline"><div><br class="m_-7967190534120840566Apple-interchange-newline"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Wed, Oct 25, 2017 at 3:11 PM, Steven Wu via llvm-commits<span class="m_-7967190534120840566Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@<wbr>lists.llvm.org</a>></span><span class="m_-7967190534120840566Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Hi Alex<div><br></div><div>This commit seems to break the greendragon libFuzzer bots in a weird way. </div><div><a href="http://green.lab.llvm.org/green/job/libFuzzer/8140/" target="_blank">http://green.lab.llvm.org/gree<wbr>n/job/libFuzzer/8140/</a></div><div><br></div><div>Personally, I have to rollback to macOS 10.11 to reproduce the issue. After your commit, it takes much more runs to trigger the exit on fuzzer-customcrossover.test<wbr>. I am not an expert in fuzzer so I don't understand how this commit actually trigger the issue.</div><div><br></div><div>Before this commit:</div><div></div><blockquote type="cite"><div>$ fuzzer-customcrossover.test.<wbr>tmp-CustomCrossOverTest -seed=1 -runs=100000</div></blockquote></div></blockquote><div><br></div><div>Weird. </div><div>On linux this test finishes much sooner regardless the seed. </div><div>Can you run 1000 times without -seed=1 (i.e. with a random seed) and tell us the iteration numbers? </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><blockquote type="cite"><div>...</div><div><div>#80269<span class="m_-7967190534120840566gmail-m_5950299218738954550Apple-tab-span" style="white-space:pre-wrap">  </span>REDUCE cov: 38 ft: 64 corp: 17/10063b exec/s: 26756 rss: 306Mb L: 961/4035 MS: 2 ChangeBinInt-EraseBytes-</div><div>#97458<span class="m_-7967190534120840566gmail-m_5950299218738954550Apple-tab-span" style="white-space:pre-wrap">        </span>NEW    cov: 39 ft: 65 corp: 18/10064b exec/s: 32486 rss: 361Mb L: 1/4035 MS: 1 ChangeByte-</div><div>BINGO; Found the target, exiting</div><div>==71874== ERROR: libFuzzer: fuzz target exited</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#0 0x1094e8ee0 in __sanitizer_print_stack_trace<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://asan_stack.cc:38/" target="_blank"><wbr>asan_stack.cc:38</a></div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#1 0x1081f3c3b in fuzzer::Fuzzer::StaticExitCall<wbr>back() FuzzerLoop.cpp:214</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#2 0x7fff960c7450 in __cxa_finalize_ranges (libsystem_c.dylib:x86_64+0x5f<wbr>450)</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#3 0x7fff960c7766 in exit (libsystem_c.dylib:x86_64+0x5f<wbr>766)</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#4 0x1081e3b2b in LLVMFuzzerTestOneInput CustomCrossOverTest.cpp:34</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#5 0x1081f4def in fuzzer::Fuzzer::ExecuteCallbac<wbr>k(unsigned char const*, unsigned long) FuzzerLoop.cpp:471</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#6 0x1081f479b in fuzzer::Fuzzer::RunOne(unsigne<wbr>d char const*, unsigned long, bool, fuzzer::InputInfo*) FuzzerLoop.cpp:399</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#7 0x1081f6641 in fuzzer::Fuzzer::MutateAndTestO<wbr>ne() FuzzerLoop.cpp:602</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#8 0x1081f7277 in fuzzer::Fuzzer::Loop(std::__1:<wbr>:vector<std::__1::basic_string<wbr><char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::<wbr>__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) FuzzerLoop.cpp:710</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#9 0x1081eeece in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:738</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#10 0x108214cd2 in main FuzzerMain.cpp:20</div><div>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#11 0x7fff8c78d5ac in start (libdyld.dylib:x86_64+0x35ac)</div><div><br></div><div>SUMMARY: libFuzzer: fuzz target exited</div></div></blockquote><div><div><br></div><div>After the commit, I have to use -run=1000000 to trigger:</div><div></div><blockquote type="cite"><div>$ fuzzer-customcrossover.test.<wbr>tmp-CustomCrossOverTest -seed=1 -runs=1000000</div><div>...</div><div>#819960<span class="m_-7967190534120840566gmail-m_5950299218738954550Apple-tab-span" style="white-space:pre-wrap">       </span>REDUCE cov: 38 ft: 64 corp: 17/10063b exec/s: 35650 rss: 407Mb L: 4035/4035 MS: 3 EraseBytes-CopyPart-CopyPart-<br>#837409<span class="m_-7967190534120840566gmail-m_5950299218738954550Apple-tab-span" style="white-space:pre-wrap">      </span>NEW    cov: 39 ft: 65 corp: 18/10064b exec/s: 34892 rss: 407Mb L: 1/4035 MS: 2 ChangeBit-ChangeBit-<br>BINGO; Found the target, exiting<br>==72288== ERROR: libFuzzer: fuzz target exited<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#0 0x1025d6ee0 in __sanitizer_print_stack_trace<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://asan_stack.cc:38/" target="_blank"><wbr>asan_stack.cc:38</a><br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#1 0x1012dea2b in fuzzer::Fuzzer::StaticExitCall<wbr>back() FuzzerLoop.cpp:214<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#2 0x7fff960c7450 in __cxa_finalize_ranges (libsystem_c.dylib:x86_64+0x5f<wbr>450)<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#3 0x7fff960c7766 in exit (libsystem_c.dylib:x86_64+0x5f<wbr>766)<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#4 0x1012ce8cb in LLVMFuzzerTestOneInput CustomCrossOverTest.cpp:34<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#5 0x1012dfbdf in fuzzer::Fuzzer::ExecuteCallbac<wbr>k(unsigned char const*, unsigned long) FuzzerLoop.cpp:471<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#6 0x1012df58b in fuzzer::Fuzzer::RunOne(unsigne<wbr>d char const*, unsigned long, bool, fuzzer::InputInfo*) FuzzerLoop.cpp:399<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#7 0x1012e1431 in fuzzer::Fuzzer::MutateAndTestO<wbr>ne() FuzzerLoop.cpp:602<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#8 0x1012e2225 in fuzzer::Fuzzer::Loop(std::__1:<wbr>:vector<std::__1::basic_string<wbr><char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<st<wbr>d::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) FuzzerLoop.cpp:725<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#9 0x1012d9c8e in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:739<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#10 0x1012ffbd2 in main FuzzerMain.cpp:20<br>   <span class="m_-7967190534120840566Apple-converted-space"> </span>#11 0x7fff8c78d5ac in start (libdyld.dylib:x86_64+0x35ac)<br><br>SUMMARY: libFuzzer: fuzz target exited</div></blockquote><div><br></div><div>The easiest fix might be to update the test to run a bit longer but I am not sure if that is the right fix without understanding what is the underlying reason:</div><div><div>diff --git a/test/fuzzer/fuzzer-customcro<wbr>ssover.test b/test/fuzzer/fuzzer-customcro<wbr>ssover.test</div><div>index c32079f45..4b87c2cd7 100644</div><div>--- a/test/fuzzer/fuzzer-customcro<wbr>ssover.test</div><div>+++ b/test/fuzzer/fuzzer-customcro<wbr>ssover.test</div><div>@@ -1,6 +1,6 @@</div><div> RUN: %cpp_compiler %S/CustomCrossOverTest.cpp -o %t-CustomCrossOverTest</div><div><br></div><div>-RUN: not %t-CustomCrossOverTest -seed=1 -runs=100000                2>&1 | FileCheck %s --check-prefix=CHECK_CO</div><div>+RUN: not %t-CustomCrossOverTest -seed=1 -runs=1000000               2>&1 | FileCheck %s --check-prefix=CHECK_CO</div><div> Disable cross_over, verify that we can't find the target w/o it.</div><div> RUN:     %t-CustomCrossOverTest -seed=1 -runs=1000000 -cross_over=0 2>&1 | FileCheck %s --check-prefix=CHECK_NO_CO</div></div><div><br></div><div>Thanks</div><div><br></div><div>Steven</div><div><div class="m_-7967190534120840566gmail-h5"><div><br></div><div><br><blockquote type="cite"><div>On Oct 23, 2017, at 3:04 PM, Alex Shlyapnikov via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="m_-7967190534120840566gmail-m_5950299218738954550Apple-interchange-newline"><div><div>Author: alekseyshl<br>Date: Mon Oct 23 15:04:30 2017<br>New Revision: 316382<br><br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=316382&view=rev" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project?rev=316382&view=<wbr>rev</a><br>Log:<br>[libFuzzer] Periodically purge allocator's quarantine to prolong fuzzing sessions.<br><br>Summary:<br>Fuzzing targets that allocate/deallocate a lot of memory tend to consume<br>a lot of RSS when ASan quarantine is enabled. Purging quarantine between<br>iterations and returning memory to OS keeps RSS down and should not<br>reduce the quarantine effectiveness provided the fuzz target does not<br>preserve state between iterations (in this case this feature can be turned off).<br><br>Based on D39153.<br><br>Reviewers: vitalybuka<br><br>Subscribers: llvm-commits<br><br>Differential Revision:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="https://reviews.llvm.org/D39155" target="_blank">https://reviews.<wbr>llvm.org/D39155</a><br><br>Modified:<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerDriver.cpp<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerExtFunctions.def<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerFlags.def<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerInternal.h<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerLoop.cpp<br>   compiler-rt/trunk/lib/fuzze<wbr>r/FuzzerOptions.h<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerDriver.cpp<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerDriver.cpp?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/FuzzerDriver.<wbr>cpp?rev=316382&r1=316381&r2=<wbr>316382&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerDriver.cpp (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerDriver.cpp Mon Oct 23 15:04:30 2017<br>@@ -578,6 +578,7 @@ int FuzzerDriver(int *argc, char ***argv<br>  Options.ReloadIntervalSec = Flags.reload;<br>  Options.OnlyASCII = Flags.only_ascii;<br>  Options.DetectLeaks = Flags.detect_leaks;<br>+  Options.PurgeAllocatorInterva<wbr>lSec = Flags.purge_allocator_interval<wbr>;<br>  Options.TraceMalloc = Flags.trace_malloc;<br>  Options.RssLimitMb = Flags.rss_limit_mb;<br>  if (Flags.runs >= 0)<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerExtFunctions.def<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerExtFunctions.def?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/<wbr>FuzzerExtFunctions.def?rev=<wbr>316382&r1=316381&r2=316382&<wbr>view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerExtFunctions.def (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerExtFunctions.def Mon Oct 23 15:04:30 2017<br>@@ -33,6 +33,7 @@ EXT_FUNC(__sanitizer_install_m<wbr>alloc_and_<br>         (void (*malloc_hook)(const volatile void *, size_t),<br>          void (*free_hook)(const volatile void *)),<br>         false);<br>+EXT_FUNC(__sanitizer_purge_al<wbr>locator, void, (), false);<br>EXT_FUNC(__sanitizer_print_mem<wbr>ory_profile, int, (size_t, size_t), false);<br>EXT_FUNC(__sanitizer_print_sta<wbr>ck_trace, void, (), true);<br>EXT_FUNC(__sanitizer_symbolize<wbr>_pc, void,<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerFlags.def<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerFlags.def?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/FuzzerFlags.<wbr>def?rev=316382&r1=316381&r2=<wbr>316382&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerFlags.def (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerFlags.def Mon Oct 23 15:04:30 2017<br>@@ -114,6 +114,10 @@ FUZZER_FLAG_INT(close_fd_mask, 0, "If 1,<br>    "Be careful, this will also close e.g. asan's stderr/stdout.")<br>FUZZER_FLAG_INT(detect_leaks, 1, "If 1, and if LeakSanitizer is enabled "<br>    "try to detect memory leaks during fuzzing (i.e. not only at shut down).")<br>+FUZZER_FLAG_INT(purge_allocat<wbr>or_interval, 1, "Purge allocator caches and "<br>+    "quarantines every <N> seconds. When rss_limit_mb is specified (>0), "<br>+    "purging starts when RSS exceeds 50% of rss_limit_mb. Pass "<br>+    "purge_allocator_interval=-<wbr>1 to disable this functionality.")<br>FUZZER_FLAG_INT(trace_malloc, 0, "If >= 1 will print all mallocs/frees. "<br>    "If >= 2 will also print stack traces.")<br>FUZZER_FLAG_INT(rss_limit_mb, 2048, "If non-zero, the fuzzer will exit upon"<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerInternal.h<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerInternal.h?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/<wbr>FuzzerInternal.h?rev=316382&<wbr>r1=316381&r2=316382&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerInternal.h (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerInternal.h Mon Oct 23 15:04:30 2017<br>@@ -96,6 +96,7 @@ private:<br>  void CrashOnOverwrittenData();<br>  void InterruptCallback();<br>  void MutateAndTestOne();<br>+  void PurgeAllocator();<br>  void ReportNewCoverage(InputInfo *II, const Unit &U);<br>  void PrintPulseAndReportSlowInput(c<wbr>onst uint8_t *Data, size_t Size);<br>  void WriteToOutputCorpus(const Unit &U);<br>@@ -124,6 +125,8 @@ private:<br>  bool HasMoreMallocsThanFrees = false;<br>  size_t NumberOfLeakDetectionAttempts = 0;<br><br>+  system_clock::time_point LastAllocatorPurgeAttemptTime = system_clock::now();<br>+<br>  UserCallback CB;<br>  InputCorpus &Corpus;<br>  MutationDispatcher &MD;<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerLoop.cpp<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerLoop.cpp?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/FuzzerLoop.<wbr>cpp?rev=316382&r1=316381&r2=<wbr>316382&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerLoop.cpp (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerLoop.cpp Mon Oct 23 15:04:30 2017<br>@@ -587,7 +587,7 @@ void Fuzzer::MutateAndTestOne() {<br>    size_t NewSize = 0;<br>    NewSize = MD.Mutate(CurrentUnitData, Size, CurrentMaxMutationLen);<br>    assert(NewSize > 0 && "Mutator returned empty unit");<br>-    assert(NewSize <= CurrentMaxMutationLen && "Mutator return overisized unit");<br>+    assert(NewSize <= CurrentMaxMutationLen && "Mutator return oversized unit");<br>    Size = NewSize;<br>    II.NumExecutedMutations++;<br>    if (RunOne(CurrentUnitData, Size, /*MayDeleteFile=*/true, &II))<br>@@ -598,6 +598,25 @@ void Fuzzer::MutateAndTestOne() {<br>  }<br>}<br><br>+void Fuzzer::PurgeAllocator() {<br>+  if (Options.PurgeAllocatorInterva<wbr>lSec < 0 ||<br>+      !EF->__sanitizer_purge_al<wbr>locator) {<br>+    return;<br>+  }<br>+  if (duration_cast<seconds>(system<wbr>_clock::now() -<br>+                             La<wbr>stAllocatorPurgeAttemptTime).<wbr>count() <<br>+      Options.PurgeAllocatorInt<wbr>ervalSec) {<br>+    return;<br>+  }<br>+<br>+  if (Options.RssLimitMb <= 0 ||<br>+      GetPeakRSSMb() > static_cast<size_t>(Options.Rs<wbr>sLimitMb) / 2) {<br>+    EF->__sanitizer_purge_alloc<wbr>ator();<br>+  }<br>+<br>+  LastAllocatorPurgeAttemptTime = system_clock::now();<br>+}<br>+<br>void Fuzzer::ReadAndExecuteSeedCorp<wbr>ora(const Vector<std::string> &CorpusDirs) {<br>  const size_t kMaxSaneLen = 1 << 20;<br>  const size_t kMinDefaultLen = 4096;<br>@@ -699,6 +718,8 @@ void Fuzzer::Loop(const Vector<std::stri<br><br>    // Perform several mutations and runs.<br>    MutateAndTestOne();<br>+<br>+    PurgeAllocator();<br>  }<br><br>  PrintStats("DONE  ", "\n");<br><br>Modified: compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerOptions.h<br>URL:<span class="m_-7967190534120840566Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerOptions.h?rev=316382&r1=316381&r2=316382&view=diff" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project/compiler-rt/<wbr>trunk/lib/fuzzer/<wbr>FuzzerOptions.h?rev=316382&r1=<wbr>316381&r2=316382&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerOptions.h (original)<br>+++ compiler-rt/trunk/lib/fuzzer/F<wbr>uzzerOptions.h Mon Oct 23 15:04:30 2017<br>@@ -54,6 +54,7 @@ struct FuzzingOptions {<br>  bool DumpCoverage = false;<br>  bool UseClangCoverage = false;<br>  bool DetectLeaks = true;<br>+  int PurgeAllocatorIntervalSec = 1;<br>  int UseFeatureFrequency = false;<br>  int  TraceMalloc = 0;<br>  bool HandleAbrt = false;<br><br><br>______________________________<wbr>_________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br></div></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a></blockquote></div></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>