[PATCH] D14470: [asan] Fix the deadlocks introduced by "On OS X, log reports to syslog and os_trace" commit

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 17:24:55 PST 2015


samsonov added inline comments.

================
Comment at: lib/asan/asan_report.cc:679
@@ -674,2 +678,3 @@
       BlockingMutexLock l(&error_message_buf_mutex);
-      LogFullErrorReport(error_message_buffer);
+      error_message_buffer_copy = internal_strdup(error_message_buffer);
+    }
----------------
Hm, I would actually prefer `InternalScopedString` here to avoid using internal allocator that late (and use the same mmap we use for error_message_buffer).

================
Comment at: lib/sanitizer_common/sanitizer_common.h:80
@@ +79,3 @@
+void *MmapOrDie(uptr size, const char *mem_type, bool raw_report = false);
+INLINE void *MmapOrDieQuietly(uptr size, const char *mem_type) {
+  return MmapOrDie(size, mem_type, /*raw_report*/ true);
----------------
Looks like it's not used.

================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:384
@@ -383,1 +383,3 @@
 void LogFullErrorReport(const char *buffer) {
+  if (!buffer)
+    return;
----------------
Wouldn't we die earlier if it's null? If it can be null, we probably don't need to invoke error_report_callback either.


http://reviews.llvm.org/D14470





More information about the llvm-commits mailing list