posix_spawn: parent can get stuck in uninterruptible sleep if child receives SIGTSTP early enough

Florian Weimer fweimer@redhat.com
Tue Sep 13 10:04:10 GMT 2022


* Adhemerval Zanella Netto:

> On 22/08/22 15:21, Florian Weimer wrote:
>> * Adhemerval Zanella Netto via Libc-help:
>> 
>>> Right, my mistake.  I understood the issue better now, although I am
>>> still puzzled why SIGTSTP is only being triggered on sigprocmask (sing
>>> default action is still to stop PROCESS).
>> 
>> I think it's a maskable stop, not an unmaskable one, like SIGSTOP.
>
> Yeah, we do block the signal on parent (internal_signal_block_all). 
>
>> 
>> This looks a vfork-specific bug that can't happen with fork.  I don't
>> see how to fix it in a generic fashion because we can't unblock SIGTSTP
>> and launch the new process in an atomic fashion.
>
> We might ask for a new clone3 field to define the default signal mask on 
> process start (and thus omit the final sigprocmask before execve).

It might already possible to fix this using io_uring.  Unfortunately, I
didn't attend the LPC presentation.

Thanks,
Florian



More information about the Libc-help mailing list