Catch `EXC_GUARD` exceptions on macOS
Categories
(Toolkit :: Crash Reporting, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: gsvelto, Assigned: gsvelto)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
We need to catch EXC_GUARD
exceptions on macOS as they cover a variety of conditions that can be thrown when accessing resources that have been protected via guards (see guarded.h in macOS sources, the APIs are undocumented but are at least partly self-explanatory).
The various types of guards and how the related information is encoded in the exception code field are documented in exc_guard.h.
To implement this we need to do the following:
- Add the
EXC_GUARD
exception to the list of exceptions we request to be notified of in the mac exception handler - Modify the mac minidump writer to account for these exception and store the code field correctly in the minidump
- Adjust the minidump processor to properly decode the exception code field and print out its contents
Once we'll have applied these changes to mozilla-central I'll need to file another bug to import them in Socorro's stack-walker.
Assignee | ||
Comment 1•3 years ago
|
||
Adding the related issue in rust-minidump
Assignee | ||
Comment 2•3 years ago
|
||
Besides adding EXC_GUARD to the list of exceptions the exception handler
listens to and modifying the minidump processor to interpret the exception
correctly this patch introduces a unit-test that crashes with an EXC_RESOURCE
exception.
Information about the exception itself is available here:
https://github.com/apple/darwin-xnu/blob/main/osfmk/kern/exc_guard.h
Additional flavors for the exception are documented here:
https://github.com/apple/darwin-xnu/osfmk/mach/port.h
https://github.com/apple/darwin-xnu/osfmk/mach/vm_statistics.h
Last but not least the undocumented API that generates these exceptions and
which we use in the unit-test was inferred from this header:
https://github.com/apple/darwin-xnu/blob/main/bsd/sys/guarded.h
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Backed out 3 changesets (Bug 1724368, Bug 1725154, Bug 1724388) for causing bustages in minidump_processor.cc
Backout link: https://hg.mozilla.org/integration/autoland/rev/35aecc2db94d6be53e02aa88f1d54575b1782bc5
Push with failures, failure log.
Comment 6•3 years ago
|
||
bugherder |
Description
•