[PATCH] D68676: [ASan] Do not misrepresent high value address dereferences as null dereferences

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 01:33:47 PDT 2019


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp:302
+  // The real codes (e.g., SEGV_MAPERR, SEGV_MAPERR) are non-zero
+  return si->si_signo == SIGSEGV && si->si_code != 0;
+}
----------------
can you move it into darwin
on linux si_code is SI_KERNEL in similar cases so we will need different implementations


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp:194
   const char *description = sig.Describe();
-  Report("ERROR: %s: %s on unknown address %p (pc %p bp %p sp %p T%d)\n",
-         SanitizerToolName, description, (void *)sig.addr, (void *)sig.pc,
-         (void *)sig.bp, (void *)sig.sp, tid);
+  Report("ERROR: %s: %s on unknown address", SanitizerToolName, description);
+  if (!sig.is_memory_access || sig.is_true_faulting_addr)
----------------
can you change it to 
```
if (trueaddress)
  Print("Full error with address")
else
  Print("Full error without address")
```
I guess more readable and less problems when multiple processes write into same terminal


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68676/new/

https://reviews.llvm.org/D68676





More information about the llvm-commits mailing list