crashpad icon indicating copy to clipboard operation
crashpad copied to clipboard

Crashpad cannot compatible with system exception monitor service on macOS platform

Open snilwx opened this issue 1 year ago • 2 comments

if I ues crashpad in my app, crashpad can normally generate .dmp file, but the system exception monitor service(com.apple.ReportCrash) cannot generate .ips file.

if I do not use crashpad in my app, the system exception monitor service(com.apple.ReportCrash) can normally generate .ips file.

You can view these .ips files in the console.app

snilwx avatar Mar 01 '24 03:03 snilwx

That seems to be the correct behavior. If you install a custom crash handler, it is considered that the crash has been handled.

KrzaQ avatar Mar 01 '24 11:03 KrzaQ

That seems to be the correct behavior. If you install a custom crash handler, it is considered that the crash has been handled.

I found the following code snippet in the crashpad's source code which is come from crashpad/handler/mac/crash_report_exception_handler.cc, how to understand it?

if (client_options.system_crash_reporter_forwarding != TriState::kDisabled && (exception == EXC_CRASH || exception == EXC_RESOURCE || exception == EXC_GUARD)) { // Don’t forward simulated exceptions such as kMachExceptionSimulated to the // system crash reporter. Only forward the types of exceptions that it would // receive under normal conditions. Although the system crash reporter is // able to deal with other exceptions including simulated ones, forwarding // them to the system crash reporter could present the system’s crash UI for // processes that haven’t actually crashed, and could result in reports not // actually associated with crashes being sent to the operating system // vendor. base::apple::ScopedMachSendRight system_crash_reporter_handler( SystemCrashReporterHandler()); if (system_crash_reporter_handler.get()) { ... }

the system crash reporter of macOS is "com.apple.ReportCrash" :

base::apple::ScopedMachSendRight SystemCrashReporterHandler() { return BootstrapLookUp("com.apple.ReportCrash"); }

snilwx avatar Mar 05 '24 02:03 snilwx