On Mon, 9 Jan 2023 18:13:26 +0100
Corinna Vinschen wrote:
> If q->sigtls is NULL, the signal is nevertheless waiting for being
> handled.  It's just not directed at a specific thread.  Beats me, why
> this didn't occur in my testing.  The process signal info should contain
> the process-wide mask of pending signals as well, obviously, so the
> following patch should do the right thing:
> 
> diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
> index ce36c8be37fb..86e4e607ab7e 100644
> --- a/winsup/cygwin/sigproc.cc
> +++ b/winsup/cygwin/sigproc.cc
> @@ -1375,7 +1375,8 @@ wait_sig (VOID *)
>           *pack.mask = 0;
>           while ((q = q->next))
>             {
> -             if (q->sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo)))
> +             _cygtls *sigtls = q->sigtls ?: _main_tls;
> +             if (sigtls->sigmask & (bit = SIGTOMASK (q->si.si_signo)))
>                 {
>                   tl_entry = cygheap->find_tls (q->si.si_signo, issig_wait);
>                   if (tl_entry)
> 
> Can you confirm?

I confirmed that your patch fixes the issue.

This issue can be easily reproduced in my environment by:
1) Open two mintty windows.
2) Run "while true; do procps; done" in one mintty.
3) Build cygwin1.dll in another window.
Build hangs in a short time and response of procps slows down.

-- 
Takashi Yano <takashi.y...@nifty.ne.jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to