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

Crash in QObject::killTimer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.15
    • None

    Description

      An application I am working on is crashing quite randomly because of a NULL pointer in QObject::killTimer(int id).

      The NULL pointer is thisThreadData which is obtained calling d->threadData.loadRelaxed(); and then used in the rest of the code without any check.

      That happens when a QTimer object is started with start(), which calls stop(), which calls QObject::killTimer().

       

      The timer in my code is created by some code like this one:

      void setupTimer()
      {
          timer = new QTimer(this);
          timer->setSingleShot(true);
          timer->setInterval(timer);
          connect(timer, &QTimer::timeout, this, &MainWindow::handleTimeout);
      }
      
      

      The parent is a class extending QMainWindow.

       

      Not sure if relevant, but this is happening when the timer is started in an eventFilter defined in the MainWindow class and installed on its own.

       

      I have only experienced this crash on mac OS X, but the lack of NULL pointer check should affect every platform, that's why I haven't set the platform of this issue.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            vivaladav Davide Coppola
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes