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

Yuri yuri at rawbw.com
Mon Jan 27 14:21:09 PST 2014

On 01/27/2014 13:41, Tomasz Mikolajczyk wrote:
> I haven't see the code but potentially the purpose of forking is to
> handle internal compiler errors, especially the case when the child
> process crashes when processing an input code. That may be easily
> detected and handled properly by the parent process, by collecting the
> trace, logs and by encouraging user to fill an issue in the bug DB,
> etc.

I don't see your point with catching compiler errors and crashes. Isn't 
this the caller responsibility? Normally, make does this very well. What 
else can other instance of clang report about the first one that 
crashed? All error messages should either be flushed immediately, or 
there is the chance they will be lost in unflushed buffers during crash.

I think this "guarding" should be made optional, based on some CFLAGS 
option or maybe some environment variable. This shouldn't happen during 
normal runs.


More information about the cfe-dev mailing list