This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin 1.7: Concurrency Issue with Shared State Initialization
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>, "Schmidt, Oliver" <oliv dot schmidt at sap dot com>
- Date: Mon, 8 Mar 2010 14:56:57 -0500
- Subject: Re: Cygwin 1.7: Concurrency Issue with Shared State Initialization
- References: <B10B50309DC54D45A855FD66F56015F71D07C78CAE@DEWDFECCR03.wdf.sap.corp>
- Reply-to: 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