From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by sourceware.org (Postfix) with ESMTPS id 7043B3858D32 for ; Mon, 16 Jan 2023 15:18:24 +0000 (GMT) Authentication-Results: sourceware.org; dmarc=permerror header.from=cygwin.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cygwin.com Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M3lsh-1pHiEW0QuB-000vxE for ; Mon, 16 Jan 2023 16:18:23 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id A9431A8088F; Mon, 16 Jan 2023 16:18:22 +0100 (CET) Date: Mon, 16 Jan 2023 16:18:22 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cygwin 3.4.3 and 3.5.0... hangs in make, top, procps, ls /proc/PID/... Message-ID: Reply-To: cygwin@cygwin.com 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> <20230116180213.0e03a896f512d784933f54da@nifty.ne.jp> <20230116234532.f567e64fe7bf9a0a13704af9@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230116234532.f567e64fe7bf9a0a13704af9@nifty.ne.jp> X-Provags-ID: V03:K1:EemwGKPeF9/j1vYy7AVWrWQhvN1Vx1WDhnDWfLIn96maDQuFsQu H0lsqb+3DS/0uHCsuOe7esIdDmqVN6dOnDFH9PdVQXpiIVNpH6HQskgWIdBiwV/L7axAt2+ 98BIzADtbp9J56X+/ooGJclxun5csQATZbgWWno7qNXL5r7x9JPht2piaqzojaCQiUzXM0L b5QB0PmvFr2851QeCALGA== UI-OutboundReport: notjunk:1;M01:P0:Co2NxMDUneY=;GLK/zreSyhertlGDzLjV8V89pY4 3Iybe+qnncKcjutxi/7AMFC3CjrGFncx6sI547l+EzMqai/1Zwt2XBSDihSAt0jox2TJGCviE av0qXbM03sDJhFZAhoz2jO+Aw2OIvoV7hBkSOLcCBkq1Mu5wxQ0BuK1SDcqrLx3GInbx2l/Wk Xj0TJIEsVi3U0suzYQjueO1h5HRJBb3ZibAl/6T1lX3oSKfvVO0jv1Vy6Xwi9G/meG1Z6mh/+ LajnzKTOYHtpR/uc4oGmCt75Ye5kkZSK1i1HH79vbwudV3xddIU2pPO4V/xSdTDPaGZFgH7gc KQ1EvNco09GHlMSghVne0oMLu+ALyMggD9OMMOIXhNlSQgRVDjfd+vcD5EPu4jujy9TUhgjbK sSHHnLdiTaxt4TXaNIa2SWBt7yjXgGU+IuzjE5rCyqe7mxspcDJhJa3Ota6KwSdDwoQl5Xr9s O/pjmMWorAgwUN/4AvjTv5oqdW5Umuq/AUAhaA2mCcka0546Gpi36h7/nlHBY2ES/otxYWOds IN2a3IiohAdw4rd7qbW1qgZPwGNkVi2ZDZC6e77fkxno6O+QWCYRo26YjKDR22f3YoZ8yy2JQ fajessK/iCsHaJxSMJnuFy+fUtU5/lWHalbbgy2lPnD/KIYrxW55K8K7z0sJH5B/V4HxZ3pqh AAlnxO0BoaP1ivc5VMMJ/2aLRXEGwrojzb3NzP2akQ== X-Spam-Status: No, score=-102.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GOOD_FROM_CORINNA_CYGWIN,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_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 List-Id: 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