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

QFileSystemWatcher default constructor crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.9.1
    • Fix Version/s: 5.9.2
    • Labels:
      None
    • Environment:
      Windows 7 Enterprise SP1, 64bit

      VS14.0.25325.01, Update 3
    • Commits:
      e612fe8d47bc0fe762668617a5189117ad1aee15 (qtbase/5.9, 3.8.2017, 5.9.2)

      Description

       

      New in qt5.9:

      QFileSystemWatcher's QWindowsFileSystemWatcherEngine creates a QWindowsRemovableDriveListener;

      DriveListener in turn installs a NativeEventFilter;

       

      For QFileSystem's default constructor, the parent-pointer that gets passed through to the NativeEventFilter is of course null, yet the constructor for the nativeEventFilter doesn't check if the filter object is null, thus crashes when fetching the data via qGetPtrHelper

       

      Call stack:

      Qt5Cored.dll!QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >::data() Zeile 140 
      Qt5Cored.dll!qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> > >(const QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> > & p) Zeile 999 
      Qt5Cored.dll!QAbstractEventDispatcher::d_func() Zeile 59 
      Qt5Cored.dll!QAbstractEventDispatcher::installNativeEventFilter(QAbstractNativeEventFilter * filterObj) Zeile 405 
      Qt5Cored.dll!QWindowsRemovableDriveListener::QWindowsRemovableDriveListener(QObject * parent) Zeile 125 
      Qt5Cored.dll!QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject * parent) Zeile 328 
      Qt5Cored.dll!QFileSystemWatcherPrivate::createNativeEngine(QObject * parent) Zeile 75 
      Qt5Cored.dll!QFileSystemWatcherPrivate::init() Zeile 98 
      Qt5Cored.dll!QFileSystemWatcher::QFileSystemWatcher(QObject * parent) Zeile 262 
      QTDebug.exe!main() Zeile 7 [Externer Code]

       

       

      I attached a minimal code example that crashes

        Attachments

        1. minExample.cpp
          0.2 kB
        2. QObjectOwningAWatcher.cpp
          0.2 kB
        3. QObjectOwningAWatcher.h
          0.3 kB
        4. qtbug62242.zip
          1 kB
        5. QTDebug.cpp
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              oli_h Oliver Henrichs
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes