Bug 283067

Summary: Zanshin crashing when adding items, promoting to project, adding subitem
Product: [I don't know] kde Reporter: Georg Greve <greve>
Component: generalAssignee: Kevin Ottens <ervin>
Status: RESOLVED FIXED    
Severity: crash CC: greve
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Georg Greve 2011-09-30 07:16:20 UTC
Application: zanshin (0.2)
KDE Platform Version: 4.7.1 (4.7.1)
Qt Version: 4.8.0
Operating System: Linux 2.6.40.4-5.fc15.x86_64 x86_64
Distribution: "Fedora release 15 (Lovelock)"

-- Information about the crash:
- What I was doing when the application crashed:

	* Create item
	* Promote to project
	* Move item into project
	* Create next item
	* Promote to project
	* Move item into second project
	* Wonder why first item has now disappeared
	* Watch crash

-- Backtrace:
Application: Zanshin Todo (zanshin), signal: Segmentation fault
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  QModelIndex (other=..., this=) at /usr/include/QtCore/qabstractitemmodel.h:65
#7  KDescendantsProxyModel::mapFromSource (this=0x147ce00, sourceIndex=...) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/kdescendantsproxymodel.cpp:462
#8  0x0000003791c12ddc in KDescendantsProxyModelPrivate::sourceDataChanged (this=<optimized out>, topLeft=..., bottomRight=...) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/kdescendantsproxymodel.cpp:963
#9  0x000000378d989f51 in QMetaObject::activate (sender=0x14621f0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c94cb0) at kernel/qobject.cpp:3546
#10 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#11 0x0000003790d68233 in QSortFilterProxyModelPrivate::_q_sourceDataChanged (this=0x14bab70, source_top_left=..., source_bottom_right=...) at itemviews/qsortfilterproxymodel.cpp:1193
#12 0x000000378d989f51 in QMetaObject::activate (sender=0x14b3b70, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c94f80) at kernel/qobject.cpp:3546
#13 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#14 0x0000003790d68233 in QSortFilterProxyModelPrivate::_q_sourceDataChanged (this=0x14356d0, source_top_left=..., source_bottom_right=...) at itemviews/qsortfilterproxymodel.cpp:1193
#15 0x000000378d989f51 in QMetaObject::activate (sender=0x14bb6b0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c95250) at kernel/qobject.cpp:3546
#16 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#17 0x0000003790d68233 in QSortFilterProxyModelPrivate::_q_sourceDataChanged (this=0x143d580, source_top_left=..., source_bottom_right=...) at itemviews/qsortfilterproxymodel.cpp:1193
#18 0x000000378d97df38 in QMetaMethod::invoke (this=0x7fffd5c956b0, object=0x14bb6b0, connectionType=Qt::DirectConnection, returnValue=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1636
#19 0x000000378d9802f0 in QMetaObject::invokeMethod (obj=0x14bb6b0, member=<optimized out>, type=Qt::DirectConnection, ret=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1178
#20 0x0000003791c1064b in invokeMethod (val9=..., val8=..., val7=..., val6=..., val5=..., val4=..., val3=..., val2=..., val1=..., val0=..., type=Qt::DirectConnection, member=0x3791dc06f3 "_q_sourceDataChanged", obj=0x14bb6b0) at /usr/include/QtCore/qobjectdefs.h:418
#21 invokeDataChanged (bottomRight=..., topLeft=..., this=<optimized out>) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/krecursivefilterproxymodel.cpp:55
#22 KRecursiveFilterProxyModelPrivate::sourceDataChanged (this=0x1497710, source_top_left=..., source_bottom_right=...) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/krecursivefilterproxymodel.cpp:131
#23 0x000000378d989f51 in QMetaObject::activate (sender=0x1402c20, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c95c00) at kernel/qobject.cpp:3546
#24 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#25 0x000000000043570b in TodoTreeModel::onSourceDataChanged (this=0x1402c20, begin=..., end=...) at /usr/src/debug/zanshin-0.1.82/src/todotreemodel.cpp:216
#26 0x000000378d989f51 in QMetaObject::activate (sender=0x13e7d90, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c95ed0) at kernel/qobject.cpp:3546
#27 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#28 0x000000000043a27d in TodoMetadataModel::onSourceDataChanged (this=0x13e7d90, begin=..., end=...) at /usr/src/debug/zanshin-0.1.82/src/todometadatamodel.cpp:217
#29 0x000000378d989f51 in QMetaObject::activate (sender=0x13e7d90, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c96180) at kernel/qobject.cpp:3546
#30 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#31 0x0000003791c0e167 in KIdentityProxyModelPrivate::_k_sourceDataChanged (this=<optimized out>, topLeft=..., bottomRight=<optimized out>) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/kidentityproxymodel.cpp:572
#32 0x000000378d989f51 in QMetaObject::activate (sender=0x13c0210, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c96330) at kernel/qobject.cpp:3546
#33 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#34 0x0000003799cf8422 in Akonadi::EntityTreeModelPrivate::dataChanged (this=<optimized out>, top=..., bottom=...) at /usr/src/debug/kdepimlibs-4.7.1/akonadi/entitytreemodel_p.cpp:1525
#35 0x0000003799d02665 in Akonadi::EntityTreeModelPrivate::updateJobDone (this=0x13c27e0, job=<optimized out>) at /usr/src/debug/kdepimlibs-4.7.1/akonadi/entitytreemodel_p.cpp:1242
#36 0x000000378d989f51 in QMetaObject::activate (sender=0x12d0d30, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffd5c96640) at kernel/qobject.cpp:3546
#37 0x0000003791541842 in KJob::result (this=<optimized out>, _t1=0x12d0d30) at /usr/src/debug/kdelibs-4.7.1/x86_64-redhat-linux-gnu/kdecore/kjob.moc:208
#38 0x0000003791541880 in KJob::emitResult (this=0x12d0d30) at /usr/src/debug/kdelibs-4.7.1/kdecore/jobs/kjob.cpp:312
#39 0x0000003799d2ede8 in Akonadi::ItemModifyJob::doHandleResponse (this=0x12d0d30, _tag=<optimized out>, data=...) at /usr/src/debug/kdepimlibs-4.7.1/akonadi/itemmodifyjob.cpp:263
#40 0x0000003799d34a09 in Akonadi::JobPrivate::handleResponse (this=<optimized out>, tag=..., data=...) at /usr/src/debug/kdepimlibs-4.7.1/akonadi/job.cpp:80
#41 0x0000003799d67ab6 in Akonadi::SessionPrivate::dataReceived (this=0x141b7c0) at /usr/src/debug/kdepimlibs-4.7.1/akonadi/session.cpp:218
#42 0x000000378d989f51 in QMetaObject::activate (sender=0x13b6ee0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3546
#43 0x000000378d989f51 in QMetaObject::activate (sender=0x141b508, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3546
#44 0x000000378e6cbf6f in QAbstractSocketPrivate::canReadNotification (this=0x13c2040) at socket/qabstractsocket.cpp:651
#45 0x000000378e6d3a41 in event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1151
#46 QReadNotifier::event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1148
#47 0x00000037907c4564 in notify_helper (e=0x7fffd5c97320, receiver=0x13b92d0, this=0x1284e30) at kernel/qapplication.cpp:4495
#48 QApplicationPrivate::notify_helper (this=0x1284e30, receiver=0x13b92d0, e=0x7fffd5c97320) at kernel/qapplication.cpp:4467
#49 0x00000037907c93f3 in QApplication::notify (this=0x7fffd5c97630, receiver=0x13b92d0, e=0x7fffd5c97320) at kernel/qapplication.cpp:4356
#50 0x0000003791c504f6 in KApplication::notify (this=0x7fffd5c97630, receiver=0x13b92d0, event=0x7fffd5c97320) at /usr/src/debug/kdelibs-4.7.1/kdeui/kernel/kapplication.cpp:311
#51 0x000000378d97616c in QCoreApplication::notifyInternal (this=0x7fffd5c97630, receiver=0x13b92d0, event=0x7fffd5c97320) at kernel/qcoreapplication.cpp:853
#52 0x000000378d9a4607 in sendEvent (event=0x7fffd5c97320, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#53 socketNotifierSourceDispatch (source=0x1289dd0) at kernel/qeventdispatcher_glib.cpp:110
#54 0x000000386d6427ed in g_main_dispatch (context=0x1289ce0) at gmain.c:2441
#55 g_main_context_dispatch (context=0x1289ce0) at gmain.c:3014
#56 0x000000386d642fc8 in g_main_context_iterate (context=0x1289ce0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3092
#57 0x000000386d64325c in g_main_context_iteration (context=0x1289ce0, may_block=1) at gmain.c:3155
#58 0x000000378d9a4faf in QEventDispatcherGlib::processEvents (this=0x1267540, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#59 0x0000003790866fbe in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:207
#60 0x000000378d9752a2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#61 0x000000378d9754f7 in QEventLoop::exec (this=0x7fffd5c97560, flags=...) at kernel/qeventloop.cpp:204
#62 0x000000378d979f35 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1125
#63 0x000000000041cc31 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/zanshin-0.1.82/src/main.cpp:108

Reported using DrKonqi
Comment 1 Georg Greve 2011-09-30 11:59:24 UTC
Created attachment 64094 [details]
New crash information added by DrKonqi

zanshin (0.2) on KDE Platform 4.7.1 (4.7.1) using Qt 4.8.0

Reproduced with standalone Zanshin just to make sure it wasn't something else interfering:

	* Right click on Task resource "Add new project"
	* Added project
	* Right click on project that was just added, select "Add new project"
	* Enter project, confirm
	* Watch crash.

Backtrace seems identical, so I guess it's not some interaction with Kontact.

-- Backtrace (Reduced):
#6  QModelIndex (other=..., this=) at /usr/include/QtCore/qabstractitemmodel.h:65
#7  KDescendantsProxyModel::mapFromSource (this=0x19c0120, sourceIndex=...) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/kdescendantsproxymodel.cpp:462
#8  0x0000003791c12ddc in KDescendantsProxyModelPrivate::sourceDataChanged (this=<optimized out>, topLeft=..., bottomRight=...) at /usr/src/debug/kdelibs-4.7.1/kdeui/itemviews/kdescendantsproxymodel.cpp:963
[...]
#10 0x000000378d9d5b87 in QAbstractItemModel::dataChanged (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at .moc/release-shared/moc_qabstractitemmodel.cpp:164
#11 0x0000003790d68233 in QSortFilterProxyModelPrivate::_q_sourceDataChanged (this=0x19c3b10, source_top_left=..., source_bottom_right=...) at itemviews/qsortfilterproxymodel.cpp:1193
Comment 2 Kevin Ottens 2011-10-02 01:41:35 UTC
Git commit 3a220f833481047c21dffb910d930a25f8bbc391 by Kevin Ottens.
Committed on 02/10/2011 at 03:38.
Pushed by ervin into branch 'master'.

Workaround Qt 4.8 behavior change of QAbstractProxyModel

OK, that one was tough! Turns out that in Qt 4.8 the behavior of
QAbstractProxyModel changed because it now provides a reimplementation
of hasChildren() not based on rowCount() & columnCount(), but by
forwarding the request to the source model (which in my opinion doesn't
really make sense...).

Because of that, all the proxies or views on top of subclasses of
TodoProxyModelBase were getting totally confused because of
contradictions between hasChildren() and rowCount() results.

That explains the random crashes, or empty views experienced by users
running with Qt 4.8 beta.

Pfew! I'm glad I finally noticed those reports were mentionning Qt 4.8.

BUG: 283066
BUG: 283067

M  +5    -0    src/todoproxymodelbase.cpp
M  +1    -0    src/todoproxymodelbase.h

http://commits.kde.org/zanshin/3a220f833481047c21dffb910d930a25f8bbc391