X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Mon, 8 Mar 2010 14:56:57 -0500 From: Christopher Faylor To: "cygwin AT cygwin DOT com" , "Schmidt, Oliver" Subject: Re: Cygwin 1.7: Concurrency Issue with Shared State Initialization Message-ID: <20100308195656.GA17237@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: "cygwin AT cygwin DOT com" , "Schmidt, Oliver" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Mon, Mar 08, 2010 at 06:35:02PM +0100, Schmidt, Oliver wrote: >We call from a non-Cygwin shell a non-Cygwin gnumake. The Makefile >rules mostly call a non-Cygwin C compiler and linker. However Makefile >rules calling gawk, cat, cp, echo, mkdir, rm, sed, sh, ... are calling >Cygwin executables. > >If (and only if) we run gnumake in this scenario with the --jobs option >to perform a parallel build then we experience sporadic failures of the >Cygwin executables. Fortunately these failures still happen now and >then when running them with strace. So it was quite easy to find out >that the shared variable installation_root isn't correctly initialized >when things go wrong. > >Checking out src/winsup/cygwin/shared.cc I stumbled over these lines > > /* Initialize installation root dir. */ > if (!installation_root[0]) > init_installation_root (); Yeah, that's one place that's missing synchronization. I'll check in something tonight which attempts to solve this problem. It's a somewhat tricky problem because adding a mutex here would slow down every invocation of a cygwin program and we don't want to add to the "Why is Cygwin so slow???" scenarios if we can help it. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple