Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,30 +844,26 @@ void LogMessageOnPrintf(const char *str) {

void LogFullErrorReport(const char *buffer) {
#if !SANITIZER_GO
// Log with os_trace. This will make it into the crash log.
#if SANITIZER_OS_TRACE
#pragma clang diagnostic push
// os_trace is deprecated.
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (GetMacosAlignedVersion() >= MacosVersion(10, 10)) {
// os_trace requires the message (format parameter) to be a string literal.
# if SANITIZER_OS_TRACE
// Log with os_log_error. This will make it into the crash log.
if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {
if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
sizeof("AddressSanitizer") - 1) == 0)
os_trace("Address Sanitizer reported a failure.");
os_log_error(OS_LOG_DEFAULT, "Address Sanitizer reported a failure.");
else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",
sizeof("UndefinedBehaviorSanitizer") - 1) == 0)
os_trace("Undefined Behavior Sanitizer reported a failure.");
os_log_error(OS_LOG_DEFAULT,
"Undefined Behavior Sanitizer reported a failure.");
else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",
sizeof("ThreadSanitizer") - 1) == 0)
os_trace("Thread Sanitizer reported a failure.");
os_log_error(OS_LOG_DEFAULT, "Thread Sanitizer reported a failure.");
else
os_trace("Sanitizer tool reported a failure.");
os_log_error(OS_LOG_DEFAULT, "Sanitizer tool reported a failure.");

if (common_flags()->log_to_syslog)
os_trace("Consult syslog for more information.");
os_log_error(OS_LOG_DEFAULT, "Consult syslog for more information.");
}
#pragma clang diagnostic pop
#endif
# endif // SANITIZER_OS_TRACE

// Log to syslog.
// The logging on OS X may call pthread_create so we need the threading
Expand Down