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.