forked from OSchip/llvm-project
[asan] change the asan output slightly to avoid user confusion: a) add ':' after 'AddressSanitizer' and b) changed 'crashed' to 'SEGV'
llvm-svn: 165932
This commit is contained in:
parent
49c8eea3c0
commit
16205cd4fa
|
@ -322,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());
|
||||
|
@ -333,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);
|
||||
|
@ -348,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);
|
||||
|
@ -357,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);
|
||||
|
@ -368,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);
|
||||
|
@ -461,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);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
extern int y;
|
||||
int __attribute__((noinline)) initX() {
|
||||
return y + 1;
|
||||
// CHECK: {{AddressSanitizer initialization-order-fiasco}}
|
||||
// CHECK: {{AddressSanitizer: initialization-order-fiasco}}
|
||||
// CHECK: {{READ of size .* at 0x.* thread T0}}
|
||||
// CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cc:22}}
|
||||
// CHECK: {{0x.* is located 0 bytes inside of global variable .*y.*}}
|
||||
|
|
|
@ -29,7 +29,7 @@ int main() {
|
|||
// deep_free(x);
|
||||
DeepFree<200>::free(x);
|
||||
return x[5];
|
||||
// CHECK: {{.*ERROR: AddressSanitizer heap-use-after-free on address}}
|
||||
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
|
||||
// CHECK: DeepFree<36>
|
||||
// CHECK: DeepFree<98>
|
||||
// CHECK: DeepFree<115>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
|
||||
// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
|
||||
|
||||
// CHECK: AddressSanitizer global-buffer-overflow
|
||||
// CHECK: AddressSanitizer: global-buffer-overflow
|
||||
int global[10];
|
||||
// CHECK: {{#0.*call4}}
|
||||
void __attribute__((noinline)) call4(int i) { global[i+10]++; }
|
||||
|
|
|
@ -49,7 +49,7 @@ int main(int argc, char *argv[]) {
|
|||
return (x != 0);
|
||||
}
|
||||
|
||||
// CHECK: AddressSanitizer heap-use-after-free
|
||||
// CHECK: AddressSanitizer: heap-use-after-free
|
||||
// CHECK: WRITE of size 4 at 0x{{.*}} thread T[[ACCESS_THREAD:[0-9]+]]
|
||||
// CHECK: freed by thread T[[FREE_THREAD:[0-9]+]] here:
|
||||
// CHECK: previously allocated by thread T[[ALLOC_THREAD:[0-9]+]] here:
|
||||
|
|
|
@ -30,7 +30,7 @@ int z = initZ();
|
|||
extern int y;
|
||||
int __attribute__((noinline)) initX() {
|
||||
return y + 1;
|
||||
// CHECK: {{AddressSanitizer initialization-order-fiasco}}
|
||||
// CHECK: {{AddressSanitizer: initialization-order-fiasco}}
|
||||
// CHECK: {{READ of size .* at 0x.* thread T0}}
|
||||
// CHECK: {{0x.* is located 0 bytes inside of global variable .*(y|z).*}}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ int main(int argc, char **argv) {
|
|||
delete x;
|
||||
}
|
||||
|
||||
// CHECK: {{.*ERROR: AddressSanitizer heap-buffer-overflow on address}}
|
||||
// CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
|
||||
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
|
||||
// CHECK: {{READ of size 4 at 0x.* thread T0}}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char **argv) {
|
|||
char a1[] = {argc, 2, 3, 4};
|
||||
char a2[] = {1, 2*argc, 3, 4};
|
||||
int res = memcmp(a1, a2, 4 + argc); // BOOM
|
||||
// CHECK: AddressSanitizer stack-buffer-overflow
|
||||
// CHECK: AddressSanitizer: stack-buffer-overflow
|
||||
// CHECK: {{#0.*memcmp}}
|
||||
// CHECK: {{#1.*main}}
|
||||
return res;
|
||||
|
|
|
@ -23,7 +23,7 @@ int main() {
|
|||
NullDeref((int*)0);
|
||||
}
|
||||
|
||||
// CHECK: {{.*ERROR: AddressSanitizer crashed on unknown address}}
|
||||
// CHECK: ERROR: AddressSanitizer: SEGV on unknown address
|
||||
// CHECK: {{0x0*00028 .*pc 0x.*}}
|
||||
// CHECK: {{AddressSanitizer can not provide additional info.}}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {
|
|||
printf("ok\n");
|
||||
inc(1);
|
||||
inc(-1); // BOOM
|
||||
// CHECK: {{.*ERROR: AddressSanitizer global-buffer-overflow}}
|
||||
// CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}}
|
||||
// CHECK: {{READ of size 4 at 0x.* thread T0}}
|
||||
// CHECK: {{ #0 0x.*}}
|
||||
// CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:48}}
|
||||
|
|
|
@ -20,7 +20,7 @@ int main() {
|
|||
char *x = (char*)malloc(10 * sizeof(char));
|
||||
free(x);
|
||||
return x[5];
|
||||
// CHECK: {{.*ERROR: AddressSanitizer heap-use-after-free on address}}
|
||||
// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
|
||||
// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
|
||||
// CHECK: {{READ of size 1 at 0x.* thread T0}}
|
||||
// CHECK: {{ #0 0x.* in _?main .*use-after-free.cc:22}}
|
||||
|
|
Loading…
Reference in New Issue