summaryrefslogtreecommitdiffstats
path: root/chrome/common/mac
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-12 03:10:26 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-12 03:11:41 +0000
commit7a3b60af073aec7b2558adf8ab092eb1a084d0d5 (patch)
tree2daf3488a880c83845f918d4ff045a5c7422f42c /chrome/common/mac
parent47e0b38eb95db3081b970e90f219a164d87b6940 (diff)
downloadchromium_src-7a3b60af073aec7b2558adf8ab092eb1a084d0d5.zip
chromium_src-7a3b60af073aec7b2558adf8ab092eb1a084d0d5.tar.gz
chromium_src-7a3b60af073aec7b2558adf8ab092eb1a084d0d5.tar.bz2
Upgrade a DLOG(INFO) and remove an fprintf in objc_zombie.mm
These cause unrelated changes to the file to fail presubmit checks. The INFO becomes a WARNING. It immediately precedes a DLOG(FATAL), so isn't really spamming. The fprintf becomes ::write(..). It precedes a base::debug::StackTrace(..).Print(), which is async-signal safe, so use use an async-signal safe function beforehand. This is probably overly paranoid but I'm surrounded by zombies and they scare me. BUG=None Review URL: https://codereview.chromium.org/443563002 Cr-Commit-Position: refs/heads/master@{#288888} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/mac')
-rw-r--r--chrome/common/mac/objc_zombie.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/common/mac/objc_zombie.mm b/chrome/common/mac/objc_zombie.mm
index ab62cae..d0cb063 100644
--- a/chrome/common/mac/objc_zombie.mm
+++ b/chrome/common/mac/objc_zombie.mm
@@ -15,6 +15,7 @@
#include "base/debug/stack_trace.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "chrome/common/crash_keys.h"
@@ -174,7 +175,9 @@ BOOL GetZombieRecord(id object, ZombieRecord* record) {
// Dump the symbols. This is pulled out into a function to make it
// easy to use DCHECK to dump only in debug builds.
BOOL DumpDeallocTrace(const void* const* array, int size) {
- fprintf(stderr, "Backtrace from -dealloc:\n");
+ // Async-signal safe version of fputs, consistent with StackTrace::Print().
+ const char* message = "Backtrace from -dealloc:\n";
+ ignore_result(HANDLE_EINTR(write(STDERR_FILENO, message, strlen(message))));
base::debug::StackTrace(array, size).Print();
return YES;
@@ -220,7 +223,7 @@ void ZombieObjectCrash(id object, SEL aSelector, SEL viaSelector) {
if (found && record.traceDepth) {
DCHECK(DumpDeallocTrace(record.trace, record.traceDepth));
} else {
- DLOG(INFO) << "Unable to generate backtrace from -dealloc.";
+ DLOG(WARNING) << "Unable to generate backtrace from -dealloc.";
}
DLOG(FATAL) << aString;