[PATCH] D15396: [sanitizers] Log all output to CrashReport on OS X

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 05:47:37 PST 2015


kubabrecka added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_mac.h:49
@@ -50,1 +48,3 @@
+INLINE void CRAppendCrashLogMessage(const char *msg) {
+  internal_strlcat(__crashreporter_info_buff__, msg,
                    sizeof(__crashreporter_info_buff__)); }
----------------
Don't we need a lock here?  Can we optimize the strcat here (by remembering the position where to append)?

Or maybe we could unify this completely with AppendToErrorMessageBuffer (in asan_report.cc), which basically does the same thing.  We could only have a single buffer to log into.

================
Comment at: lib/sanitizer_common/sanitizer_printf.cc:283
@@ -283,1 +282,3 @@
+  // Remove color sequences from the message.
+  RemoveANSIEscapeSequencesFromString(buffer);
   CallPrintfAndReportCallback(buffer);
----------------
This means that CallPrintfAndReportCallback is now called on a color-less string.  I'm actually in favor of this change, but we should make sure everyone's okay with it.


http://reviews.llvm.org/D15396





More information about the llvm-commits mailing list