public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin@cygwin.com
Subject: Re: Cygwin 3.4.3 and 3.5.0... hangs in make, top, procps, ls /proc/PID/...
Date: Mon, 2 Jan 2023 17:21:47 +0900	[thread overview]
Message-ID: <20230102172147.83789d400bb0400cb8c8ca74@nifty.ne.jp> (raw)
In-Reply-To: <20230102143803.53f89d07a545a1bdd596e1e8@nifty.ne.jp>

On Mon, 2 Jan 2023 14:38:03 +0900
Takashi Yano wrote:
> On Mon, 2 Jan 2023 11:32:01 +0900
> Takashi Yano wrote:
> > On Sat, 31 Dec 2022 13:01:29 -0700
> > Brian Inglis wrote:
> > > was also getting the messages below locally and still on GitHub scallywag:
> > > 
> > > 	cygcheck (6936) child_copy: cygheap read copy failed,
> > > 
> > > ../curl/scallywag/1_x86_64  build.log:2022-12-26T00:39:35.6163236Z       0 
> > > [main] cygcheck (6936) child_copy: cygheap read copy failed, 0x0..0x80003B5F0, 
> > > done 0, windows pid 6936, Win32 error 299
> > > ../curl/scallywag/1_x86_64  build.log:2022-12-26T00:48:03.4525278Z       0 
> > > [main] cygcheck (568) child_copy: cygheap read copy failed, 0x0..0x80003BA48, 
> > > done 0, windows pid 568, Win32 error 299
> > > ../dialog/scallywag/1_x86_64  build.log:2022-12-31T18:42:37.0939902Z       0 
> > > [main] cygcheck (6992) child_copy: cygheap read copy failed, 0x0..0x80003CB38, 
> > > done 0, windows pid 6992, Win32 error 299
> > 
> > I guess this is another problem.
> 
> I found this issue occurs after the commit 30add3e6b3e3:
> "Cygwin: exec: don't access cygheap before it's initialized"
> .
> 
> Reverting this commit solves the issue.
> 
> To reproduce the problem relatively frequently, try:
> while true; do cygcheck -cd cygwin > /dev/null; done
> in bash.
> 
> Corinna, could you please have a look at this issue as well?

I'm not sure if this is the right thing, but the following
patch seems to fix the issue.

diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 5c5a280cc..49b7a44ae 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -631,8 +631,6 @@ child_info_spawn::handle_spawn ()
   if (!dynamically_loaded || get_parent_handle ())
       {
 	cygheap_fixup_in_child (true);
-	if (dynamically_loaded)
-	  moreinfo->myself_pinfo = NULL;
 	memory_init ();
       }
 
diff --git a/winsup/cygwin/mm/cygheap.cc b/winsup/cygwin/mm/cygheap.cc
index 72861d8d7..6a20c159a 100644
--- a/winsup/cygwin/mm/cygheap.cc
+++ b/winsup/cygwin/mm/cygheap.cc
@@ -95,6 +95,8 @@ cygheap_fixup_in_child (bool execed)
   cygheap = (init_cygheap *) VirtualAlloc ((LPVOID) CYGHEAP_STORAGE_LOW,
 					   commit_size, MEM_COMMIT,
 					   PAGE_READWRITE);
+  if (dynamically_loaded && execed)
+    spawn_info->moreinfo->myself_pinfo = NULL;
   cygheap_max = child_proc_info->cygheap_max;
   child_copy (child_proc_info->parent, false, child_proc_info->silentfail (),
 	      "cygheap", cygheap, cygheap_max, NULL);


-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

  reply	other threads:[~2023-01-02  8:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30  4:59 Brian Inglis
2023-01-02  2:32 ` Takashi Yano
2023-01-02  5:38   ` Takashi Yano
2023-01-02  8:21     ` Takashi Yano [this message]
2023-01-09 13:20       ` Corinna Vinschen
2023-01-16  9:02         ` Takashi Yano
2023-01-16 10:23           ` Corinna Vinschen
2023-01-16 14:45             ` Takashi Yano
2023-01-16 15:18               ` Corinna Vinschen
2023-01-16 19:23                 ` Brian Inglis
2023-01-16 21:42                 ` Corinna Vinschen
2023-01-17 20:46                   ` Corinna Vinschen
2023-01-18  9:16                     ` Takashi Yano
2023-01-18  9:42                       ` Corinna Vinschen
2023-01-19 16:31                         ` Brian Inglis
2023-01-19 17:12                           ` Brian Inglis
2023-01-19 18:38                           ` Corinna Vinschen
2023-01-19 18:42                             ` Jose Isaias Cabrera
2023-01-19 19:31                             ` Brian Inglis
2023-03-21 19:17                               ` Brian Inglis
2023-03-22 19:05                                 ` Brian Inglis
2023-01-02 23:03   ` Takashi Yano
2023-01-09 16:02     ` Corinna Vinschen
2023-01-09 17:13   ` Corinna Vinschen
2023-01-10 10:01     ` Takashi Yano
2023-01-10 10:57       ` Corinna Vinschen
2023-01-09 13:36 ` Corinna Vinschen
2023-01-10  0:00   ` Brian Inglis
2023-01-16 15:40     ` Jon Turney
2023-01-16 18:54       ` Brian Inglis
2022-12-31 20:01 Brian Inglis
2023-01-01 18:51 ` Jeremy Drake

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=20230102172147.83789d400bb0400cb8c8ca74@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin@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).