From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-02.nifty.com (conssluserg-02.nifty.com [210.131.2.81]) by sourceware.org (Postfix) with ESMTPS id A3B35385737D for ; Fri, 29 Apr 2022 09:10:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3B35385737D 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 Express5800-S70 (ak044095.dynamic.ppp.asahi-net.or.jp [119.150.44.95]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 23T9A9A1030610 for ; Fri, 29 Apr 2022 18:10:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 23T9A9A1030610 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1651223410; bh=16HpXQTUny4jH44nEReEeHBiADGxVKJZrum4SrUkyvM=; h=Date:From:To:Subject:In-Reply-To:References:From; b=MJmIWpMN8p1em4vRU9wNavOnJiYilvdSr2lopPirOAWaoTLAMc+sY+Z+PbUAlyq+J q9rir/LVKJJNGhnjXCkHd2Ru03v55kBVybX3YMzIwvtFy99zZwBWScJjhr9+TRomR1 dewDaufz/K1N4lLrnhU3wCF8eQPO/ozZA72tJFXgu7T9qsZ10MK61g/CDF9h8Hpa5T GA3Nx1jJisioUijIsfy/zfKKqKsbau6msTb7Os04aSomLfAkLsGQuYvpirj1xhzSSf 1cSoGkVbIbprbTM5M9rXrf9FNWdWTBrmkNnPKOx3MUnk1Yl2ic14RQCqwSjDHEtqz+ WnLmbFoj74KoQ== X-Nifty-SrcIP: [119.150.44.95] Date: Fri, 29 Apr 2022 18:10:10 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: GNU make losing jobserver tokens Message-Id: <20220429181010.01940adc0cdbabf976997a6a@nifty.ne.jp> In-Reply-To: References: <9b9da583-124d-9d5f-4c10-6622602ca8dc@oracle.com> <20220401174551.820cbc148852554108397e03@nifty.ne.jp> <20220427231340.0bdab2d6d903dd4fb44bd12f@nifty.ne.jp> <20220429000152.1fe838469e543a69586e194d@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=-12.1 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.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: Fri, 29 Apr 2022 09:10:32 -0000 On Thu, 28 Apr 2022 17:32:22 +0200 Corinna Vinschen wrote: > On Apr 29 00:01, Takashi Yano wrote: > > On Thu, 28 Apr 2022 16:09:24 +0200 > > Corinna Vinschen wrote: > > > 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: > > > > > > [...] > > > > > > 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. > > > > Thanks Ken and Corinna. > > > > > 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? > > > > I also thought so, however, there is a comment in dcrt0.cc > > as follows. So, there seems to be some reason to start > > wait_sig before cygwin_finished_initialization. > > > > /* Initialize signal processing here, early, in the hopes that the creation > > of a thread early in the process will cause more predictability in memory > > layout for the main thread. */ > > if (!dynamically_loaded) > > sigproc_init (); > > This is a 32-bit only problem. The 64 bit address space layout is as > predictable as can be. Maybe the above fix should go into 3.3 and for > 3.4 we try differently? I tried to move sigproc_init() call from dll_crt0_0() to fork::child() for 64bit cygwin, however, that causes hang at cygwin startup. Am I missing somehting? -- Takashi Yano