• Martin Heistermann's avatar
    Fix crash on window close event. · 05f49233
    Martin Heistermann authored
    Likely made visible by Qt 5.11, but was was broken before.
    
    Due to a direct qt connection, the CoreWidget is being destroyed while
    a) a CoreWidget method is on the stack
    b) the close event is not fully handled yet.
    
    Valgrind output for reference:
    
    ==6374== Invalid read of size 8
    ==6374==    at 0x71C64A1: QWindow::destroy() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    ==6374==    by 0x71C70DE: QWindow::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    ==6374==    by 0x6C02F37: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BA7490: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BAEACF: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x7893038: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x71B7DB9: QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    ==6374==    by 0x71BCA54: QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    ==6374==    by 0x7196D8A: QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    ==6374==    by 0xCA5685A: ??? (in /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.11.2)
    ==6374==    by 0x7891D0A: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x7899E81: QCoreApplication::exec() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x33C6F2: main (OpenFlipper.cc:802)
    ==6374==  Address 0xc5fc6e8 is 8 bytes inside a block of size 88 free'd
    ==6374==    at 0x4836EEB: operator delete(void*) (vg_replace_malloc.c:576)
    ==6374==    by 0x6BD4CAA: QWidgetPrivate::deleteTLSysExtra() (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BD97D7: QWidget::destroy(bool, bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BE10E1: QWidget::~QWidget() (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x438381: CoreWidget::~CoreWidget() (CoreWidget.cc:658)
    ==6374==    by 0x4383A5: CoreWidget::~CoreWidget() (CoreWidget.cc:660)
    ==6374==    by 0x382D4C: Core::slotExit() (Core.cc:1219)
    ==6374==    by 0x504948: Core::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_Core.cpp:1559)
    ==6374==    by 0x78BC28A: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x515DFC: CoreWidget::exit() (moc_CoreWidget.cpp:1602)
    ==6374==    by 0x439BA9: CoreWidget::closeEvent(QCloseEvent*) (CoreWidget.cc:912)
    ==6374==    by 0x6BE57C7: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6CEBED3: QMainWindow::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x43A82F: CoreWidget::event(QEvent*) (CoreWidget.cc:1103)
    ==6374==    by 0x6BA7490: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BAEACF: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x7893038: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x6BE0CC0: QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BFFD1D: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6C02F2C: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BA7490: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x6BAEACF: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.11.2)
    ==6374==    by 0x7893038: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.11.2)
    ==6374==    by 0x71B7DB9: QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.11.2)
    05f49233
Name
Last commit
Last update
..
BackupCommunication.cc Loading commit data...
Core.cc Loading commit data...
Core.hh Loading commit data...
Logging.cc Loading commit data...
OpenFunctionThread.cc Loading commit data...
OpenFunctionThread.hh Loading commit data...
ParseIni.cc Loading commit data...
ParseObj.cc Loading commit data...
PluginCommunication.cc Loading commit data...
PluginInfo.hh Loading commit data...
PluginLoader.cc Loading commit data...
RPC.cc Loading commit data...
SelectionCommunication.cc Loading commit data...
SpinBoxEventFilter.cc Loading commit data...
SpinBoxEventFilter.hh Loading commit data...
Video.cc Loading commit data...
openFunctions.cc Loading commit data...
optionHandling.cc Loading commit data...
process.cc Loading commit data...
saveFunctions.cc Loading commit data...
saveSettings.cc Loading commit data...
scripting.cc Loading commit data...