Commit dbd0df93 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

crash_keys: Convert "zombie" and "zombie_dealloc_bt" to the new API.

Bug: 598854
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: If8a541dbd650663d255c04b8bd70bbf0f8d8342e
Reviewed-on: https://chromium-review.googlesource.com/794541Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520622}
parent d37113b0
......@@ -157,8 +157,6 @@ size_t RegisterChromeCrashKeys() {
{mac::kSendAction, kMediumSize},
{mac::kNSEvent, kMediumSize},
{mac::kToolbarNibInfo, kMediumSize},
{mac::kZombie, kMediumSize},
{mac::kZombieTrace, kMediumSize},
// content/:
{"text-input-context-client", kMediumSize},
// media/:
......
......@@ -59,7 +59,6 @@ if (is_mac || is_ios) {
visibility = [ ":common" ]
sources = [
"crash_keys.h",
"objc_zombie.h",
"objc_zombie.mm",
]
......@@ -67,7 +66,7 @@ if (is_mac || is_ios) {
defines = [ "CRASH_CORE_COMMON_IMPLEMENTATION" ]
deps = [
":crash_key_utils",
":crash_key",
"//base",
]
......
......@@ -40,15 +40,6 @@ const char kVariations[] = "variations";
const char kSwitchFormat[] = "switch-%" PRIuS;
#if defined(OS_MACOSX)
namespace mac {
const char kZombie[] = "zombie";
const char kZombieTrace[] = "zombie_dealloc_bt";
} // namespace mac
#endif
void SetMetricsClientIdFromGUID(const std::string& metrics_client_guid) {
std::string stripped_guid(metrics_client_guid);
// Remove all instance of '-' char from the GUID. So BCD-WXY becomes BCDWXY.
......
......@@ -104,17 +104,6 @@ const size_t kSwitchesMaxCount = 15;
// at most |kSwitchesMaxCount| command line switches.
extern const char kSwitchFormat[];
#if defined(OS_MACOSX)
namespace mac {
// Records Cocoa zombie/used-after-freed objects that resulted in a
// deliberate crash.
extern const char kZombie[];
extern const char kZombieTrace[];
} // namespace mac
#endif
} // namespace crash_keys
#endif // COMPONENTS_CRASH_CORE_COMMON_CRASH_KEYS_H_
......@@ -12,14 +12,13 @@
#include <algorithm>
#include "base/debug/crash_logging.h"
#include "base/debug/stack_trace.h"
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_keys.h"
#include "components/crash/core/common/crash_key.h"
// Deallocated objects are re-classed as |CrZombie|. No superclass
// because then the class would have to override many/most of the
......@@ -207,12 +206,16 @@ void ZombieObjectCrash(id object, SEL aSelector, SEL viaSelector) {
}
// Set a value for breakpad to report.
base::debug::SetCrashKeyValue(crash_keys::mac::kZombie, aString);
static crash_reporter::CrashKeyString<256> zombie_key("zombie");
zombie_key.Set(aString);
// Encode trace into a breakpad key.
static crash_reporter::CrashKeyString<1024> zombie_trace_key(
"zombie_dealloc_bt");
if (found) {
base::debug::SetCrashKeyFromAddresses(
crash_keys::mac::kZombieTrace, record.trace, record.traceDepth);
crash_reporter::SetCrashKeyStringToStackTrace(
&zombie_trace_key,
base::debug::StackTrace(record.trace, record.traceDepth));
}
// Log -dealloc backtrace in debug builds then crash with a useful
......
......@@ -18,8 +18,6 @@ size_t RegisterChromeIOSCrashKeys() {
{crash_keys::kMetricsClientId, crash_keys::kSmallSize},
{crash_keys::kNumVariations, crash_keys::kSmallSize},
{crash_keys::kVariations, crash_keys::kHugeSize},
{crash_keys::mac::kZombie, crash_keys::kMediumSize},
{crash_keys::mac::kZombieTrace, crash_keys::kMediumSize},
};
return base::debug::InitCrashKeys(fixed_keys, arraysize(fixed_keys),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment