[PATCH] D24781: [ubsan] Respect log_to_syslog=1 on Darwin

Anna Zaks via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 15:43:05 PDT 2016


zaks.anna added a comment.

> Or, should I just introduce Mac-specific logic to remove color codes in the PrintToLog function introduced by this patch?


1. Do you want to log UBSan errors into CrashLog? If so, how will you accomplish that?
2. I've tried adding the logging into every Printf, but it does not work for ASan and TSan, see the following comment in r253688. This may or may not apply to UBSan. Another smaller concern is that using different logging strategies is not consistent.

" I've initially tried to log to syslog during printing, which is done on Android

  right now. The advantage is that if we crash during error reporting or the
  produced error does not go through ScopedInErrorReport, we would still get a
  (partial) message in the syslog. However, that solution is very problematic on
  OS X. One issue is that the logging routine uses GCD, which may spawn a new
  thread on its behalf. In many cases, the reporting logic locks threadRegistry,
  which leads to deadlocks.

"

> Should I modify LogMessageOnPrintf on Mac platforms so that it prints to syslog when common_flags()->abort_on_error isn't set?


This might not work because of the problem described above.

What we do instead is record all the info into a buffer that will be used for CrashReporting and log that to syslog before the process ends.


https://reviews.llvm.org/D24781





More information about the llvm-commits mailing list