libiberty/pex-unix vfork abuse?

Andreas Schwab schwab@suse.de
Mon Dec 10 20:01:00 GMT 2007


"Dave Korn" <dave.korn@artimi.com> writes:

> On 07 December 2007 20:52, Andreas Schwab wrote:
>
>> "Dave Korn" <dave.korn@artimi.com> writes:
>> 
>>>   Perhaps we could work around this case by setting environ in the parent
>>> before the vfork call and restoring it afterward, but we'd need kind of
>>> serialisation there,
>> 
>> Do we?  vfork should block the parent until the child calls execve or
>> exit.
>
>   I don't see anything in posix that suggests that?

That is true, but technically it is rather difficult to implement a true
vfork without blocking the parent between vfork and exec/exit, since
that these are the only synchronisation points.

> I'm worrying in this case about races between multiple threads in the
> parent vfork'ing multiple children,

Typically in a multithreaded environment vfork is mapped to fork anyway.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc mailing list