From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: [PATCH] Cygwin: sigproc: Avoid segfault caused by signal just after fork().
Date: Sat, 7 May 2022 03:46:27 +0900 [thread overview]
Message-ID: <20220506184627.1650-1-takashi.yano@nifty.ne.jp> (raw)
- The commit "Cygwin: always add sigmask to child info" also tries
to fix this issue, however, did not fix enough. This patch fixes
that.
---
winsup/cygwin/sigproc.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 987dfea37..a70c3b6f6 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1356,9 +1356,9 @@ wait_sig (VOID *)
when _main_tls points to the system-allocated stack, not to
the parent thread. In that case find_tls fails, and we fetch
the sigmask from the child_info passed from the parent. */
- tl_entry = cygheap->find_tls (_main_tls);
- if (tl_entry)
+ if (cygwin_finished_initializing)
{
+ tl_entry = cygheap->find_tls (_main_tls);
dummy_mask = _main_tls->sigmask;
cygheap->unlock_tls (tl_entry);
}
--
2.36.0
reply other threads:[~2022-05-06 18:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220506184627.1650-1-takashi.yano@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-patches@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).