Bug 130923 - Uncaught NSExceptions should crash the web process
Summary: Uncaught NSExceptions should crash the web process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-28 17:34 PDT by Anders Carlsson
Modified: 2014-03-29 10:19 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.67 KB, patch)
2014-03-28 17:37 PDT, Anders Carlsson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2014-03-28 17:34:28 PDT
Uncatched NSExceptions should crash the web process
Comment 1 Radar WebKit Bug Importer 2014-03-28 17:35:04 PDT
<rdar://problem/16463751>
Comment 2 Anders Carlsson 2014-03-28 17:37:18 PDT
Created attachment 228101 [details]
Patch
Comment 3 mitz 2014-03-28 17:40:21 PDT
Comment on attachment 228101 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228101&action=review

> Source/WebKit2/ChangeLog:3
> +        Uncatched NSExceptions should crash the web process

Uncaught

> Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:191
> +    [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES }];

What is the behavior in the non-AppKit configuration? Does it already crash on exceptions? Can we make it crash on exceptions?
Comment 4 Anders Carlsson 2014-03-29 09:12:42 PDT
(In reply to comment #3)
> (From update of attachment 228101 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=228101&action=review
> 
> > Source/WebKit2/ChangeLog:3
> > +        Uncatched NSExceptions should crash the web process
> 
> Uncaught
> 
> > Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:191
> > +    [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES }];
> 
> What is the behavior in the non-AppKit configuration? Does it already crash on exceptions? Can we make it crash on exceptions?

I think we can use std::set_terminate to set the exception handler, but I'm not sure if it's possible to get the exception (or stack trace) from there.
Comment 5 Anders Carlsson 2014-03-29 09:15:08 PDT
Committed r166452: <http://trac.webkit.org/changeset/166452>
Comment 6 mitz 2014-03-29 10:19:42 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 228101 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=228101&action=review
> > 
> > > Source/WebKit2/ChangeLog:3
> > > +        Uncatched NSExceptions should crash the web process
> > 
> > Uncaught
> > 
> > > Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:191
> > > +    [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES }];
> > 
> > What is the behavior in the non-AppKit configuration? Does it already crash on exceptions? Can we make it crash on exceptions?
> 
> I think we can use std::set_terminate to set the exception handler, but I'm not sure if it's possible to get the exception (or stack trace) from there.

I was thinking along the lines of using NSSetUncaughtExceptionHandler().