diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 23:33:22 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 23:33:22 +0000 |
commit | 06723efffc8fcc8dcc20f0a69ba792a2cc62fe9d (patch) | |
tree | 019ec57781dce6bdac102566f07994dadfd772ab /base/process_util_mac.mm | |
parent | 46bf67929f10423b3bb5d9ea8d1305fb2094b99e (diff) | |
download | chromium_src-06723efffc8fcc8dcc20f0a69ba792a2cc62fe9d.zip chromium_src-06723efffc8fcc8dcc20f0a69ba792a2cc62fe9d.tar.gz chromium_src-06723efffc8fcc8dcc20f0a69ba792a2cc62fe9d.tar.bz2 |
[Mac] Don't override malloc_error_break twice.
Doing so leaves g_original_malloc_error_break pointing at
CrMallocErrorBreak(), and hijinks ensues.
BUG=165168
Review URL: https://chromiumcodereview.appspot.com/11524002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_mac.mm')
-rw-r--r-- | base/process_util_mac.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index 373d4cf..cf1e7a8 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -635,16 +635,18 @@ void EnableTerminationOnHeapCorruption() { // by AddressSanitizer. return; #endif + + // Only override once, otherwise CrMallocErrorBreak() will recurse + // to itself. + if (g_original_malloc_error_break) + return; + malloc_error_break_t malloc_error_break = LookUpMallocErrorBreak(); if (!malloc_error_break) { DLOG(WARNING) << "Could not find malloc_error_break"; return; } - // Warm this up so that it doesn't require allocation when - // |CrMallocErrorBreak()| calls it. - ignore_result(g_unchecked_malloc.Get().Get()); - mach_error_t err = mach_override_ptr( (void*)malloc_error_break, (void*)&CrMallocErrorBreak, |