public inbox for
 help / color / mirror / Atom feed
From: Marco Atzeri <>
To: David McFarland <>
Subject: Re: Signal delivered while blocked
Date: Tue, 28 Dec 2021 03:46:06 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 28.12.2021 00:14, David McFarland wrote:
>> Hi Guys,
>> Some time ago (2017) a Postgres developer reported a signal issue
>> not present in older version (2013)
>> 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?

Thanks David,

I am not an expert in signal, but it seems the program is working as 
expected on Linux and other platforms and only cygwin is presenting it.
I have not anymore a Linux box so I can not check.

The test case is not mine, it is coming from Noah Misch,
that also reported in 2017 on the Cygwin mailing list

and the discussion was recently revived on the Postgres dev list


  reply	other threads:[~2021-12-28  2:46 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
2021-12-28  2:46   ` Marco Atzeri [this message]
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:

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

  git send-email \ \ \ \ \

* 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).