Bug 277053

Summary: crash when downloading mails (MessageList::Core::ModelPrivate::slotStorageModelRowsInserted]
Product: [Applications] kmail2 Reporter: Detlev Casanova <detlev.casanova>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: chrigi_1, mail, renard, winter
Priority: NOR    
Version: 2.1.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Detlev Casanova 2011-07-04 09:28:57 UTC
Application: kmail (2.1.0)
KDE Platform Version: 4.6.4 (4.6.4)
Qt Version: 4.7.3
Operating System: Linux 2.6.39-gentoo-r1 x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:
KMail crashed while downloading mails, apprently, problems when filters are applied : mails are added to the inbox, then, filtered. Apparently, it only crashes when the inbox folder's content is shown.

The crash can be reproduced some of the time.

-- Backtrace:
Application: KMail (kmail), signal: Aborted
[Current thread is 1 (Thread 0x7f6e429cd760 (LWP 22703))]

Thread 2 (Thread 0x7f6e26dea700 (LWP 22707)):
#0  0x00007f6e3db6556c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f6e34863a3d in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00007f6e34863b49 in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x00007f6e3db60c1a in start_thread () from /lib64/libpthread.so.0
#4  0x00007f6e3fce8e7d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f6e429cd760 (LWP 22703)):
[KCrash Handler]
#6  0x00007f6e3fc49355 in raise () from /lib64/libc.so.6
#7  0x00007f6e3fc4a5ef in abort () from /lib64/libc.so.6
#8  0x00007f6e405196a4 in qt_message_output(QtMsgType, char const*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f6e40519852 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007f6e40519a05 in qFatal(char const*, ...) () from /usr/lib64/qt4/libQtCore.so.4
#11 0x00007f6e3b8545d6 in MessageList::Core::ModelPrivate::slotStorageModelRowsInserted (this=<value optimized out>, parent=<value optimized out>, from=712, to=<value optimized out>) at /var/tmp/portage/kde-base/kdepim-common-libs-4.6.0/work/kdepim-common-libs-4.6.0/messagelist/core/model.cpp:4242
#12 0x00007f6e3b85ca3e in MessageList::Core::Model::qt_metacall (this=0x2116b00, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff2550aa10) at /var/tmp/portage/kde-base/kdepim-common-libs-4.6.0/work/kdepim-common-libs-4.6.0_build/messagelist/model.moc:91
#13 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#14 0x00007f6e406777b4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib64/qt4/libQtCore.so.4
#15 0x00007f6e40677a1b in QAbstractItemModel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007f6e3b89e9b0 in MessageList::StorageModel::qt_metacall (this=0x58af, _c=22703, _id=6, _a=0xffffffffffffffff) at /var/tmp/portage/kde-base/kdepim-common-libs-4.6.0/work/kdepim-common-libs-4.6.0_build/messagelist/storagemodel.moc:75
#17 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007f6e406777b4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib64/qt4/libQtCore.so.4
#19 0x00007f6e4060f9a7 in QAbstractItemModel::endInsertRows() () from /usr/lib64/qt4/libQtCore.so.4
#20 0x00007f6e410cad3c in ?? () from /usr/lib64/qt4/libQtGui.so.4
#21 0x00007f6e410cb0fc in ?? () from /usr/lib64/qt4/libQtGui.so.4
#22 0x00007f6e410cb46f in ?? () from /usr/lib64/qt4/libQtGui.so.4
#23 0x00007f6e410cd38c in QSortFilterProxyModel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007f6e406777b4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007f6e4060f9a7 in QAbstractItemModel::endInsertRows() () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007f6e4239252c in KSelectionProxyModelPrivate::sourceRowsInserted (this=0x238cc00, parent=<value optimized out>, start=712, end=712) at /var/tmp/portage/kde-base/kdelibs-4.6.4-r1/work/kdelibs-4.6.4/kdeui/itemviews/kselectionproxymodel.cpp:1019
#28 0x00007f6e42393383 in KSelectionProxyModel::qt_metacall (this=0x214d920, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff2550b150) at /var/tmp/portage/kde-base/kdelibs-4.6.4-r1/work/kdelibs-4.6.4_build/kdeui/moc_kselectionproxymodel.cpp:124
#29 0x00007f6e3c3df985 in Akonadi::SelectionProxyModel::qt_metacall (this=0x58af, _c=22703, _id=6, _a=0xffffffffffffffff) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/selectionproxymodel.moc:70
#30 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#31 0x00007f6e406777b4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib64/qt4/libQtCore.so.4
#32 0x00007f6e4060f9a7 in QAbstractItemModel::endInsertRows() () from /usr/lib64/qt4/libQtCore.so.4
#33 0x00007f6e3c387d16 in Akonadi::EntityTreeModelPrivate::monitoredItemAdded (this=0x1d73060, item=<value optimized out>, collection=...) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/entitytreemodel_p.cpp:898
#34 0x00007f6e3c37e7da in Akonadi::EntityTreeModel::qt_metacall (this=0x1e80e40, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff2550b440) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/entitytreemodel.moc:157
#35 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#36 0x00007f6e3c3c3daa in Akonadi::Monitor::itemAdded (this=0x58af, _t1=<value optimized out>, _t2=<value optimized out>) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/monitor.moc:183
#37 0x00007f6e3c3c658f in Akonadi::MonitorPrivate::emitItemNotification (this=0x1d68c70, msg=..., item=<value optimized out>, collection=<value optimized out>, collectionDest=<value optimized out>) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/monitor_p.cpp:442
#38 0x00007f6e3c3c7853 in Akonadi::MonitorPrivate::emitNotification (this=0x1d68c70, msg=...) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/monitor_p.cpp:270
#39 0x00007f6e3c34b0a1 in Akonadi::ChangeRecorderPrivate::emitNotification (this=0x58af, msg=...) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/changerecorder_p.h:60
#40 0x00007f6e3c3c70f1 in Akonadi::MonitorPrivate::dataAvailable (this=0x1d68c70) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/monitor_p.cpp:287
#41 0x00007f6e3c3c3ea5 in Akonadi::Monitor::qt_metacall (this=0x1d68690, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff2550b9e0) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/monitor.moc:156
#42 0x00007f6e3c348538 in Akonadi::ChangeRecorder::qt_metacall (this=0x58af, _c=22703, _id=6, _a=0xffffffffffffffff) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/changerecorder.moc:72
#43 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#44 0x00007f6e3c34b819 in Akonadi::EntityCache<Akonadi::Item, Akonadi::ItemFetchJob, Akonadi::ItemFetchScope>::fetchResult (this=0x1d68cf8, job=0x265b1b0) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4/akonadi/entitycache_p.h:189
#45 0x00007f6e3c378bf3 in Akonadi::EntityCacheBase::qt_metacall (this=0x1d68cf8, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff2550bb90) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/entitycache_p.moc:77
#46 0x00007f6e4062ca0f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#47 0x00007f6e41da1282 in KJob::result (this=0x58af, _t1=0x265b1b0) at /var/tmp/portage/kde-base/kdelibs-4.6.4-r1/work/kdelibs-4.6.4_build/kdecore/kjob.moc:194
#48 0x00007f6e41da15e1 in KJob::emitResult (this=0x265b1b0) at /var/tmp/portage/kde-base/kdelibs-4.6.4-r1/work/kdelibs-4.6.4/kdecore/jobs/kjob.cpp:312
#49 0x00007f6e3c3ba360 in Akonadi::Job::qt_metacall (this=0x265b1b0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x26d8070) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/job.moc:91
#50 0x00007f6e3c3aac45 in Akonadi::ItemFetchJob::qt_metacall (this=0x58af, _c=22703, _id=6, _a=0xffffffffffffffff) at /var/tmp/portage/kde-base/kdepimlibs-4.6.4/work/kdepimlibs-4.6.4_build/akonadi/itemfetchjob.moc:73
#51 0x00007f6e40626abe in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#52 0x00007f6e40b0e8dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#53 0x00007f6e40b13d7d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#54 0x00007f6e423a6f51 in KApplication::notify (this=0x7fff2550c700, receiver=0x265b1b0, event=0x2a3e750) at /var/tmp/portage/kde-base/kdelibs-4.6.4-r1/work/kdelibs-4.6.4/kdeui/kernel/kapplication.cpp:311
#55 0x00007f6e40614d2b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#56 0x00007f6e40617cb1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4
#57 0x00007f6e406412d3 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#58 0x00007f6e38369fa1 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#59 0x00007f6e3836e638 in ?? () from /usr/lib64/libglib-2.0.so.0
#60 0x00007f6e3836e7ec in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#61 0x00007f6e40640e13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#62 0x00007f6e40bc0cbe in ?? () from /usr/lib64/qt4/libQtGui.so.4
#63 0x00007f6e40613a82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#64 0x00007f6e40613e64 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#65 0x00007f6e40617edb in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#66 0x0000000000403157 in main (argc=<value optimized out>, argv=<value optimized out>) at /var/tmp/portage/kde-base/kmail-4.6.0-r1/work/kmail-4.6.0/kmail/main.cpp:145

Reported using DrKonqi
Comment 1 Torgny Nyblom 2011-07-04 18:01:01 UTC
Issue seems to be that filters are removing messages from the folder and changing the model indexes as the job is running.
This somehow is causing the current index to be greater then the end index.

Not sure what index is wrong.
Comment 2 Milian Wolff 2011-09-21 20:28:22 UTC
Created attachment 63832 [details]
New crash information added by DrKonqi

kmail (4.8 pre) on KDE Platform 4.7.1 (4.7.1) using Qt 4.7.4

also happens to me on starting kmail with all my filters configured...

-- Backtrace (Reduced):
#11 0x00007ff2fa37d448 in MessageList::Core::ModelPrivate::slotStorageModelRowsInserted (this=0x15a3330, parent=..., from=34, to=34) at /home/milian/projects/kde4/kdepim/messagelist/core/model.cpp:4243
#12 0x00007ff2fa37e73d in MessageList::Core::Model::qt_metacall (this=0x15a3240, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffc2c479a0) at /home/milian/projects/.build/kde4/kdepim/messagelist/model.moc:91
[...]
#14 0x00007ff2fde17ff4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib/libQtCore.so.4
#15 0x00007ff2fde1851b in QAbstractItemModel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007ff2fa39c672 in MessageList::Core::StorageModel::qt_metacall (this=0x1de9510, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fffc2c47b50) at /home/milian/projects/.build/kde4/kdepim/messagelist/storagemodelbase.moc:64
Comment 3 Milian Wolff 2011-10-18 21:25:01 UTC
Created attachment 64684 [details]
New crash information added by DrKonqi

