From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by sourceware.org (Postfix) with ESMTPS id 61C74383801A for ; Thu, 28 Apr 2022 15:32:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 61C74383801A 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 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MhUHt-1oNGIm1r3D-00eaWc for ; Thu, 28 Apr 2022 17:32:23 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 7AD08A80780; Thu, 28 Apr 2022 17:32:22 +0200 (CEST) Date: Thu, 28 Apr 2022 17:32:22 +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> <20220429000152.1fe838469e543a69586e194d@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220429000152.1fe838469e543a69586e194d@nifty.ne.jp> X-Provags-ID: V03:K1:fLI70N+XPy4eqU/v4iLoIO7ZdoEy4CAtBp4Xo33CWbixvKc/G83 CitZCRlwjEy4r+/u02ErqMAyDoUrv9q82U6ac8iTXTtjZ7uA6BreLmw4W8UMK/t4qi3P49Q tDHl9w28AdoWLu63RsfUkXCBULBGGQbGEob8R5goyz1PPsGgz6cAPDSXg9dYoQIZPC1RYgN 7aRB98Pe8zniKg/RyvgbA== X-UI-Out-Filterresults: notjunk:1;V03:K0:rBXgCQhqwkY=:Uyw8YRqmUxvjCFG2s7Vw+f AuUaHEFThJWhe3sXhtfgjtVcopnMtmVGHCS/B5D5e8CDgQSqS4I7taoofquDrNnifkD2xMQDe ujQcpCevV15Q+nbBIrvzKOp5qpaqoJ1aHS+cv5AJlTtkaBJI6tfi49PyD68gADbSMalTQmidk qWsAt93hyB4wBMM6zPMgnm9JwLqJaSadzlY2/s5VhH7kGAarbSrieAy/GeR353MeunoanSGGO SyXXAx3DCQcDHyxylPTsfUYVrRrD8IOr8YlY58v0DXlYpJMLeDQuRBS+q1jieVGQby9Kxcx1X nhOCNLWXuvoUd4gCujlakTlCywtFPxb6D5Qa10Mj9gVKhZPd8IbbIG9i5SVUEU2tsZHOOEZXL 5Tx1mvUILtOdSIfdEp14PP/B7vh0PRtgzESuKnOR/Pl5Uz/uc6EpOdCEU33Smhh9WUfteuC6J WTxQ4NoFi8pu6331Oxk0XqYcuTgIDF5pkXF03gkk3TofGD8MSK+bIJld7yfrMJplwpGH99Tcn 42EpgLlTWbRmR9Ulj+PoH9pvHRcIonsYUvjkVF7aFEQYDcl7ufJ1SMkIm8L6Fw3dxOa4u9XCq K9VuWz4xEqFzPwnCFDJ3dozDuzgTcvZRDikis7CkYamHhHy321U3RzvCO9cWLefTH1cNLNi0U SPyGle1xApHURK+9isPP06ljq1oY6GHeepEVPLuwVcqDdzajnCGnjy5P56EX51Fbhwf4hf7yh IzpPpBtkW2W9tQVC 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 15:32:27 -0000 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? Corinna