[PATCH] D13452: [asan] On OS X, log reports to syslog and os_trace (version 2)
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 6 17:11:49 PDT 2015
samsonov added a comment.
Looks reasonable to me. I'm kind of worried about the increased probability of deadlock inside runtime (e.g. if we decide to call AppendToErrorMessageBuffer when executing user-provided error report callback), but I don't see a good way to deal with this.
================
Comment at: lib/asan/asan_report.cc:34
@@ -33,2 +33,3 @@
static uptr error_message_buffer_size = 0;
+static BlockingMutex error_message_buf_mutex;
----------------
This should be error_message_buf_mutex(LINKER_INITIALIZED);
================
Comment at: lib/asan/asan_report.cc:674
@@ +673,3 @@
+ error_message_buf_mutex.Lock();
+ LogFullErrorReport(error_message_buffer);
+
----------------
You can just add a scope and BlockingMutexLock here.
================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:379
@@ +378,3 @@
+void LogFullErrorReport(const char *error_message_buffer) {
+ // Log with os_trace. This will make it into the crash log.
+ if (GetMacosVersion() >= MACOS_VERSION_MAVERICKS) {
----------------
const char *kNameMapping[][2] = {
{"AddressSanitizer", "Address Sanitizer"},
{"ThreadSanitizer", "Thread Sanitizer"},
...
};
and then a loop, would probably reduce duplication. Also, add some kind of comment about why you want space.
http://reviews.llvm.org/D13452
More information about the llvm-commits
mailing list