Bug 180373

Summary: Crash when synchronizing dimap (after emptying trash)
Product: [Unmaintained] kmail Reporter: Damien Raude-Morvan <drazzib-web>
Component: disconnected IMAPAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: aroth, christophe, dilfridge, georg.wittenburg, kfebert, lukasz.lukaszewicz, macoafi, null, paul, stephen.thompson, volkmar.woerner+KDE
Priority: NOR    
Version: 1.11.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: full BT

Description Damien Raude-Morvan 2009-01-11 21:01:18 UTC
Version:           1.11.0 (using Devel)
OS:                Linux
Installed from:    Compiled sources

Kmail crash unexpectedly when checking a disconnected imap account.
This append during manual or scheduled check ; inside Kontact or with standalone KMail.

My mail server is Dovecot 1:1.0.15 (debian testing).

Application : Kontact (kontact), signal SIGABRT
0x00007fcb61125ff1 in nanosleep () from /lib/libc.so.6
[Current thread is 0 (LWP 18254)]

Thread 2 (Thread 0x418a5950 (LWP 18264)):
#0  0x00007fcb61150ce2 in select () from /lib/libc.so.6
#1  0x00007fcb6236d756 in QProcessManager::run (this=0x1ac9e80) at io/qprocess_unix.cpp:301
#2  0x00007fcb622a5162 in QThreadPrivate::start (arg=0x1ac9e80) at thread/qthread_unix.cpp:185
#3  0x00007fcb5b916fc7 in start_thread () from /lib/libpthread.so.0
#4  0x00007fcb611575ad in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fcb639856f0 (LWP 18254)):
[KCrash Handler]
#5  0x00007fcb610b9ed5 in raise () from /lib/libc.so.6
#6  0x00007fcb610bb3f3 in abort () from /lib/libc.so.6
#7  0x00007fcb6229d5a5 in qt_message_output (msgType=QtFatalMsg, buf=<value optimized out>) at global/qglobal.cpp:2102
#8  0x00007fcb6229d6e7 in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2303
#9  0x00007fcb4c4c960f in KMFolderIndex::getMsgBase (this=0x2897410, idx=8) at /usr/include/qt4/QtCore/qvector.h:325
#10 0x00007fcb4c4e4faa in KMFolderCachedImap::findByUID (this=0x2897410, uid=38895) at ../../kmail/kmfoldercachedimap.cpp:655
#11 0x00007fcb4c4f9538 in KMFolderCachedImap::slotGetMessagesData (this=0x2897410, job=0x521e760, data=@0x7fff6baccbc0) at ../../kmail/kmfoldercachedimap.cpp:1810
#12 0x00007fcb4c4fd0cb in KMFolderCachedImap::qt_metacall (this=0x2897410, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff6bacc800) at ./kmfoldercachedimap.moc:195
#13 0x00007fcb623a16e4 in QMetaObject::activate (sender=0x521e760, from_signal_index=<value optimized out>, to_signal_index=40, argv=0xffffffffffffffff) at kernel/qobject.cpp:3031
#14 0x00007fcb5fca81e4 in KIO::TransferJob::data (this=0x474e, _t1=0x521e760, _t2=<value optimized out>) at ./jobclasses.moc:356
#15 0x00007fcb5fcae1d9 in KIO::TransferJob::qt_metacall (this=0x521e760, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff6bacc930) at ./jobclasses.moc:337
#16 0x00007fcb623a16e4 in QMetaObject::activate (sender=0x33a98d0, from_signal_index=<value optimized out>, to_signal_index=4, argv=0xffffffffffffffff) at kernel/qobject.cpp:3031
#17 0x00007fcb5fd6dae2 in KIO::SlaveInterface::data (this=0x474e, _t1=<value optimized out>) at ./slaveinterface.moc:138
#18 0x00007fcb5fd713c8 in KIO::SlaveInterface::dispatch (this=0x33a98d0, _cmd=100, rawdata=<value optimized out>) at ../../kio/kio/slaveinterface.cpp:163
#19 0x00007fcb5fd6dd92 in KIO::SlaveInterface::dispatch (this=0x33a98d0) at ../../kio/kio/slaveinterface.cpp:91
#20 0x00007fcb5fd5ff93 in KIO::Slave::gotInput (this=0x33a98d0) at ../../kio/kio/slave.cpp:322
#21 0x00007fcb5fd60fc8 in KIO::Slave::qt_metacall (this=0x33a98d0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff6baccd20) at ./slave.moc:75
#22 0x00007fcb623a16e4 in QMetaObject::activate (sender=0x365d700, from_signal_index=<value optimized out>, to_signal_index=4, argv=0xffffffffffffffff) at kernel/qobject.cpp:3031
#23 0x00007fcb5fc7c3a0 in KIO::ConnectionPrivate::dequeue (this=0x365d890) at ../../kio/kio/connection.cpp:82
#24 0x00007fcb5fc7c4da in KIO::Connection::qt_metacall (this=0x365d700, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x772b530) at ./connection.moc:72
#25 0x00007fcb6239c355 in QObject::event (this=0x365d700, e=0x6858120) at kernel/qobject.cpp:1155
#26 0x00007fcb618b1a5d in QApplicationPrivate::notify_helper (this=0x1ac4020, receiver=0x365d700, e=0x6858120) at kernel/qapplication.cpp:3803
#27 0x00007fcb618b97da in QApplication::notify (this=0x7fff6bacd880, receiver=0x365d700, e=0x6858120) at kernel/qapplication.cpp:3768
#28 0x00007fcb62d1adeb in KApplication::notify (this=0x7fff6bacd880, receiver=0x365d700, event=0x6858120) at ../../kdeui/kernel/kapplication.cpp:307
#29 0x00007fcb6238d391 in QCoreApplication::notifyInternal (this=0x7fff6bacd880, receiver=0x365d700, event=0x6858120) at kernel/qcoreapplication.cpp:587
#30 0x00007fcb6238e02a in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1a9d170) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:209
#31 0x00007fcb623b5a93 in postEventSourceDispatch (s=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:214
#32 0x00007fcb5bb6578b in IA__g_main_context_dispatch (context=0x1ac8d20) at /build/buildd/glib2.0-2.16.6/glib/gmain.c:2012
#33 0x00007fcb5bb68f5d in g_main_context_iterate (context=0x1ac8d20, block=1, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.16.6/glib/gmain.c:2645
#34 0x00007fcb5bb6911b in IA__g_main_context_iteration (context=0x1ac8d20, may_block=1) at /build/buildd/glib2.0-2.16.6/glib/gmain.c:2708
#35 0x00007fcb623b571f in QEventDispatcherGlib::processEvents (this=0x1abe560, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:319
#36 0x00007fcb6194347f in QGuiEventDispatcherGlib::processEvents (this=0x474e, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:198
#37 0x00007fcb6238bcb2 in QEventLoop::processEvents (this=<value optimized out>, flags={i = 1806489248}) at kernel/qeventloop.cpp:143
#38 0x00007fcb6238be3d in QEventLoop::exec (this=0x7fff6bacd6e0, flags={i = 1806489328}) at kernel/qeventloop.cpp:194
#39 0x00007fcb6238e2ed in QCoreApplication::exec () at kernel/qcoreapplication.cpp:845
#40 0x0000000000404821 in main (argc=1, argv=0x7fff6bacde58) at ../../../kontact/src/main.cpp:218
Comment 1 Damien Raude-Morvan 2009-01-11 21:01:48 UTC
Created attachment 30140 [details]
full BT
Comment 2 Damien Raude-Morvan 2009-01-11 21:04:19 UTC
In .xsession-errors file, I can find this :

kontact(18254)/kmail KMFolderIndex::updateIndexStreamPtr: utime( "/home/drazzib/.kde4/share/apps/kmail/dimap/.1623982081.directory/.Trash.index.ids" , 0) failed (KMMsgDict::getFolderIdsLocation( *this ))
ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qvector.h, line 325
*** KMail got signal 6 (Crashing)
KCrash: Application 'kontact' crashing...
sock_file=/home/drazzib/.kde4/socket-gauloise/kdeinit4__0
Comment 3 Jaime Torres 2009-01-13 11:52:36 UTC
maybe related to bug 163200.

Are you able to reproduce it at will?
Comment 4 Damien Raude-Morvan 2009-01-13 13:00:45 UTC
No, I can't find steps to reproduce it at will.

But it appends often (every 1 hours or so).
Comment 5 Dario Andres 2009-01-13 16:13:35 UTC
*** Bug 180101 has been marked as a duplicate of this bug. ***
Comment 6 Christophe Marin 2009-03-19 16:23:59 UTC
the bug still exists in trunk. Got this while doing nothing particular (I suppose kmail was just looking for new mails) :

Thread 1 (Thread 0xb3929710 (LWP 23828)):
[KCrash Handler]
#6  0xb7eeb424 in __kernel_vsyscall ()
#7  0xb5b00990 in raise () from /lib/libc.so.6
#8  0xb5b022c8 in abort () from /lib/libc.so.6
#9  0xb68de345 in qt_message_output (msgType=QtFatalMsg, buf=0x98dda38 "ASSERT failure in QVector<T>::operator[]: \"index out of range\", file /usr/include/QtCore/qvector.h, line 335")
    at global/qglobal.cpp:2006
