summaryrefslogtreecommitdiffstats
path: root/chrome/common/mac
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 18:07:12 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-18 18:07:12 +0000
commitc6aa6263aee292c2bd5d98f1cff1c5aceaec4f84 (patch)
tree73be55a6924128947c5c995f317abd0585032b7d /chrome/common/mac
parent4e0f45f5cc4911b529040c82058b255049426e93 (diff)
downloadchromium_src-c6aa6263aee292c2bd5d98f1cff1c5aceaec4f84.zip
chromium_src-c6aa6263aee292c2bd5d98f1cff1c5aceaec4f84.tar.gz
chromium_src-c6aa6263aee292c2bd5d98f1cff1c5aceaec4f84.tar.bz2
[Mac] Log stack trace for CHECK in bug 97285.
The hypothesis in comment #55 on the bug is that while setting up a new channel to an already-connected plugin, NPChannelBase::RemoveRoute() can be called on the earlier channel, so the renderer and plugin channel mappings get out of sync. This will add a Breakpad key encoding the top stack frames when RemoveRoute() is called within the scoped of WebPluginDelegateProxy::Initialize(). objc_zombies.mm already implemented the stackframe-encoding code, so I pulled that to a central location. That code can be left in place when the other code is removed after some traces are generated. BUG=97285 TEST=crash server. Review URL: https://chromiumcodereview.appspot.com/10408004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/mac')
-rw-r--r--chrome/common/mac/objc_zombie.mm18
1 files changed, 4 insertions, 14 deletions
diff --git a/chrome/common/mac/objc_zombie.mm b/chrome/common/mac/objc_zombie.mm
index e5d3a82..5ef00a6 100644
--- a/chrome/common/mac/objc_zombie.mm
+++ b/chrome/common/mac/objc_zombie.mm
@@ -290,21 +290,11 @@ void ZombieObjectCrash(id object, SEL aSelector, SEL viaSelector) {
// Set a value for breakpad to report.
base::mac::SetCrashKeyValue(@"zombie", aString);
- // Hex-encode the backtrace and tuck it into a breakpad key.
- NSString* deallocTrace = @"<unknown>";
- if (found && record.traceDepth) {
- NSMutableArray* hexBacktrace =
- [NSMutableArray arrayWithCapacity:record.traceDepth];
- for (size_t i = 0; i < record.traceDepth; ++i) {
- NSString* s = [NSString stringWithFormat:@"%p", record.trace[i]];
- [hexBacktrace addObject:s];
- }
- deallocTrace = [hexBacktrace componentsJoinedByString:@" "];
-
- // Warn someone if this exceeds the breakpad limits.
- DCHECK_LE(strlen([deallocTrace UTF8String]), 255U);
+ // Encode trace into a breakpad key.
+ if (found) {
+ base::mac::SetCrashKeyFromAddresses(
+ @"zombie_dealloc_bt", record.trace, record.traceDepth);
}
- base::mac::SetCrashKeyValue(@"zombie_dealloc_bt", deallocTrace);
// Log -dealloc backtrace in debug builds then crash with a useful
// stack trace.