Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
4.8.5
-
Windows Business 64bit, MSVC 2010SP1, Qt 4.8.5 64bit
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.