diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2017-09-14 22:43:53 +0000 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2017-09-14 22:43:53 +0000 |
| commit | 846a217bfcbbb214725136efffb95cfdf4c526ab (patch) | |
| tree | 0619a7da79b4058885fccc837326449e25d7e02c /compiler-rt/lib/asan/asan_errors.cc | |
| parent | c4600ccf891ca8290ee4fa0a3f2be235dd5963d0 (diff) | |
| download | bcm5719-llvm-846a217bfcbbb214725136efffb95cfdf4c526ab.tar.gz bcm5719-llvm-846a217bfcbbb214725136efffb95cfdf4c526ab.zip | |
[asan] Remove ErrorStackOverflow
Summary:
The only difference from ErrorDeadlySignal is reporting code and it lives in
sanitizer common.
Part of https://github.com/google/sanitizers/issues/637
Reviewers: eugenis, alekseyshl, filcab
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D37868
llvm-svn: 313309
Diffstat (limited to 'compiler-rt/lib/asan/asan_errors.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_errors.cc | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/compiler-rt/lib/asan/asan_errors.cc b/compiler-rt/lib/asan/asan_errors.cc index 7625dc9b8ea..cc09248afdc 100644 --- a/compiler-rt/lib/asan/asan_errors.cc +++ b/compiler-rt/lib/asan/asan_errors.cc @@ -22,56 +22,56 @@ namespace __asan { -void ErrorStackOverflow::Print() { - Decorator d; - Printf("%s", d.Warning()); - Report( - "ERROR: AddressSanitizer: %s on address %p" - " (pc %p bp %p sp %p T%d)\n", - scariness.GetDescription(), (void *)signal.addr, (void *)signal.pc, - (void *)signal.bp, (void *)signal.sp, tid); - Printf("%s", d.Default()); - scariness.Print(); - BufferedStackTrace stack; - GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, signal.pc, signal.bp, - signal.context, - common_flags()->fast_unwind_on_fatal); - stack.Print(); - ReportErrorSummary(scariness.GetDescription(), &stack); -} - void ErrorDeadlySignal::Print() { - Decorator d; - Printf("%s", d.Warning()); - const char *description = signal.Describe(); - Report( - "ERROR: AddressSanitizer: %s on unknown address %p (pc %p bp %p sp %p " - "T%d)\n", - description, (void *)signal.addr, (void *)signal.pc, (void *)signal.bp, - (void *)signal.sp, tid); - Printf("%s", d.Default()); - if (signal.pc < GetPageSizeCached()) - Report("Hint: pc points to the zero page.\n"); - if (signal.is_memory_access) { - const char *access_type = - signal.write_flag == SignalContext::WRITE - ? "WRITE" - : (signal.write_flag == SignalContext::READ ? "READ" : "UNKNOWN"); - Report("The signal is caused by a %s memory access.\n", access_type); - if (signal.addr < GetPageSizeCached()) - Report("Hint: address points to the zero page.\n"); + if (signal.IsStackOverflow()) { + Decorator d; + Printf("%s", d.Warning()); + Report( + "ERROR: AddressSanitizer: %s on address %p" + " (pc %p bp %p sp %p T%d)\n", + scariness.GetDescription(), (void *)signal.addr, (void *)signal.pc, + (void *)signal.bp, (void *)signal.sp, tid); + Printf("%s", d.Default()); + scariness.Print(); + BufferedStackTrace stack; + GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, signal.pc, + signal.bp, signal.context, + common_flags()->fast_unwind_on_fatal); + stack.Print(); + ReportErrorSummary(scariness.GetDescription(), &stack); + } else { + Decorator d; + Printf("%s", d.Warning()); + const char *description = signal.Describe(); + Report( + "ERROR: AddressSanitizer: %s on unknown address %p (pc %p bp %p sp %p " + "T%d)\n", + description, (void *)signal.addr, (void *)signal.pc, (void *)signal.bp, + (void *)signal.sp, tid); + Printf("%s", d.Default()); + if (signal.pc < GetPageSizeCached()) + Report("Hint: pc points to the zero page.\n"); + if (signal.is_memory_access) { + const char *access_type = + signal.write_flag == SignalContext::WRITE + ? "WRITE" + : (signal.write_flag == SignalContext::READ ? "READ" : "UNKNOWN"); + Report("The signal is caused by a %s memory access.\n", access_type); + if (signal.addr < GetPageSizeCached()) + Report("Hint: address points to the zero page.\n"); + } + MaybeReportNonExecRegion(signal.pc); + scariness.Print(); + BufferedStackTrace stack; + GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, signal.pc, + signal.bp, signal.context, + common_flags()->fast_unwind_on_fatal); + stack.Print(); + MaybeDumpInstructionBytes(signal.pc); + MaybeDumpRegisters(signal.context); + Printf("AddressSanitizer can not provide additional info.\n"); + ReportErrorSummary(description, &stack); } - MaybeReportNonExecRegion(signal.pc); - scariness.Print(); - BufferedStackTrace stack; - GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, signal.pc, signal.bp, - signal.context, - common_flags()->fast_unwind_on_fatal); - stack.Print(); - MaybeDumpInstructionBytes(signal.pc); - MaybeDumpRegisters(signal.context); - Printf("AddressSanitizer can not provide additional info.\n"); - ReportErrorSummary(description, &stack); } void ErrorDoubleFree::Print() { |

