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

Issue 1391453002: mac: Revise incorrect comments about EXC_RESOURCE and EXC_GUARD (Closed)

Created:
5 years, 2 months ago by Mark Mentovai
Modified:
5 years, 2 months ago
Reviewers:
Robert Sesek
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

mac: Revise incorrect comments about EXC_RESOURCE and EXC_GUARD launchd actually does set the EXC_RESOURCE and EXC_GUARD handlers exactly the same way that it sets the EXC_CRASH handler. See 10.9.5 launchd-842.92.1/src/core.c job_setup_exception_port(). Cases where an EXC_CRASH handler is set but EXC_RESOURCE and EXC_GUARD handlers are not set occur when the exception ports are set by /usr/bin/login instead of launchd. login looks up the exception-reporting service by name and sets the exception port without including EXC_MASK_RESOURCE or EXC_MASK_GUARD in the mask. See 10.10.5 system_cmds-643.30.1/login.tproj/login.c main(). login is a setuid executable, so it does not inherit its parent process’ exception handlers. See 10.10.5 xnu-2782.40.9/osfmk/kern/ipc_tt.c ipc_task_reset(). Terminal.app executes login when establishing its command-line environment, so the exception handlers set for Terminal.app itself (including EXC_MASK_CRASH, EXC_MASK_RESOURCE, and EXC_MASK_GUARD) are discarded, and then login sets an exception handler only for EXC_MASK_CRASH. The same thing occurs for any other process descended from login, including SSH sessions, because sshd executes login. This is a bug in login filed as Apple radar 22978644. This bug led to a misunderstanding about the use of EXC_RESOURCE and EXC_GUARD. Comments that discuss this behavior are now reworded to be accurate, and non-fatal EXC_RESOURCE exceptions are made eligible for forwarding to the user ReportCrash (because it would normally handle them in the absence of Crashpad) while Crashpad itself will still skip processing them. R=rsesek@chromium.org Committed: https://chromium.googlesource.com/crashpad/crashpad/+/ca2925e2a0c2c4191a6e6b75fa3580646a43afb9

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -22 lines) Patch
M handler/mac/crash_report_exception_handler.cc View 2 chunks +5 lines, -22 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Mark Mentovai
5 years, 2 months ago (2015-10-05 19:19:02 UTC) #2
Robert Sesek
LGTM. Confirmed login's behavior in 10.10.5/system_cmds-643.30.1/login.tproj/login.c
5 years, 2 months ago (2015-10-05 20:51:06 UTC) #3
Mark Mentovai
Updated the change description to reference the source instead of containing pseudo-source. Also updated to ...
5 years, 2 months ago (2015-10-05 21:03:55 UTC) #4
Mark Mentovai
5 years, 2 months ago (2015-10-05 21:09:50 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
ca2925e2a0c2c4191a6e6b75fa3580646a43afb9 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698