[PATCH v3 2/2] posix: Use posix_spawn on system
Florian Weimer
fweimer@redhat.com
Fri Nov 30 15:21:00 GMT 2018
* Adhemerval Zanella:
> On 29/11/2018 15:37, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> +/* We have to and actually can handle cancelable system(). The big
>>> + problem: we have to kill the child process if necessary. To do
>>> + this a cleanup handler has to be registered and it has to be able
>>> + to find the PID of the child. The main problem is to reliable have
>>> + the PID when needed. It is not necessary for the parent thread to
>>> + return. It might still be in the kernel when the cancellation
>>> + request comes. Therefore we have to use the clone() calls ability
>>> + to have the kernel write the PID into the user-level variable. */
>>
>> This comment does not look relevant to me anymore.
>
> I think it still worth to mention glibc system aims to be thread-safe,
> which requires restore the signal dispositions for SIGINT and SIGQUIT
> correctly and to deal with cancellation by terminating the child process.
> +/* This system implementation aims to be thread-safe, which requires restore
> + the signal dispositions for SIGINT and SIGQUIT correctly and to deal with
> + cancellation by terminating the child process. */
I don't think you restore SIGINT and SIGQUIT correctly for concurrent
system calls. This is what the ADD_REF code in the old version
attempted to do.
Thnaks,
Florian
More information about the Libc-alpha
mailing list