diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2017-10-23 22:04:30 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2017-10-23 22:04:30 +0000 |
commit | 4b9f44eeb084b0aa8ed0e8ddc5da8a3f13e5a764 (patch) | |
tree | 901ea456f08d41ae5cf5a6836834d2410dd1deae /lib/fuzzer/FuzzerInternal.h | |
parent | d93cb79ee54b601d00a1852e78895ae236857262 (diff) | |
download | compiler-rt-4b9f44eeb084b0aa8ed0e8ddc5da8a3f13e5a764.tar.gz |
[libFuzzer] Periodically purge allocator's quarantine to prolong fuzzing sessions.
Summary:
Fuzzing targets that allocate/deallocate a lot of memory tend to consume
a lot of RSS when ASan quarantine is enabled. Purging quarantine between
iterations and returning memory to OS keeps RSS down and should not
reduce the quarantine effectiveness provided the fuzz target does not
preserve state between iterations (in this case this feature can be turned off).
Based on D39153.
Reviewers: vitalybuka
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39155
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/fuzzer/FuzzerInternal.h')
-rw-r--r-- | lib/fuzzer/FuzzerInternal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/fuzzer/FuzzerInternal.h b/lib/fuzzer/FuzzerInternal.h index 34fdeb821..97c14085e 100644 --- a/lib/fuzzer/FuzzerInternal.h +++ b/lib/fuzzer/FuzzerInternal.h @@ -96,6 +96,7 @@ private: void CrashOnOverwrittenData(); void InterruptCallback(); void MutateAndTestOne(); + void PurgeAllocator(); void ReportNewCoverage(InputInfo *II, const Unit &U); void PrintPulseAndReportSlowInput(const uint8_t *Data, size_t Size); void WriteToOutputCorpus(const Unit &U); @@ -124,6 +125,8 @@ private: bool HasMoreMallocsThanFrees = false; size_t NumberOfLeakDetectionAttempts = 0; + system_clock::time_point LastAllocatorPurgeAttemptTime = system_clock::now(); + UserCallback CB; InputCorpus &Corpus; MutationDispatcher &MD; |