qychen1982 / crashpad

Automatically exported from code.google.com/p/crashpad
0 stars 0 forks source link

Mac crashpad_handler: don’t block when forwarding exceptions #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the exception handler thread blocks while forwarding an exception to 
the system’s crash reporter. Sending an exception is a synchronous operation, 
and it only completes when the system’s crash reporter does. This can be 
time-consuming, and if the system’s crash reporter shows any UI, it’s 
dependent on user action.

This should be made to not block. Exceptions can be given to another thread 
that can run the blocking operation. When done, this other thread can respond 
to the original EXC_CRASH message sent by the kernel.

This isn’t a huge problem for Chrome right now, because forwarding isn’t 
done for anything but the browser process, and if the browser process crashes, 
everything else should exit anyway. However, it’s a problem in the design, 
and it may be a problem for other users of Crashpad.

Fixing the blocking by moving more of the handling to another thread will also 
enable crashpad_handler to optionally launch another program and block waiting 
for it before writing a dump. This other program (the “reporter”) can be 
used to show UI and provide further instructions to crashpad_handler. These 
instructions may override CrashpadInfo settings like the preference to handle 
the exception or upload the crash report, and may also contain new 
process-level annotations to be set in the crash report.

Original issue reported on code.google.com by mark@chromium.org on 26 Mar 2015 at 9:37