kmail (4.8 pre) on KDE Platform 4.7.2 (4.7.2) using Qt 4.7.4

just happened to me. kmail was running in the background and suddenly crashed. cli showed:

ASSERT: "job->currentIndex() <= job->endIndex()" in file /home/milian/projects/kde4/kdepim/messagelist/core/model.cpp, line 4267

all pim code from current git today

-- Backtrace (Reduced):
#11 0x00007f95061d25a0 in MessageList::Core::ModelPrivate::slotStorageModelRowsInserted (this=0xc81d90, parent=..., from=0, to=0) at /home/milian/projects/kde4/kdepim/messagelist/core/model.cpp:4267
#12 0x00007f95061d3895 in MessageList::Core::Model::qt_metacall (this=0xabd900, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffae2cd000) at /home/milian/projects/.build/kde4/kdepim/messagelist/model.moc:91
[...]
#14 0x00007f9509c65ff4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib/libQtCore.so.4
#15 0x00007f9509c6651b in QAbstractItemModel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007f95061f1312 in MessageList::Core::StorageModel::qt_metacall (this=0x569ca50, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fffae2cd1b0) at /home/milian/projects/.build/kde4/kdepim/messagelist/storagemodelbase.moc:64
Comment 4 Allen Winter 2011-10-18 21:51:45 UTC
almost looks like there's a problem if from == to in  slotStorageModelRowsInserted()
Comment 5 Milian Wolff 2011-11-22 10:15:57 UTC
Created attachment 65923 [details]
New crash information added by DrKonqi

kmail (4.8 beta1) on KDE Platform 4.7.3 (4.7.3) using Qt 4.7.4

still valid, just reproduced it. cli ouput:

akonadi_nepomuk_feeder(19534) ItemQueue::jobResult: "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress has a max cardinality of 1. Provided 2 values - "bla"^^<http://www.w3.org/2001/XMLSchema#string>, "bla"^^<http://www.w3.org/2001/XMLSchema#string>" 
akonadi_pop3_resource_0(19536)/kio (KIOJob) KIO::TransferJob::slotData: mimeType() not emitted when sending first data!; job URL = KUrl("pop3://bla@bla:110/index") data size = 8 
akonadi_pop3_resource_0(19536)/kio (KIOJob) KIO::TransferJob::slotData: mimeType() not emitted when sending first data!; job URL = KUrl("pop3://bla@bla:110/uidl") data size = 20 
ASSERT: "job->currentIndex() <= job->endIndex()" in file /home/milian/projects/kde4/kdepim/messagelist/core/model.cpp, line 4267

-- Backtrace (Reduced):
#11 0x00007fd4aae74b28 in MessageList::Core::ModelPrivate::slotStorageModelRowsInserted (this=0x1094610, parent=..., from=0, to=0) at /home/milian/projects/kde4/kdepim/messagelist/core/model.cpp:4267
#12 0x00007fd4aae75e1d in MessageList::Core::Model::qt_metacall (this=0xe8bf60, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fff241d32a0) at /home/milian/projects/.build/kde4/kdepim/messagelist/model.moc:91
[...]
#14 0x00007fd4adfaaff4 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int) () from /usr/lib/libQtCore.so.4
#15 0x00007fd4adfab51b in QAbstractItemModel::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007fd4aae9389a in MessageList::Core::StorageModel::qt_metacall (this=0x3f52ba0, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0x7fff241d3450) at /home/milian/projects/.build/kde4/kdepim/messagelist/storagemodelbase.moc:64
Comment 6 Sebastien Renard 2012-08-18 11:28:27 UTC
*** Bug 292146 has been marked as a duplicate of this bug. ***
Comment 7 Denis Kurz 2016-09-24 18:13:18 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 8 Denis Kurz 2017-01-07 21:27:15 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.