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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.1.0 RC1
    • 4.8.4, 5.0.0
    • Core: I/O
    • None
    • Mac, Lin, Win
    • 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

          For Gerrit Dashboard: QTBUG-30046
          # Subject Branch Project Status CR V

          Activity

            People

              srutledg Shawn Rutledge
              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