[compiler-rt] r312858 - [asan] Use more generic string in error message

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 22:58:52 PDT 2017


Author: vitalybuka
Date: Fri Sep  8 22:58:52 2017
New Revision: 312858

URL: http://llvm.org/viewvc/llvm-project?rev=312858&view=rev
Log:
[asan] Use more generic string in error message

Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis, alekseyshl

Subscribers: llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D37609

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

Modified: compiler-rt/trunk/lib/asan/asan_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_posix.cc?rev=312858&r1=312857&r2=312858&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_posix.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_posix.cc Fri Sep  8 22:58:52 2017
@@ -38,7 +38,9 @@ void AsanOnDeadlySignal(int signo, void
   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

Modified: compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc?rev=312858&r1=312857&r2=312858&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/allow_user_segv.cc Fri Sep  8 22:58:52 2017
@@ -71,17 +71,17 @@ int main() {
   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




More information about the llvm-commits mailing list