public inbox for
 help / color / mirror / Atom feed
From: "Z. Majeed" <>
To: "" <>
Subject: Re: Signal delivered while blocked
Date: Tue, 28 Dec 2021 13:41:30 +0000 (UTC)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The discussion continued in

On Monday, December 27, 2021, 06:15:05 PM EST, 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?

      parent reply	other threads:[~2021-12-28 13:41 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
2021-12-28 13:41   ` Z. Majeed [this message]

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