From: Marco Atzeri <marco.atzeri@gmail.com>
To: David McFarland <corngood@gmail.com>
Cc: cygwin-developers@cygwin.com
Subject: Re: Signal delivered while blocked
Date: Tue, 28 Dec 2021 03:46:06 +0100 [thread overview]
Message-ID: <36f78776-bb14-7a55-3cd8-5ff54d89f6a0@gmail.com> (raw)
In-Reply-To: <vrit4k6ty712.fsf@gmail.com>
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)
>>
>> 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?
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,
https://www.postgresql.org/message-id/20170811021007.GB3623941%40rfd.leadboat.com
that also reported in 2017 on the Cygwin mailing list
and the discussion was recently revived on the Postgres dev list
https://www.postgresql.org/message-id/20210622064212.GA1367859@rfd.leadboat.com
Regards
Marco
next prev parent 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:
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=36f78776-bb14-7a55-3cd8-5ff54d89f6a0@gmail.com \
--to=marco.atzeri@gmail.com \
--cc=corngood@gmail.com \
--cc=cygwin-developers@cygwin.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).