[Bug 208093] install -d race

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Mar 17 16:23:40 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208093

            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 at FreeBSD.org
          Reporter: matt at 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 the
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
...

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


More information about the freebsd-bugs mailing list