PDA

View Full Version : Weird crash caused by a QTreeView



vfernandez
10th September 2006, 18:50
I have a QTreeView with an editable model and everything is working fine, but sometimes the program crashes. It happens sometimes when you move the mouse over a selected item. The model is acts as a two-column list, and it usually contains just a few items. This is the backtrace:


Program received signal SIGABRT, Aborted.
[Switching to Thread -1223207248 (LWP 6446)]
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb72e67d0 in raise () from /lib/libc.so.6
#2 0xb72e7ea3 in abort () from /lib/libc.so.6
#3 0xb7547c1a in qt_message_output (msgType=QtFatalMsg,
buf=0xbfd25420 "ASSERT: \"false\" in file itemviews/qtreeview.cpp, line 1909") at global/qglobal.cpp:1931
#4 0xb7547c79 in qFatal (msg=0xb763430c "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2147
#5 0xb7547cf9 in qt_assert (assertion=0xb7e3d512 "false", file=0xb7e3d4d8 "itemviews/qtreeview.cpp", line=1909)
at global/qglobal.cpp:1691
#6 0xb7dae137 in QTreeViewPrivate::coordinate (this=0x843b758, item=1) at itemviews/qtreeview.cpp:1909
#7 0xb7dae2a4 in QTreeViewPrivate::item (this=0x843b758, yCoordinate=49) at itemviews/qtreeview.cpp:1948
#8 0xb7daf30e in QTreeView::indexAt (this=0x843b740, point=@0xbfd27afc) at itemviews/qtreeview.cpp:1130
#9 0xb7d86863 in QAbstractItemView::viewportEvent (this=0x843b740, event=0xbfd27af0)
at itemviews/qabstractitemview.cpp:931
#10 0xb7d21d33 in QAbstractScrollAreaPrivate::viewportEvent (this=0x843b758, e=0xbfd27af0)
at widgets/qabstractscrollarea.cpp:93
#11 0xb7d21cb7 in QAbstractScrollAreaViewport::event (this=0x843bea8, e=0xbfd27af0) at widgets/qabstractscrollarea.cpp:105
#12 0xb79f4077 in QApplicationPrivate::notify_helper (this=0x8140100, receiver=0x843bea8, e=0xbfd27af0)
at kernel/qapplication.cpp:3175
#13 0xb79f5748 in QApplication::notify (this=0xbfd282c4, receiver=0x843bea8, e=0xbfd27af0) at kernel/qapplication.cpp:3040
#14 0xb79f1bdb in QCoreApplication::sendEvent (receiver=0x843bea8, event=0xbfd27af0)
at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:173
#15 0xb79f7f68 in QApplication::event (this=0xbfd282c4, e=0xbfd27f30) at kernel/qapplication.cpp:1838
#16 0xb79f4077 in QApplicationPrivate::notify_helper (this=0x8140100, receiver=0xbfd282c4, e=0xbfd27f30)
at kernel/qapplication.cpp:3175
#17 0xb79f439a in QApplication::notify (this=0xbfd282c4, receiver=0xbfd282c4, e=0xbfd27f30) at kernel/qapplication.cpp:2799
#18 0xb75f8d17 in QCoreApplication::sendEvent (receiver=0xbfd282c4, event=0xbfd27f30) at kernel/qcoreapplication.h:173
#19 0xb761f322 in QEventDispatcherUNIX::activateTimers (this=0x814aa30) at kernel/qeventdispatcher_unix.cpp:677
#20 0xb761fdba in QEventDispatcherUNIX::processEvents (this=0x814aa30, flags=@0xbfd280bc)
at kernel/qeventdispatcher_unix.cpp:806
#21 0xb7a6feab in QEventDispatcherX11::processEvents (this=0x814aa30, flags=@0xbfd280f4)
at kernel/qeventdispatcher_x11.cpp:132
#22 0xb75f2d11 in QEventLoop::processEvents (this=0xbfd28178, flags=@0xbfd2812c) at kernel/qeventloop.cpp:124
#23 0xb75f2eb6 in QEventLoop::exec (this=0xbfd28178, flags=@0xbfd28180) at kernel/qeventloop.cpp:169
#24 0xb75f6ff4 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:679
#25 0xb79f5c7c in QApplication::exec () at kernel/qapplication.cpp:2720
#26 0x08068d4b in main (argc=1, argv=0xbfd283f4) at main.cpp:115
(gdb)

Apparently, it has nothing to do with my code, since none of my methods appear in the backtrace. Any idea? Might it be a QT bug? I'm using QT 4.1.3.

jacek
10th September 2006, 19:31
In Qt 4.1.4 Changelog you can find:

- QTreeView
Fixed potential assert when asking for the coordinates of a non-existing item.
This might be the same problem, so check whether your program still crashes if you use Qt 4.1.4.