Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2016 16:23:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 208093] install -d race
Message-ID:  <bug-208093-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208093

            Bug ID: 208093
           Summary: install -d race
           Product: Base System
           Version: 10.3-BETA2
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: matt@ucc.asn.au

install -d has a race condition between checking for existence and mkdir().=
 It
fails with "File exists". This can be encountered running "make -j" where t=
he
same parent directory is created in multiple rules:
install -d /Users/travis/inst/sbin  #these three run at once
install -d /Users/travis/inst/bin
install -d /Users/travis/inst/bin
install: mkdir /Users/travis/inst: File exists

Run two copies of the following to reproduce it. Note that the same problem
also exists for intermediate directories, though that's more difficult to
reproduce.

#!/bin/sh

while true; do

install -d /tmp/xx123/test
rm -d -f  /tmp/xx123/test

done


output:
install: mkdir /tmp/xx123/test: File exists
install: mkdir /tmp/xx123/test: File exists
install: mkdir /tmp/xx123/test: File exists
...

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-208093-8>