[PATCH] D23873: [asan] Reify ErrorDeadlySignal
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 6 11:07:25 PDT 2016
vitalybuka requested changes to this revision.
This revision now requires changes to proceed.
================
Comment at: lib/asan/asan_errors.h:23
@@ -21,1 +22,3 @@
+static inline void PrintMemoryByte(InternalScopedString *str,
+ const char *before, u8 byte, bool in_shadow,
----------------
I see no problem with symbol
Also we already have PrintGlobalNameIfASCII and PrintGlobalLocation, so this function could sit next to them in asan_report.cc and h
Please move it there.
================
Comment at: lib/asan/asan_errors.h:136
@@ -81,3 +135,3 @@
};
ErrorDescription() { internal_memset(this, 0, sizeof(*this)); }
ErrorDescription(const ErrorStackOverflow &e) // NOLINT
----------------
Let's keep NOLINT here for consistency,
================
Comment at: lib/asan/asan_report.cc:324-325
@@ -348,40 +323,4 @@
ScopedInErrorReport in_report(/*report*/ nullptr, /*fatal*/ true);
- Decorator d;
- Printf("%s", d.Warning());
- Report(
- "ERROR: AddressSanitizer: %s on unknown address %p"
- " (pc %p bp %p sp %p T%d)\n",
- description, (void *)sig.addr, (void *)sig.pc, (void *)sig.bp,
- (void *)sig.sp, GetCurrentTidOrInvalid());
- Printf("%s", d.EndWarning());
- ScarinessScore SS;
- if (sig.pc < GetPageSizeCached())
- Report("Hint: pc points to the zero page.\n");
- if (sig.is_memory_access) {
- const char *access_type =
- sig.write_flag == SignalContext::WRITE
- ? "WRITE"
- : (sig.write_flag == SignalContext::READ ? "READ" : "UNKNOWN");
- Report("The signal is caused by a %s memory access.\n", access_type);
- if (sig.addr < GetPageSizeCached()) {
- Report("Hint: address points to the zero page.\n");
- SS.Scare(10, "null-deref");
- } else if (sig.addr == sig.pc) {
- SS.Scare(60, "wild-jump");
- } else if (sig.write_flag == SignalContext::WRITE) {
- SS.Scare(30, "wild-addr-write");
- } else if (sig.write_flag == SignalContext::READ) {
- SS.Scare(20, "wild-addr-read");
- } else {
- SS.Scare(25, "wild-addr");
- }
- } else {
- SS.Scare(10, "signal");
- }
- SS.Print();
- GET_STACK_TRACE_SIGNAL(sig);
- stack.Print();
- MaybeDumpInstructionBytes(sig.pc);
- Printf("AddressSanitizer can not provide additional info.\n");
- ReportErrorSummary(description, &stack);
+ ErrorDeadlySignal error(signo, sig, GetCurrentTidOrInvalid());
+ in_report.ReportError(error);
}
----------------
I see, it's about ";" after "}"
Feel free to keep NOLINT here as this code does a lot of this already,
https://reviews.llvm.org/D23873
More information about the llvm-commits
mailing list