Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30046

Race condition in QDir::mkpath / QFileSystemEngine::createDirectory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 4.8.4, 5.0.0
    • Fix Version/s: 5.1.0 RC1
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Mac, Lin, Win
    • Commits:
      3e2cd8ef6f1ce4f46719890134c8bba9dbdb19ba

      Description

      at least the implementations of mkpath/createDirectory on Unix and Windows first
      1) check if the directory already exists, and then if it doesn't
      2) create it

      Step 2 can fail if another program created the directory between 1 & 2, letting the whole mkpath call fail (and preventing it from creating all the directories).

      It should be possible to check if the mkdir or corresponding call failed because the directory already exists and continue nicely in that case.

      (prominent example where this failed was running qdoc on multiple configurations with output directories having the same, not-yet existing parent directory, in parallel)

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              con Eike Ziller
              Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes