delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/04/29/05:13:13

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
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
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 <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Subject: Re: GNU make losing jobserver tokens
Message-Id: <20220429181010.01940adc0cdbabf976997a6a@nifty.ne.jp>
In-Reply-To: <YmqzhlrjgMkzNz6h@calimero.vinschen.de>
References: <9b9da583-124d-9d5f-4c10-6622602ca8dc AT oracle DOT com>
<20220401174551 DOT 820cbc148852554108397e03 AT nifty DOT ne DOT jp>
<20220427231340 DOT 0bdab2d6d903dd4fb44bd12f AT nifty DOT ne DOT jp>
<f83bea36-a759-5620-89d8-b7b1b0c601ee AT cornell DOT edu>
<YmqgFLRX2ZH8AcpD AT calimero DOT vinschen DOT de>
<20220429000152 DOT 1fe838469e543a69586e194d AT nifty DOT ne DOT jp>
<YmqzhlrjgMkzNz6h AT calimero DOT vinschen DOT de>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
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 AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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 <takashi DOT yano AT nifty DOT ne DOT jp>

-- 
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019