#10 0xb68de431 in qFatal (msg=0xb6a2d668 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qglobal.cpp:2201
#11 0xb68de4dc in qt_assert_x (where=0xb77100ad "QVector<T>::operator[]", what=0xb76f8ed2 "index out of range", file=0xb771008f "/usr/include/QtCore/qvector.h", line=335) at global/qglobal.cpp:1785
#12 0xb742af05 in QVector<KMMsgBase*>::operator[] (this=0x8f64b48, i=8) at /usr/include/QtCore/qvector.h:335
#13 0xb7452b1b in KMFolderIndex::getMsgBase (this=0x8f64af8, idx=8) at /home/krop/kde/src/KDE/kdepim/kmail/kmfolderindex.h:73
#14 0xb7467b10 in KMFolderCachedImap::findByUID (this=0x8f64af8, uid=2588) at /home/krop/kde/src/KDE/kdepim/kmail/kmfoldercachedimap.cpp:674
#15 0xb7476977 in KMFolderCachedImap::slotGetMessagesData (this=0x8f64af8, job=0x9385ce8, data=@0xbfc08b54) at /home/krop/kde/src/KDE/kdepim/kmail/kmfoldercachedimap.cpp:1856
#16 0xb747ad0f in KMFolderCachedImap::qt_metacall (this=0x8f64af8, _c=QMetaObject::InvokeMetaMethod, _id=39, _a=0xbfc088a8) at /home/krop/kde/build/KDE/kdepim/kmail/kmfoldercachedimap.moc:198
#17 0xb69f0c88 in QMetaObject::activate (sender=0x9385ce8, from_signal_index=40, to_signal_index=40, argv=0xbfc088a8) at kernel/qobject.cpp:3069
#18 0xb69f2412 in QMetaObject::activate (sender=0x9385ce8, m=0xb6e34230, local_signal_index=0, argv=0xbfc088a8) at kernel/qobject.cpp:3143
#19 0xb6c4dcc9 in KIO::TransferJob::data(KIO::Job*, QByteArray const&) () from /usr/lib/libkio.so.5
#20 0xb6c4e602 in KIO::TransferJob::slotData(QByteArray const&) () from /usr/lib/libkio.so.5
#21 0xb6c59755 in KIO::TransferJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#22 0xb69f0c88 in QMetaObject::activate (sender=0x94dd4b0, from_signal_index=4, to_signal_index=4, argv=0xbfc089cc) at kernel/qobject.cpp:3069
#23 0xb69f2412 in QMetaObject::activate (sender=0x94dd4b0, m=0xb6e36e44, local_signal_index=0, argv=0xbfc089cc) at kernel/qobject.cpp:3143
#24 0xb6d18833 in KIO::SlaveInterface::data(QByteArray const&) () from /usr/lib/libkio.so.5
#25 0xb6d1c57c in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/libkio.so.5
#26 0xb6d18bf7 in KIO::SlaveInterface::dispatch() () from /usr/lib/libkio.so.5
#27 0xb6d0905d in KIO::Slave::gotInput() () from /usr/lib/libkio.so.5
#28 0xb6d0b4f3 in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#29 0xb69f0c88 in QMetaObject::activate (sender=0x94dcc18, from_signal_index=4, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3069
#30 0xb69f2412 in QMetaObject::activate (sender=0x94dcc18, m=0xb6e337e0, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3143
#31 0xb6c1dba7 in KIO::Connection::readyRead() () from /usr/lib/libkio.so.5
#32 0xb6c1f513 in ?? () from /usr/lib/libkio.so.5
#33 0xb6c1f8f6 in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#34 0xb69e98db in QMetaCallEvent::placeMetaCall (this=0x8f06920, object=0x94dcc18) at kernel/qobject.cpp:489
#35 0xb69eb370 in QObject::event (this=0x94dcc18, e=0x8f06920) at kernel/qobject.cpp:1118
#36 0xb5e8aeec in QApplicationPrivate::notify_helper (this=0x8cd2770, receiver=0x94dcc18, e=0x8f06920) at kernel/qapplication.cpp:4084
#37 0xb5e931ae in QApplication::notify (this=0xbfc094a0, receiver=0x94dcc18, e=0x8f06920) at kernel/qapplication.cpp:3631
#38 0xb7ce8e9d in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#39 0xb69da9db in QCoreApplication::notifyInternal (this=0xbfc094a0, receiver=0x94dcc18, event=0x8f06920) at kernel/qcoreapplication.cpp:602
#40 0xb69db625 in QCoreApplication::sendEvent (event=<value optimized out>, receiver=<value optimized out>) at kernel/qcoreapplication.h:213
#41 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x8ca9d18) at kernel/qcoreapplication.cpp:1239
#42 0xb69db81d in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1132
#43 0xb6a067df in QCoreApplication::sendPostedEvents () at kernel/qcoreapplication.h:218
#44 postEventSourceDispatch (s=0x8cd4920) at kernel/qeventdispatcher_glib.cpp:209
#45 0xb41419a8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#46 0xb4145063 in ?? () from /usr/lib/libglib-2.0.so.0
#47 0xb4145221 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#48 0xb6a06428 in QEventDispatcherGlib::processEvents (this=0x8ccfc40, flags={i = -1077898504}) at kernel/qeventdispatcher_glib.cpp:323
#49 0xb5f2aac5 in QGuiEventDispatcherGlib::processEvents (this=0x8ccfc40, flags={i = -1077898456}) at kernel/qguieventdispatcher_glib.cpp:202
#50 0xb69d8ffa in QEventLoop::processEvents (this=0xbfc093a0, flags={i = -1077898392}) at kernel/qeventloop.cpp:149
#51 0xb69d943a in QEventLoop::exec (this=0xbfc093a0, flags={i = -1077898328}) at kernel/qeventloop.cpp:200
#52 0xb69db8e9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:880
#53 0xb5e8ad67 in QApplication::exec () at kernel/qapplication.cpp:3553
#54 0x0804aa48 in main (argc=3, argv=0xbfc09574) at /home/krop/kde/src/KDE/kdepim/kmail/main.cpp:146
Comment 7 Christophe Marin 2009-03-20 11:08:54 UTC
Some console output ("Corbeille" is the trash folder) :

mail(8845) KMail::NetworkAccount::mailCheckCanProceed: for host "imap.gmail.com" current connections= 0 and limit is 0      
kmail(8845) KMail::NetworkAccount::mailCheckCanProceed: connection limit reached: false                                      
kmail(8845) KMail::AccountManager::processNextCheck: processing next mail check for "email@domain.tld"                      
kmail(8845) KMail::NetworkAccount::setCheckingMail: check mail started - connections for host "imap.gmail.com" now is 1      
kmail(8845) KMFolderCachedImap::listNamespaces: listNamespaces ("")                                                          
kmail(8845) KMFolderCachedImap::listNamespaces: listNamespaces ()                                                            
kmail(8845)/kmail (storage internals) KMFolderMaildir::reallyDoClose: fclose(mIndexStream =  0x9e2e808 )                     
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2580 in cache athough it's supposed to be there!     
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######                                                        
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"                                                                                                            
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2580 . It will be redownloaded                        
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2581 in cache athough it's supposed to be there!     
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######                                                        
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"                                                                                                            
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2581 . It will be redownloaded                        
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2582 in cache athough it's supposed to be there!     
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######                                                        
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"                                                                                                            
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2582 . It will be redownloaded                        
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2583 in cache athough it's supposed to be there!     
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######                                                        
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"                                                                                                            
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2583 . It will be redownloaded                        
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2584 in cache athough it's supposed to be there!     
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######                                                        
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2584 . It will be redownloaded
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2585 in cache athough it's supposed to be there!
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2585 . It will be redownloaded
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2586 in cache athough it's supposed to be there!
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2586 . It will be redownloaded
kmail(8845) KMFolderCachedImap::findByUID: ########## Didn't find uid:  2587 in cache athough it's supposed to be there!
kmail(8845) KMFolderCachedImap::slotGetMessagesData: WARNING: #######
kmail(8845) KMFolderCachedImap::slotGetMessagesData: Message locally missing but not deleted in folder:  "email@domain.tld/[Gmail]/Corbeille"
kmail(8845) KMFolderCachedImap::slotGetMessagesData: The missing UID:  2587 . It will be redownloaded
ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/include/QtCore/qvector.h, line 335
*** KMail got signal 6 (Crashing)
Comment 8 Christophe Marin 2009-03-25 22:14:15 UTC
Possible testcase : 

