X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 20 Nov 2009 15:49:58 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Use of Dual Core causes random failures building OpenJDK
Message-ID: <20091120144958.GW29173@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4B023172.5000102@a11ysoft.com>  <4B0611DC.3080002@a11ysoft.com>  <4B061709.2040507@cygwin.com>  <b0ddfae80911200304l4f23bca2ha548ee1030a7816b@mail.gmail.com>  <20091120112052.GT29173@calimero.vinschen.de>  <20091120143237.GD18289@ednor.casa.cgf.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091120143237.GD18289@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Nov 20 09:32, Christopher Faylor wrote:
> On Fri, Nov 20, 2009 at 12:20:52PM +0100, Corinna Vinschen wrote:
> >On Nov 20 06:04, mike marchywka wrote:
> >> On 11/19/09, Larry Hall (Cygwin) <reply-to-list-only-lh@cygwin.com> wrote:
> >>>Wow! I had a hunch that BLODA could be the cause of the file related
> >>>problems but it never occurred to me that it could be screwing up
> >>>environment variables too.
> >>
> >>Anyone care to determine if env updates are not thread safe?
> >
> >It's indeed not thread safe.  Looks like we need some locking...
> 
> What's "it" in this case?  putenv?

"it" is primarily _addenv, which is used by setenv and putenv.

>   The putenv() function is not required to be reentrant, and the one in
>   libc4, libc5 and glibc 2.0 is not, but the glibc 2.1 version is

Same for setenv and unsetenv, which don't need to be thread-safe per
POSIX.  glibc's setenv is thread-safe, though.

> I agree that it would be nice to make it safer but is there really code
> here which is updating the environment in separate threads?

And given POSIX, if so, it would be an application bug if the application
doesn't care by itself to use setenv/getenv in a thread-safe manner.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

