Description[Mac] Modify the ObjC exception preprocessor to make some exceptions fatal.
Various Cocoa routines in the event loop obscure exception stack traces
by catching-and-rethrowing exceptions, so that the original trace from
throwing the exception is lost.
To combat this, the ObjC exception preprocessor will now unwind the stack to
search for an exception handler. If it finds a stack frame with a handler, it
will check that the function's name is not on the sinkhole list. If it is on the
list, the preprocessor will make the exception fatal to produce a stack trace
from the point of throw. If it is not on the list, then the preprocessor will
not take action and will let the normal exception handling mechanism run.
The preprocessor works in conjunction with the base::mac::CallWithEHFrame
system. The preprocessor is only called for exceptions raised with objc_throw,
which C++ exceptions are not. Furthermore, some of the system routines that do
the catch-and-rethrow are higher on the stack than CallWithEHFrame, so it
cannot force those exceptions to be fatal at the point of throw.
This change also wraps -[BrowserCrApplication sendAction:to:from:] in
CallWithEHFrame().
BUG=637270
R=mark@chromium.org
Committed: https://crrev.com/1e145dcb71a3bedf9fde398045cb8e54e244c3e3
Cr-Commit-Position: refs/heads/master@{#437033}
Patch Set 1 #
Total comments: 31
Patch Set 2 : Address comments #
Messages
Total messages: 17 (10 generated)
|