summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:27:35 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 19:27:35 +0000
commit72c72c4785874f0c2dc0a097393c3130f6ceba4b (patch)
tree1a0de96638e732fa830ace04edae98a389145105 /chrome
parent0da011cfec84c36f706d991ac7e3a497b9a20e4a (diff)
downloadchromium_src-72c72c4785874f0c2dc0a097393c3130f6ceba4b.zip
chromium_src-72c72c4785874f0c2dc0a097393c3130f6ceba4b.tar.gz
chromium_src-72c72c4785874f0c2dc0a097393c3130f6ceba4b.tar.bz2
[Mac] Tighter restrictions on NSException raises.
On the crash server, almost all NSInvalidArgumentException cases are due to sending a bad selector to an object. Most likely cause is a stale pointer which has been reallocated to another object, or memory stompers. Also start tracking uncaught NSInternalInconsistencyException, which is the most popular exception on the crash servers. BUG=24462 TEST=none Review URL: http://codereview.chromium.org/6698002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_browser_application_mac.mm23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index 1786f91..4004766 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -76,6 +76,13 @@ static IMP gOriginalInitIMP = NULL;
}
}
+ // Mostly "unrecognized selector sent to (instance|class)". A
+ // very small number of things like nil being passed to an
+ // inappropriate receiver.
+ if (aName == NSInvalidArgumentException) {
+ fatal = YES;
+ }
+
// Dear reader: Something you just did provoked an NSException.
// NSException is implemented in terms of setjmp()/longjmp(),
// which does poor things when combined with C++ scoping
@@ -115,18 +122,26 @@ size_t BinForException(NSException* exception) {
// determine where they live in the histogram, so never move them
// around, only add to the end.
static NSString* const kKnownNSExceptionNames[] = {
- // ???
+ // Grab-bag exception, not very common. CFArray (or other
+ // container) mutated while being enumerated is one case seen in
+ // production.
NSGenericException,
- // Out-of-range on NSString or NSArray.
+ // Out-of-range on NSString or NSArray. Quite common.
NSRangeException,
- // Invalid arg to method, unrecognized selector.
+ // Invalid arg to method, unrecognized selector. Quite common.
NSInvalidArgumentException,
- // malloc() returned null in object creation, I think.
+ // malloc() returned null in object creation, I think. Turns out
+ // to be very uncommon in production, because of the OOM killer.
NSMallocException,
+ // This contains things like windowserver errors, trying to draw
+ // views which aren't in windows, unable to read nib files. By
+ // far the most common exception seen on the crash server.
+ NSInternalInconsistencyException,
+
nil
};