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@FreeBSD.org
          Reporter: m...@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.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to