Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
Qt Creator 3.6.1, Qt Creator 4.0.0-beta1
-
None
-
Linux Qt 5.6.1 (git), Windows XP Qt 5.6.0, WIndows 7 x64 Qt 5.6.0
Description
1. Open QtCreator.
2. Choose "File->New File or Project"
3. Select "Qt".
4. Double click on "Qt Designer Form" or "Qt Designer Form Class".
5. It takes a while at first time (it crashes only at first time).
6. Crash and backtrace:
0x00007ffff72265bd in QAbstractItemView::mouseDoubleClickEvent (this=0xa19ff0, event=0x7fffffffcf20) at itemviews/qabstractitemview.cpp:1892 1892 if ((event->button() == Qt::LeftButton) && !edit(persistent, DoubleClicked, event) (gdb) bt #0 0x00007ffff72265bd in QAbstractItemView::mouseDoubleClickEvent (this=0xa19ff0, event=0x7fffffffcf20) at itemviews/qabstractitemview.cpp:1892 #1 0x00007ffff6f5ea98 in QWidget::event (this=0xa19ff0, event=0x7fffffffcf20) at kernel/qwidget.cpp:8750 #2 0x00007ffff70be527 in QFrame::event (this=0xa19ff0, e=0x7fffffffcf20) at widgets/qframe.cpp:544 #3 0x00007ffff71699be in QAbstractScrollArea::viewportEvent (this=0xa19ff0, e=0x7fffffffcf20) at widgets/qabstractscrollarea.cpp:1206 #4 0x00007ffff7225213 in QAbstractItemView::viewportEvent (this=0xa19ff0, event=0x7fffffffcf20) at itemviews/qabstractitemview.cpp:1685 #5 0x00007ffff716ac25 in QAbstractScrollAreaPrivate::viewportEvent (this=0x2004930, event=0x7fffffffcf20) at widgets/qabstractscrollarea_p.h:105 #6 0x00007ffff716acee in QAbstractScrollAreaFilter::eventFilter (this=0x40edc30, o=0x40f8530, e=0x7fffffffcf20) at widgets/qabstractscrollarea_p.h:121 #7 0x00007ffff65c6484 in QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=0x40f8530, event=0x7fffffffcf20) at kernel/qcoreapplication.cpp:1126 #8 0x00007ffff6f0ce5b in QApplicationPrivate::notify_helper (this=0x6356d0, receiver=0x40f8530, e=0x7fffffffcf20) at kernel/qapplication.cpp:3800 #9 0x00007ffff6f0a92c in QApplication::notify (this=0x7fffffffdeb0, receiver=0x40f8530, e=0x7fffffffcf20) at kernel/qapplication.cpp:3277 #10 0x00007ffff65c669a in QCoreApplication::notifyInternal2 (receiver=0x40f8530, event=0x7fffffffcf20) at kernel/qcoreapplication.cpp:1015 #11 0x00007ffff6f0fd4c in QCoreApplication::sendSpontaneousEvent (receiver=0x40f8530, event=0x7fffffffcf20) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228 #12 0x00007ffff6f092bb in QApplicationPrivate::sendMouseEvent (receiver=0x40f8530, event=0x7fffffffcf20, alienWidget=0x40f8530, nativeWidget=0x3822210, buttonDown=0x7ffff77dc8c0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2773 #13 0x00007ffff6f8b112 in QWidgetWindow::handleMouseEvent (this=0x42fbca0, event=0x7fffffffd580) at kernel/qwidgetwindow.cpp:598 #14 0x00007ffff6f89c5a in QWidgetWindow::event (this=0x42fbca0, event=0x7fffffffd580) at kernel/qwidgetwindow.cpp:228 #15 0x00007ffff6f0ce84 in QApplicationPrivate::notify_helper (this=0x6356d0, receiver=0x42fbca0, e=0x7fffffffd580) at kernel/qapplication.cpp:3804 #16 0x00007ffff6f0a0e0 in QApplication::notify (this=0x7fffffffdeb0, receiver=0x42fbca0, e=0x7fffffffd580) at kernel/qapplication.cpp:3163 #17 0x00007ffff65c669a in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x42fbca0, event=event@entry=0x7fffffffd580) at kernel/qcoreapplication.cpp:1015 #18 0x00007ffff51ea7a1 in QCoreApplication::sendSpontaneousEvent (event=0x7fffffffd580, receiver=0x42fbca0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228 #19 QGuiApplicationPrivate::processMouseEvent (e=0x4311e90) at kernel/qguiapplication.cpp:1920 #20 0x00007ffff51eb945 in QGuiApplicationPrivate::processWindowSystemEvent (e=e@entry=0x4311e90) at kernel/qguiapplication.cpp:1661 #21 0x00007ffff51cbccb in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:648 #22 0x00007fffed37c230 in userEventSourceDispatch (source=<optimized out>) at eventdispatchers/qeventdispatcher_glib.cpp:70 #23 0x00007ffff40dad87 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #24 0x00007ffff40dafe0 in ?? () from /usr/lib/libglib-2.0.so.0 #25 0x00007ffff40db08c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #26 0x00007ffff661b6af in QEventDispatcherGlib::processEvents (this=0x75d220, flags=...) at kernel/qeventdispatcher_glib.cpp:417 #27 0x00007ffff65c4d0a in QEventLoop::exec (this=this@entry=0x7fffffffd890, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204 #28 0x00007ffff65cd57d in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1285 #29 0x00007ffff6f09ac1 in QApplication::exec () at kernel/qapplication.cpp:2979 #30 0x0000000000408cdb in ?? () #31 0x00007ffff5840710 in __libc_start_main () from /usr/lib/libc.so.6 #32 0x00000000004095e9 in ?? ()
It looks like QtCreator deleted the window which has QAbstractItemView (the list which has been double-clicked), because "this" pointer points to the invalid address on crash. I've debugged it inside QtWidgets (I've added qDebug() after "emit doubleClicked(persistent)", https://github.com/qtproject/qtbase/blob/35dce99b5664e47b2210c2dfe36300376e837f1d/src/widgets/itemviews/qabstractitemview.cpp#L1892 ):
qDebug() << (void *)this; // shows the address qDebug() << this; // crash - can't get class information
The bug probably is somewhere inside CorePlugin in method connected to "QAbstractItemView::doubleClicked(const QModelIndex &)" signal: "NewDialog::accept()".
The crash can be also fixed inside QtWidgets: check for "persistent.isValid()" after "emit doubleClicked(persistent);" and do nothing (don't do anything which needs "this").