diff options
author | Kostya Serebryany <kcc@google.com> | 2016-04-29 18:49:55 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-04-29 18:49:55 +0000 |
commit | 2fe9304d62661c0603323351a2654e26515a9b6b (patch) | |
tree | 9374252500e4f1b8f5a0fb40f86f0a4a02faf68b /llvm/lib | |
parent | 1b1fef30d032f453324953a6fd7971ee3014ce98 (diff) | |
download | llvm-2fe9304d62661c0603323351a2654e26515a9b6b.zip llvm-2fe9304d62661c0603323351a2654e26515a9b6b.tar.gz llvm-2fe9304d62661c0603323351a2654e26515a9b6b.tar.bz2 |
[libFuzzer] enable detect_leaks=1, add proper docs
llvm-svn: 268088
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerFlags.def | 2 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerInternal.h | 2 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/test/fuzzer-leak.test | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerFlags.def b/llvm/lib/Fuzzer/FuzzerFlags.def index 2616232..86b203c 100644 --- a/llvm/lib/Fuzzer/FuzzerFlags.def +++ b/llvm/lib/Fuzzer/FuzzerFlags.def @@ -79,7 +79,7 @@ FUZZER_FLAG_INT(handle_term, 1, "If 1, try to intercept SIGTERM.") FUZZER_FLAG_INT(close_fd_mask, 0, "If 1, close stdout at startup; " "if 2, close stderr; if 3, close both. " "Be careful, this will also close e.g. asan's stderr/stdout.") -FUZZER_FLAG_INT(detect_leaks, 0, "If 1, and if LeakSanitizer is enabled " +FUZZER_FLAG_INT(detect_leaks, 1, "If 1, and if LeakSanitizer is enabled " "try to detect memory leaks during fuzzing (i.e. not only at shut down).") FUZZER_DEPRECATED_FLAG(exit_on_first) diff --git a/llvm/lib/Fuzzer/FuzzerInternal.h b/llvm/lib/Fuzzer/FuzzerInternal.h index a6c8678..169536b 100644 --- a/llvm/lib/Fuzzer/FuzzerInternal.h +++ b/llvm/lib/Fuzzer/FuzzerInternal.h @@ -304,7 +304,7 @@ public: bool OutputCSV = false; bool PrintNewCovPcs = false; bool PrintFinalStats = false; - bool DetectLeaks = false; + bool DetectLeaks = true; }; Fuzzer(UserCallback CB, MutationDispatcher &MD, FuzzingOptions Options); void AddToCorpus(const Unit &U) { diff --git a/llvm/lib/Fuzzer/test/fuzzer-leak.test b/llvm/lib/Fuzzer/test/fuzzer-leak.test index d86a8f68..48e9ca6 100644 --- a/llvm/lib/Fuzzer/test/fuzzer-leak.test +++ b/llvm/lib/Fuzzer/test/fuzzer-leak.test @@ -11,7 +11,7 @@ LEAK_IN_CORPUS: ERROR: libFuzzer: initial corpus triggers memory leaks. RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER -RUN: not LLVMFuzzer-LeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER +RUN: not LLVMFuzzer-LeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_DURING LEAK_AFTER: Done 100000 runs in LEAK_AFTER: ERROR: LeakSanitizer: detected memory leaks LEAK_AFTER-NOT: DEATH: |