[PATCH] posix: Fix improper assert in Linux posix_spawn (BZ#22273)

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Oct 17 13:42:00 GMT 2017



On 12/10/2017 15:49, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> As suggested by Andreas Schwab, this patch removes the faulty assert
>> and also handles any signal that happens before fork and execve as the
>> spawn was successful (and thus relaying the handling to the caller to
>> figure this out).  Different than Florian, I can not see why using
>> atomics to set err would help here, essentially the code runs
>> sequentially (due CLONE_VFORK) and I think it would not be legal the
>> compiler evaluate ec without checking for new_pid result (thus there
>> is no need to compiler barrier).
> 
> I thought you'd need to guard against reordering in the child.  Since
> the err member is the only thing that is written and the syscalls in
> the child act as compiler barriers (so that the store cannot float to
> the beginning of the function), this is not actually an issue here.
> 

Right, so are you ok with the patch proposed?



More information about the Libc-alpha mailing list