Subject: Re: another parallel-make race
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 09/13/2005 15:50:42
In article <20050913142552.GA9264@spathi.chuq.com>,
Chuck Silvers  <chuq@chuq.com> wrote:
>-=-=-=-=-=-
>
>On Mon, Sep 12, 2005 at 09:38:51PM +0100, segv wrote:
>> On Mon, 12 Sep 2005 21:32:52 +0100
>> Patrick Welche <prlw1@newn.cam.ac.uk> wrote:
>> 
>> > On Mon, Sep 12, 2005 at 12:48:13PM +0100, segv wrote:
>> > > On Mon, 12 Sep 2005 11:04:39 +0100
>> > > Patrick Welche <prlw1@newn.cam.ac.uk> wrote:
>> > > 
>> > > 
>> > > > From my point of view the problem "went away"... I didn't actually track
>> > > > anything down..
>> > > 
>> > > I don't think it went away, I have just updated src and xsrc trees for
>> > > netbsd-current. Running build.sh with -j 4 results in the
>following errors.
>> > > Running with -j 1 "fixes" the problem.
>> > 
>> > That's what I used to get - I just tried again with -j6 and today's cvs,
>> > and didn't hit the race condition, though I did reproducibly before :-/
>> > 
>> > Cheers,
>> > 
>> > Patrick
>> > 
>> 
>> Well I ran 'cvs update' today as well. I was building on a dual Pentium 3, I
>> guess this triggers the errors. Try building it on a SMP machine, maybe you'll
>> be able to reproduce the errors.
>
>
>nevermind, I see that luke fixed the race I was complaining about
>the same day as his previous post.
>
>the race that you're still seeing is different.  we end up with multiple
>instances of pax operating on same destination at the same time,
>and pax is dumb about trying to create a directory where a directory
>already exists.  in this case, pax removes the directory and then creates
>a new directory in the same place, which can cause problems if another pax
>is trying to create something in that directory while it's gone.
>
>please try the attached patch (which both fixes the above problem and
>updates pax's copy of mkpath() with the race-avoiding version from mkdir.c).
>

I committed it with minor changes. Many thanks.

christos