public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: sigproc: Avoid segfault caused by signal just after fork().
@ 2022-05-06 18:47 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-05-06 18:47 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=aa9b5262f238d446260ec06d962f4c325a64dd89

commit aa9b5262f238d446260ec06d962f4c325a64dd89
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Thu May 5 21:12:26 2022 +0900

    Cygwin: sigproc: Avoid segfault caused by signal just after fork().
    
    - The commit "Cygwin: always add sigmask to child info" also tries
      to fix this issue, however, did not fix enough. This patch fixes
      that.

Diff:
---
 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);
 	    }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-06 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 18:47 [newlib-cygwin] Cygwin: sigproc: Avoid segfault caused by signal just after fork() Takashi Yano

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