From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by sourceware.org (Postfix) with ESMTPS id 09A943858D28 for ; Wed, 18 Jan 2023 09:17:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09A943858D28 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from HP-Z230 (aj135041.dynamic.ppp.asahi-net.or.jp [220.150.135.41]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 30I9Gn5v023560 for ; Wed, 18 Jan 2023 18:16:49 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 30I9Gn5v023560 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1674033409; bh=6f7W6Qp/a+YYHv4lskVw8q/c3kUP+xjzd3YQsvoAV7Q=; h=Date:From:To:Subject:In-Reply-To:References:From; b=V80J24h15Q+TS9aXKD/qd/obkENUaV0KgsUHlZ+tZpp17LPf3Ca0vEZe9cXyfrPWw tndQRAxHZbEUTMqP/VaGSCJp9ST9uBVMXae29zM644Fgxbmo6IA1G+twYcYnY96Pii DeFxaOhhkWoIziPVGpyy39AELXupGvoTHaEf6erZ7G4tes4B1WlypdcLeyfH08Io12 Rwx92gVrNLij4b1Iv8G1CLqORT1JKAb4ea/cDoD5JInqckZFAkBkloEmPfFXb5Dfs8 2wJCJJKWL6MkGErNEVJaLC9x5RmBbOmVnO3IXnYwJWGAaB4/R9lhfzdWBHs/roxjeP bMA07u5GEdgug== X-Nifty-SrcIP: [220.150.135.41] Date: Wed, 18 Jan 2023 18:16:48 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Cygwin 3.4.3 and 3.5.0... hangs in make, top, procps, ls /proc/PID/... Message-Id: <20230118181648.362c4665be80637108e4fd36@nifty.ne.jp> In-Reply-To: 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> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Tue, 17 Jan 2023 21:46:20 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Jan 16 22:42, Corinna Vinschen via Cygwin wrote: > > On Jan 16 16:18, Corinna Vinschen via Cygwin wrote: > > > 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? > > > > Never mind, I encountered another error. After a bit more debugging > > I think I understand the problem now, and I'm just in the process of > > reworking open_shared. This may take a day or two. Stay tuned. > > I pushed some patches to fix this issue. Excessive debugging indicated > that the reason cygcheck fails in this way is: > > - It's a non-Cygwin process which > > - is built with high-entropy ASLR and > > - tries to load the Cygwin DLL dynamically and > > - therefore suffers from the fact that recent Cygwin code doesn't > expect that certain memory regions are used by Windows itself. > Which they are, due to the high-entropy stuff. > > The patches are supposed to make the code less rigid in terms of the > addresses of certain memory regions, as well as dropping the > high-entropy VA flag from builds of strace and cygcheck, both of which > are loading the Cygwin DLL dynamically as part of their job. > > The test release 3.5.0-0.116.g8d318bf142f7 contains the patches, for > everybody to try. Thank you very much for working on this problem. It seems that it was unexpectedly large-scale modification. I confirmed that the problem has been fixed with these patches. The test case has been running for 11 hours but the problem does not happen so far. -- Takashi Yano