Closed Bug 1724928 Opened 3 years ago Closed 3 years ago

Catch `EXC_CRASH` exceptions on macOS

Categories

(Toolkit :: Crash Reporting, enhancement)

All
macOS
enhancement

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: gsvelto, Assigned: gsvelto)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

EXC_CRASH exceptions are catch-all exceptions thrown in response to signals, other uncaught exceptions or any other condition that would cause a process to crash. The original exception subcode is kept along but the main exception code contains a mish-mash of the signal, original exception and original exception code. See here for how this is encoded.

To implement this we need to do the following:

  • Add the EXC_CRASH exception to the list of exceptions we request to be notified of in the mac exception handler
  • 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.

EXC_CRASH exceptions wrap some of the other exceptions under certain
conditions. They are delivered to the exception handler when the wrapped
exception has not been caught by a previous handler. They carry no data
of their own but pack the data of the original exception instead, see:

https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/kern/kern_exit.c#L1056-L1066

We match Crashpad behavior to not store these exceptions directly in the
minidump but rather unpack the original exception and store it instead.
Because of that I haven't added functionality to print them out.

Additionally it seems that they can also wrap uncaught signals and deliver
those instead of a mach exception. While extracting the original signal is
a trivial operation I was unable to actually generate one in the first
place. As such I've added no specific functionality to deal with those either.
This also matches crashpad behavior.

Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4ffa68b4d1b2 Catch EXC_CRASH exceptions on macOS r=KrisWright
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: