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

deconstructor of QFileSystemWatcher hangs if run after deconstruction of Q(Core)Application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.0
    • 4.7.1
    • None
    • maemo6-i486 target in Scratchbox
    •  9036fe3d2ffabde9b49ced0ba8835d8403b11ff4

    Description

      Having a QFileSystemWatcher instance connected to a singleton run by Q_GLOBAL_STATIC(...) and having it only deleted on the singleton's destruction (as QObject child) this QFileSystemWatcher instance will stop the program from exiting and get it stuck in ~QFileSystemWatcher with this backtrace:
      (gdb) bt
      #0 0x013a0ae0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
      #1 0x0113c97d in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
      #2 0x0113b712 in QThread::wait(unsigned long) () from /usr/lib/libQtCore.so.4
      #3 0x0121a883 in QFileSystemWatcher::~QFileSystemWatcher() () from /usr/lib/libQtCore.so.4
      #4 0x01262349 in QObjectPrivate::deleteChildren() () from /usr/lib/libQtCore.so.4
      #5 0x0126b1c5 in QObject::~QObject() () from /usr/lib/libQtCore.so.4
      #6 0x00136020 in QctSettingsSingleton::~QctSettingsSingleton() () from /home/openist/build.m6.i/qtcontacts-tracker/src/lib/libqtcontacts_extensions_tracker.so.4
      #7 0x001352ac in QGlobalStaticDeleter<QctSettingsSingleton>::~QGlobalStaticDeleter (this=0x139b00, __in_chrg=<value optimized out>)
      at /targets/maemo6-i486/usr/include/qt4/QtCore/qglobal.h:1820
      #8 0x01511f2c in ?? () from /lib/libc.so.6
      #9 0x01511f95 in exit () from /lib/libc.so.6
      #10 0x014f9a47 in __libc_start_main () from /lib/libc.so.6
      #11 0x0805ce31 in _start ()

      A workaround is to do
      connect(qApp, SIGNAL(aboutToQuit()), myFileSystemWatcher, SLOT(deleteLater()));
      but this is nowhere documented and feels strange.

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            fkossebau Friedrich W. H. Kossebau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes