summaryrefslogtreecommitdiff
path: root/libsanitizer/asan/asan_report.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libsanitizer/asan/asan_report.cc')
-rw-r--r--libsanitizer/asan/asan_report.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/libsanitizer/asan/asan_report.cc b/libsanitizer/asan/asan_report.cc
index 7e6381c2beb..c35b4ec14f7 100644
--- a/libsanitizer/asan/asan_report.cc
+++ b/libsanitizer/asan/asan_report.cc
@@ -42,7 +42,7 @@ void AppendToErrorMessageBuffer(const char *buffer) {
static void PrintBytes(const char *before, uptr *a) {
u8 *bytes = (u8*)a;
- uptr byte_num = (__WORDSIZE) / 8;
+ uptr byte_num = (SANITIZER_WORDSIZE) / 8;
Printf("%s%p:", before, (void*)a);
for (uptr i = 0; i < byte_num; i++) {
Printf(" %x%x", bytes[i] >> 4, bytes[i] & 15);
@@ -178,7 +178,7 @@ bool DescribeAddressIfStack(uptr addr, uptr access_size) {
Printf(" [%zu, %zu) '%s'\n", beg, beg + size, buf);
}
Printf("HINT: this may be a false positive if your program uses "
- "some custom stack unwind mechanism\n"
+ "some custom stack unwind mechanism or swapcontext\n"
" (longjmp and C++ exceptions *are* supported)\n");
DescribeThread(t->summary());
return true;
@@ -287,7 +287,9 @@ class ScopedInErrorReport {
// an error report will finish doing it.
SleepForSeconds(Max(100, flags()->sleep_before_dying + 1));
}
- Die();
+ // If we're still not dead for some reason, use raw Exit() instead of
+ // Die() to bypass any additional checks.
+ Exit(flags()->exitcode);
}
__asan_on_error();
reporting_thread_tid = asanThreadRegistry().GetCurrentTidOrInvalid();
@@ -320,7 +322,7 @@ class ScopedInErrorReport {
void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer crashed on unknown address %p"
+ Report("ERROR: AddressSanitizer: SEGV on unknown address %p"
" (pc %p sp %p bp %p T%d)\n",
(void*)addr, (void*)pc, (void*)sp, (void*)bp,
asanThreadRegistry().GetCurrentTidOrInvalid());
@@ -331,14 +333,14 @@ void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {
void ReportDoubleFree(uptr addr, StackTrace *stack) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer attempting double-free on %p:\n", addr);
+ Report("ERROR: AddressSanitizer: attempting double-free on %p:\n", addr);
PrintStack(stack);
DescribeHeapAddress(addr, 1);
}
void ReportFreeNotMalloced(uptr addr, StackTrace *stack) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer attempting free on address "
+ Report("ERROR: AddressSanitizer: attempting free on address "
"which was not malloc()-ed: %p\n", addr);
PrintStack(stack);
DescribeHeapAddress(addr, 1);
@@ -346,7 +348,7 @@ void ReportFreeNotMalloced(uptr addr, StackTrace *stack) {
void ReportMallocUsableSizeNotOwned(uptr addr, StackTrace *stack) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer attempting to call "
+ Report("ERROR: AddressSanitizer: attempting to call "
"malloc_usable_size() for pointer which is "
"not owned: %p\n", addr);
PrintStack(stack);
@@ -355,7 +357,7 @@ void ReportMallocUsableSizeNotOwned(uptr addr, StackTrace *stack) {
void ReportAsanGetAllocatedSizeNotOwned(uptr addr, StackTrace *stack) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer attempting to call "
+ Report("ERROR: AddressSanitizer: attempting to call "
"__asan_get_allocated_size() for pointer which is "
"not owned: %p\n", addr);
PrintStack(stack);
@@ -366,7 +368,7 @@ void ReportStringFunctionMemoryRangesOverlap(
const char *function, const char *offset1, uptr length1,
const char *offset2, uptr length2, StackTrace *stack) {
ScopedInErrorReport in_report;
- Report("ERROR: AddressSanitizer %s-param-overlap: "
+ Report("ERROR: AddressSanitizer: %s-param-overlap: "
"memory ranges [%p,%p) and [%p, %p) overlap\n", \
function, offset1, offset1 + length1, offset2, offset2 + length2);
PrintStack(stack);
@@ -459,7 +461,7 @@ void __asan_report_error(uptr pc, uptr bp, uptr sp,
}
}
- Report("ERROR: AddressSanitizer %s on address "
+ Report("ERROR: AddressSanitizer: %s on address "
"%p at pc 0x%zx bp 0x%zx sp 0x%zx\n",
bug_descr, (void*)addr, pc, bp, sp);