Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Issue 2543813003: [Mac] Modify the ObjC exception preprocessor to make some exceptions fatal. (Closed)

Created:
4 years ago by Robert Sesek
Modified:
4 years ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews, mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -226 lines) Patch
M chrome/browser/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_application_mac.h View 1 chunk +0 lines, -15 lines 0 comments Download
M chrome/browser/chrome_browser_application_mac.mm View 1 3 chunks +10 lines, -108 lines 0 comments Download
D chrome/browser/chrome_browser_application_mac_unittest.mm View 1 chunk +0 lines, -94 lines 0 comments Download
A chrome/browser/mac/exception_processor.h View 1 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/mac/exception_processor.mm View 1 1 chunk +177 lines, -0 lines 0 comments Download
A + chrome/browser/mac/exception_processor_unittest.mm View 1 5 chunks +96 lines, -8 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (10 generated)
Robert Sesek
4 years ago (2016-12-01 02:24:10 UTC) #3
Mark Mentovai
Cool! Mostly minor comments. https://codereview.chromium.org/2543813003/diff/1/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): https://codereview.chromium.org/2543813003/diff/1/chrome/browser/chrome_browser_application_mac.mm#newcode241 chrome/browser/chrome_browser_application_mac.mm:241: rv = [super sendAction:anAction to:aTarget ...
4 years ago (2016-12-01 19:02:33 UTC) #4
Robert Sesek
https://codereview.chromium.org/2543813003/diff/1/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): https://codereview.chromium.org/2543813003/diff/1/chrome/browser/chrome_browser_application_mac.mm#newcode241 chrome/browser/chrome_browser_application_mac.mm:241: rv = [super sendAction:anAction to:aTarget from:sender]; On 2016/12/01 19:02:32, ...
4 years ago (2016-12-06 23:18:09 UTC) #6
Mark Mentovai
LGTM
4 years ago (2016-12-07 18:50:59 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2543813003/20001
4 years ago (2016-12-07 18:58:15 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-07 19:40:59 UTC) #15
commit-bot: I haz the power
4 years ago (2016-12-07 19:42:30 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/1e145dcb71a3bedf9fde398045cb8e54e244c3e3
Cr-Commit-Position: refs/heads/master@{#437033}

Powered by Google App Engine
This is Rietveld 408576698