- Configure your dimap account so that the deleted messages are moved to one of the subscribed subfolder.

- delete mails

- use file / Empty All Trash Folders

- kmail will eventually crash when it checks for new messages. (I can't find a better reason for the moment)
Comment 9 Christophe Marin 2009-06-14 16:17:03 UTC
*** Bug 187707 has been marked as a duplicate of this bug. ***
Comment 10 Christophe Marin 2009-06-14 16:17:59 UTC
*** Bug 196459 has been marked as a duplicate of this bug. ***
Comment 11 Christophe Marin 2009-06-14 16:18:21 UTC
*** Bug 169172 has been marked as a duplicate of this bug. ***
Comment 12 Dario Andres 2009-06-23 20:43:34 UTC
*** Bug 197624 has been marked as a duplicate of this bug. ***
Comment 13 Christophe Marin 2009-07-12 14:03:56 UTC
*** Bug 199859 has been marked as a duplicate of this bug. ***
Comment 14 Christophe Marin 2009-07-27 09:28:05 UTC
*** Bug 201622 has been marked as a duplicate of this bug. ***
Comment 15 FiNeX 2009-08-08 10:44:38 UTC
*** Bug 203035 has been marked as a duplicate of this bug. ***
Comment 16 Dario Andres 2009-08-11 16:20:02 UTC
*** Bug 203173 has been marked as a duplicate of this bug. ***
Comment 17 Christophe Marin 2010-09-19 15:35:27 UTC
*** Bug 244496 has been marked as a duplicate of this bug. ***
Comment 18 Myriam Schweingruber 2012-08-19 11:08:29 UTC
Thank you for your report. Kmail1 is currently unmaintained and the code has changed sufficiently in Kmail2 so the backtraces are not really useful anymore. Should you experience the same crash in Kmail 4.8.5 or later, please open a new report for Kmail2. Thank you for your understanding