public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: David McFarland <corngood@gmail.com>
To: marco.atzeri@gmail.com
Cc: cygwin-developers@cygwin.com
Subject: Re: Re: Signal delivered while blocked
Date: Mon, 27 Dec 2021 19:14:49 -0400	[thread overview]
Message-ID: <vrit4k6ty712.fsf@gmail.com> (raw)
In-Reply-To: <2e5e006e-256d-17af-fbd5-2f38fce19b7c@gmail.com>


> Hi Guys,
> 
> Some time ago (2017) a Postgres developer reported a signal issue
> not present in older version (2013)
> 
> https://sourceware.org/pipermail/cygwin/2017-August/234001.html
> 
> For what I can see the issue is still present.
> 
> 
> Ideas for debugging ?

I had a look at your program. What seems to be happening is that he
signal thread receives the signal, and uses find_tls to find a thread to
handle it. If this is after a call to sigpermit(), then the mask will
be zero and it will commit to sending the signal to the main thread of
the test program.

This is done without any lock, so the main thread can now handle an
existing signal, call sigforbid() then usleep().

At this point the signal thread can resume, queuing up the next signal,
and the main thread will pick it up when usleep calls
sig_dispatch_pending, even though the main thread signal mask now
disallows it.

The old thread ended with a discussion about whether this is even valid
se of sigprocmask(), which didn't seem to be resolved. Anyone have any
thoughts on that?

  reply	other threads:[~2021-12-27 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27  4:51 Marco Atzeri
2021-12-27 23:14 ` David McFarland [this message]
2021-12-28  2:46   ` Marco Atzeri
2021-12-28 13:41   ` Z. Majeed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vrit4k6ty712.fsf@gmail.com \
    --to=corngood@gmail.com \
    --cc=cygwin-developers@cygwin.com \
    --cc=marco.atzeri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).