[PATCH] Cygwin: signa: Redesign signal queue handling

Christian Franke Christian.Franke@t-online.de
Sun Mar 9 12:28:26 GMT 2025


Takashi Yano wrote:
> ...
> With this patch prevents all signals from that issues by redesigning
> the signal queue, Only the exception is the case that the process is
> in the PID_STOPPED state. In this case, SIGCONT/SIGKILL should be
> processed prior to the other signals in the queue.
>
> Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257582.html
> Fixes: 7ac6173643b1 ("(pending_signals): New class.")
> Reported by: Christian Franke <Christian.Franke@t-online.de>
> Reviewed-by:
> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
> ...
>   void
>   pending_signals::add (sigpacket& pack)
>   {
> ...
> +  if (q->si.si_signo == pack.si.si_signo)
> +    q->usecount++;
> ...
>

This should possibly also compare the si.si_sigval fields. Otherwise 
values would be lost if the same real-time signal is issued multiple 
times with different value parameters.

The queuing might also be incorrect for real-time signals. Linux 
signal(7) says:
"If different real-time signals are sent to a process, they are 
delivered starting with the lowest-numbered signal."

-- 
Regards,
Christian



More information about the Cygwin-patches mailing list