[PATCH] D37609: [asan] Use more generic string in error message

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 23:00:18 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL312858: [asan] Use more generic string in error message (authored by vitalybuka).

Changed prior to commit:
  https://reviews.llvm.org/D37609?vs=114297&id=114471#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D37609

Files:
  compiler-rt/trunk/lib/asan/asan_posix.cc
  compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc


Index: compiler-rt/trunk/lib/asan/asan_posix.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_posix.cc
+++ compiler-rt/trunk/lib/asan/asan_posix.cc
@@ -38,7 +38,9 @@
   int code = (int)((siginfo_t*)siginfo)->si_code;
   // Write the first message using fd=2, just in case.
   // It may actually fail to write in case stderr is closed.
-  internal_write(2, "ASAN:DEADLYSIGNAL\n", 18);
+  internal_write(2, SanitizerToolName, internal_strlen(SanitizerToolName));
+  static const char kDeadlySignal[] = ":DEADLYSIGNAL\n";
+  internal_write(2, kDeadlySignal, sizeof(kDeadlySignal) - 1);
   SignalContext sig = SignalContext::Create(siginfo, context);
 
   // Access at a reasonable offset above SP, or slightly below it (to account
Index: compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc
+++ compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc
@@ -71,17 +71,17 @@
   return DoSEGV();
 }
 
-// CHECK0-NOT: ASAN:DEADLYSIGNAL
+// CHECK0-NOT: AddressSanitizer:DEADLYSIGNAL
 // CHECK0-NOT: AddressSanitizer: SEGV on unknown address
 // CHECK0: User sigaction installed
 // CHECK0-NEXT: User sigaction called
 
 // CHECK1: User sigaction installed
 // CHECK1-NEXT: User sigaction called
-// CHECK1-NEXT: ASAN:DEADLYSIGNAL
+// CHECK1-NEXT: AddressSanitizer:DEADLYSIGNAL
 // CHECK1: AddressSanitizer: SEGV on unknown address
 
 // CHECK2-NOT: User sigaction called
 // CHECK2: User sigaction installed
-// CHECK2-NEXT: ASAN:DEADLYSIGNAL
+// CHECK2-NEXT: AddressSanitizer:DEADLYSIGNAL
 // CHECK2: AddressSanitizer: SEGV on unknown address


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37609.114471.patch
Type: text/x-patch
Size: 1744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170909/386e72ce/attachment.bin>


More information about the llvm-commits mailing list