[cfe-dev] Why clang needs to fork into itself?

Yuri yuri at rawbw.com
Tue Jan 28 21:47:29 PST 2014

Actually clang doesn't need fork for error reporting at all. The process 
can live on without problems even after the crash.
Here is what clang should do:
1. From the signal handler: change the IP register to the crash handling 
procedure and set up the new stack. Also discard the signal, so the run 
can continue
2. Crash handling procedure would proceed safely, as long as it doesn't 
do memory allocation, and doesn't make any stateful calls (like fwrite).

This would produce the same report as the current procedure does, 
without the downsides of fork.


More information about the cfe-dev mailing list