X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F97F385841D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1673882321;
	bh=nSdzu56Kf4RUAFuHer2NtjijyRlJq9n387g4LV2mdYs=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=txvoVwBXZsa1eC6BGDrQJi5NWrqctmk1FGka0NtNoSYrSWzb5oBGr/Q2T4FtMX8CD
	 0vUP+LJZZx/VoxSmlvL0ce/9rl46Uezw8S04ufQHBwJfx2pTym4HpoKxjS8DZ3qmkF
	 gD6uP21ngXLpe+wBNm3rg5m6N6hBr5x/pFoCw12o=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
Date: Mon, 16 Jan 2023 16:18:22 +0100
To: cygwin@cygwin.com
Subject: Re: Cygwin 3.4.3 and 3.5.0... hangs in make, top, procps, ls
 /proc/PID/...
Message-ID: <Y8VqvgP8rA5SX/Or@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <4a4427cc-422b-1d14-015e-26523e620d9b@Shaw.ca>
 <20230102113201.476c10bef7a5643bddc00762@nifty.ne.jp>
 <20230102143803.53f89d07a545a1bdd596e1e8@nifty.ne.jp>
 <20230102172147.83789d400bb0400cb8c8ca74@nifty.ne.jp>
 <Y7wUuNUbXBANLdIA@calimero.vinschen.de>
 <20230116180213.0e03a896f512d784933f54da@nifty.ne.jp>
 <Y8Ulug5IS7IGc15w@calimero.vinschen.de>
 <20230116234532.f567e64fe7bf9a0a13704af9@nifty.ne.jp>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20230116234532.f567e64fe7bf9a0a13704af9@nifty.ne.jp>
X-Provags-ID: V03:K1:EemwGKPeF9/j1vYy7AVWrWQhvN1Vx1WDhnDWfLIn96maDQuFsQu
 H0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PF_FAIL, SPF_HELO_NONE,
 TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

Hi Takashi,

On Jan 16 23:45, Takashi Yano via Cygwin wrote:
> On Mon, 16 Jan 2023 11:23:54 +0100
> Corinna Vinschen wrote:
> > On Jan 16 18:02, Takashi Yano via Cygwin wrote:
> > [...]
> > > Errors seem to be three types: (null), cygpid.xxx and shared.5.
> > > I'm not sure what is happening and why at all, however, this
> > > did not seem to happen before the commit 30add3e6b3e3.
> > 
> > I'll try to reproduce this issue.  But the weird thing is certainly
> > this: The affected shared mem regions are apparently not the cygheap.
> > Rather, they are the "shared" and "cygpid" shared mem regions, which
> > should not at all collide with the cygheap.  I guess we need more
> > debug output in the api_fatal call inside open_shared...
> 
> I am now trying the test case with reverting the commit 60675f1a7eb2
> "Cygwin: decouple shared mem regions from Cygwin DLL", and the issue
> does not happen for several hours so far. I guess this most likely
> is the direct cause of the problem.

Actually, I' running your testcase on two machines in parallel now for
quite some time, which only one hunk of 60675f1a7eb2 reverted, i.e.

diff --git a/winsup/cygwin/mm/shared.cc b/winsup/cygwin/mm/shared.cc
index 893b20d289b4..6d6d2940b6d4 100644
--- a/winsup/cygwin/mm/shared.cc
+++ b/winsup/cygwin/mm/shared.cc
@@ -140,7 +140,11 @@ open_shared (const WCHAR *name, int n, HANDLE& shared_h, DWORD size,
   if (*m == SH_JUSTCREATE || *m == SH_JUSTOPEN)
     addr = NULL;
   else
-    addr = (void *) region_address[*m];
+    {
+      addr = (void *) region_address[*m];
+      VirtualFree (addr, 0, MEM_RELEASE);
+    }
+
 
   WCHAR map_buf[MAX_PATH];
   WCHAR *mapname = NULL;

So far (and knocking on wood madly while writing this) the mapping
problem didn't show up once.  Maybe you'd like to try the same?

Btw., I pinged you on IRC already 3 hours ago...


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
