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

Application crashes in QFileSystemEntry::resolveNativeFilePath()

    XMLWordPrintable

Details

    Description

      (also filed with Digia as INC-275772)

      I experienced a strange crash that is not reproducible by a small example program. All I can provide is two screenshots (explained below).

      I am running an application with multiple threads, all operating on files located in a single directory. This directory is watched by a QFileSystemWatcher. Up to now it worked.

      Today I added a sequence

      QFile::remove (backupName);
      QFile::rename (name, backupName);
      saveAs (name);
      

      to the worker thread's code. This leads to reproducible crashes in a different thread, but only when running in Release mode.

      Looking at the stack trace (attachment (1)), the crash occurs somewhat deep inside QDir::absoluteFilePath(), with the QDir pointing to the watched directory.

      Attachment (2) shows the stack trace of the QFileSystemWatcher thread, which is inside Win API calls on the very same directory. Notably no thread is somewhere near the code I actually added!

      If I do not use the QFileSystemWatcher on the directory, the application runs without crashes.

      Thus I assume that there might be a race condition deep inside QFileSystemEntry / QFileSystemEngine that is triggered by the QFileSystemWatcher. Unfortunately I am not able to provide more detailed data.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            rwiesenfarth Rainer Wiesenfarth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes