summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2019-09-27 22:04:36 +0000
committerMitch Phillips <mitchphillips@outlook.com>2019-09-27 22:04:36 +0000
commit2b7e04031eae52b103c2dd20d4aaf6c4a9f7251e (patch)
tree303fb17aec69fbe385c3dba2197bce3de3cc0534
parent298de05963130a8c282d2a67d1a0971c38696043 (diff)
downloadcompiler-rt-2b7e04031eae52b103c2dd20d4aaf6c4a9f7251e.tar.gz
[libFuzzer] Dump trace and provide correct msg for overwritten input.
Summary: Now crashes with a stacktrace and uses 'overwrites-const-input' as the error message instead of 'out-of-memory'. Reviewers: morehouse, Dor1s Reviewed By: morehouse, Dor1s Subscribers: #sanitizers, llvm-commits, metzman, Dor1s Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68067 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@373130 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/fuzzer/FuzzerLoop.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fuzzer/FuzzerLoop.cpp b/lib/fuzzer/FuzzerLoop.cpp
index 7150a116b..96ab544b1 100644
--- a/lib/fuzzer/FuzzerLoop.cpp
+++ b/lib/fuzzer/FuzzerLoop.cpp
@@ -515,8 +515,10 @@ size_t Fuzzer::GetCurrentUnitInFuzzingThead(const uint8_t **Data) const {
void Fuzzer::CrashOnOverwrittenData() {
Printf("==%d== ERROR: libFuzzer: fuzz target overwrites its const input\n",
GetPid());
+ PrintStackTrace();
+ Printf("SUMMARY: libFuzzer: overwrites-const-input\n");
DumpCurrentUnit("crash-");
- Printf("SUMMARY: libFuzzer: out-of-memory\n");
+ PrintFinalStats();
_Exit(Options.ErrorExitCode); // Stop right now.
}