From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by sourceware.org (Postfix) with ESMTPS id A74F03857346 for ; Thu, 28 Apr 2022 14:09:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A74F03857346 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) 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 (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MOV26-1nVKSw3Ljy-00Prj6 for ; Thu, 28 Apr 2022 16:09:24 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 3D678A80A6A; Thu, 28 Apr 2022 16:09:24 +0200 (CEST) Date: Thu, 28 Apr 2022 16:09:24 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: GNU make losing jobserver tokens Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <9b9da583-124d-9d5f-4c10-6622602ca8dc@oracle.com> <20220401174551.820cbc148852554108397e03@nifty.ne.jp> <20220427231340.0bdab2d6d903dd4fb44bd12f@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:hN16CWskiVfiQos0cdd6pdRmeAhA/DK+tGUXfI++XNWJdgv3tEA 26cYl0TSSkTFID29EPuQXHgoeGkksXW1UGMqLB3Fqm9AJgXgnFKVPaQR+x8Ig3IFJbfC2/W xXmb0uv4sXCdDIgmyG1C/KRV8TSTmjgRFHAbM2ndy5+XZ5+BqheztN3/uT5ROs4TsDbqu1H SwIi91R4kQD+O5EY4kkHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:PV6nxMoBtNw=:+UCTFca5Ce2WLqWbL2sy2i XNITyBsslycns6zRtz9+JaGNwSEXzDxs4lmHOshtqJV2IQi+KuHm0euuCpzYKxa9eB/5Dit3R jiCi2hRggoNrupKZGEDd6CWui0pFIzJEZPapoq070ExJb/xZy0ESdUvNN+KOOsFGvP9aReGAm QCsy+bEByE9pXfQ5CvRcovDEjGY4PX+ngM4uf5aFLI9GMng237nI5mQTU1zRdgUKsdbINJ5BR +Q/Spew5tyeM+AwY6Dx7orf11XfYYtbpBXXlrdpK5rw4IgwUNy3qPcthsk56i5czQV718ymGs Gi9VWKmKfcCjJOCK6HNPA40ueiMXAbVHK/tymi8Oe4rFfL8FdHphBjmc+Ew0B2ygLHXWAAI1r cm2TWb8aQ/i8zQjOuY61ZJdTThmzLyhTPAiQgx89EKi8bKsneLSackMtkVZ2EzR5wP+9UvZB0 fm6tnQuLj1C7cbtv+stsS4Bw8DqUpcepayOWBiSX5Hl/NftafnQ1bRuMRlwQQbB1LQtNss4/s hHghetoEFGt5gFY6sre12yWoH18EA16IbJzE5AwjCguj9bcxGXabvOIi9fn47LIyi5ai/FzsC 9KHPdRWyoTS2Ntm7Y1yQxBpu1GX1n2oBtedmsIQr/BZfodNpcEw/ZvI44VwNpd+slWpiPlZJh 99IIo6lE6tX1yOP1xriTxMIOB4Inmkik5ovqdeP5qVF+apzdRwRULwt802wCI050Z7pz/1Kq3 NUBcvf+UaE+Klm1N X-Spam-Status: No, score=-101.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_FAIL, SPF_HELO_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 14:09:28 -0000 On Apr 28 09:42, Ken Brown wrote: > On 4/27/2022 10:13 AM, Takashi Yano wrote: > > On Fri, 1 Apr 2022 17:45:51 +0900 > > Takashi Yano wrote: > > > I have tried to reproduce the issue by building OpenJDK > > > from source, however, I could not. > > > > > > Instead, I encountered another issue. > > > > > > Building OpenJDK sometimes (rarely) failed with error such as: > > > > > > 0 [sig] make 5484 sig_send: error sending signal 11, pid 5484, pipe handle 0x118, nb 0, packsize 176, Win32 error 0 > > > 124917 [main] make 5484 sig_send: error sending signal -72, pid 5484, pipe handle 0x118, nb 0, packsize 176, Win32 error 0 > > > common/modules/GensrcModuleInfo.gmk:77: *** open: /home/yano/jdk/build/windows-x86-server-release/make-support/vardeps/make/common/modules/GensrcModuleInfo.gmk/jdk.accessibility/ALL_MODULES.vardeps: No such file or directory. Stop. > > > make[2]: *** [make/Main.gmk:141: jdk.accessibility-gensrc-moduleinfo] Error 2 > > > make[2]: *** Waiting for unfinished jobs.... > > > > > > > > > I looked into this new problem and found that wait_sig() thread > > > crashes with segfault. It seems that accessing _main_tls causes > > > access violation if a signal is sent just after the process is > > > started. > > > > > > static void WINAPI > > > wait_sig (VOID *) > > > { > > > [...] > > > if (!pack.mask) > > > { > > > tl_entry = cygheap->find_tls (_main_tls); > > > dummy_mask = _main_tls->sigmask; // <--- Segfault here > > > cygheap->unlock_tls (tl_entry); > > > pack.mask = &dummy_mask; > > > } > > > > > > I also found the following patch resolves the issue. > > > > > > diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc > > > index 62df96652..3824af199 100644 > > > --- a/winsup/cygwin/sigproc.cc > > > +++ b/winsup/cygwin/sigproc.cc > > > @@ -1325,6 +1325,10 @@ wait_sig (VOID *) > > > _sig_tls = &_my_tls; > > > bool sig_held = false; > > > + /* Wait for _main_tls initialization. */ > > > + while (!cygwin_finished_initializing) > > > + Sleep (10); > > > + > > > sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p", > > > my_readsig, my_sendsig); > > > > > > I guess _main_tls may not be initialized correctly until > > > cygwin_finished_initializing is set. > > > > > > Any comments would be appreciated. > > This seems reasonable to me. Missed that, sorry. I agree this seems reasonable, but wouldn't it be cleaner if we *start* wait_sig only after cygwin_finished_initializing is set to true? Corinna