[scudo] Add some logs for Android
authorKostya Kortchinsky <kostyak@google.com>
Fri, 6 Jul 2018 16:50:12 +0000 (16:50 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Fri, 6 Jul 2018 16:50:12 +0000 (16:50 +0000)
Summary:
Namely, set the abort message, and allow to write the message to syslog if the
option is enabled.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: delcypher, #sanitizers, llvm-commits

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

llvm-svn: 336445

compiler-rt/lib/scudo/scudo_utils.cpp

index 42c6260..d5788d2 100644 (file)
@@ -50,6 +50,9 @@ FORMAT(1, 2) void NORETURN dieWithMessage(const char *Format, ...) {
   internal_memcpy(Message, ScudoError, PrefixSize);
   VSNPrintf(Message + PrefixSize, sizeof(Message) - PrefixSize, Format, Args);
   va_end(Args);
+  LogMessageOnPrintf(Message);
+  if (common_flags()->abort_on_error)
+    SetAbortMessage(Message);
   RawWrite(Message);
   Die();
 }