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

Benjamin Kramer benny.kra at gmail.com
Mon Jan 27 14:21:30 PST 2014


On 27.01.2014, at 22:56, Richard <legalize at xmission.com> wrote:

> 
> In article <CAAnoKN971ZHsDU-01s5pqbUK2qKNW=_rJy-t=u7ovDd7kOWFyg at mail.gmail.com>,
>    Tomasz Mikolajczyk <tmmikolajczyk at gmail.com> writes:
> 
>> 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.
> 
> How is this going to work on Windows where fork semantics really aren't
> supported?
> 
> I've used crash report generator mechanisms on both linux and Windows
> that didn't require forking oneself.

"forking" is a bit misleading. Clang spawns a new copy of itself, it doesn't
require fork semantics. The performance hit is probably a bit larger as
creating processes tends to be more expensive on windows but it still works
in exactly the same way as on unices.

- Ben





More information about the cfe-dev mailing list