Bug 182582

Summary: kmail crashed when quick swithing between mail folders
Product: [Unmaintained] kmail Reporter: Sergei Andreev <seajey.serg>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: arvidjaar, des, ibc, johan.thelmen, jtamate, n.laradji, seajey.serg
Priority: NOR    
Version: 1.11.90   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Sergei Andreev 2009-01-31 14:41:09 UTC
Version:           1.11.0 (using 4.2.00 (KDE 4.2.0), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.27-11-generic

kmail can crash when I am quick swithing between mail folders.

The bug is repeatable on my machine.
Comment 1 Sergei Andreev 2009-01-31 14:41:27 UTC
Приложение: Kontact (kontact), сигнал SIGABRT
0x00007ffcca4596e1 in nanosleep () from /lib/libc.so.6
[Current thread is 0 (LWP 7002)]

Thread 3 (Thread 0x41db8950 (LWP 15364)):
#0  0x00007ffcca4904b2 in select () from /lib/libc.so.6
#1  0x00007ffccb002006 in ?? () from /usr/lib/libQtCore.so.4
#2  0x00007ffccaf39362 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007ffcc79403ea in start_thread () from /lib/libpthread.so.0
#4  0x00007ffcca497cbd in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x425b9950 (LWP 25281)):
#0  0x00007ffcc794455d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007ffccaf3a327 in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#2  0x00007ffccaf30509 in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007ffccaf39362 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007ffcc79403ea in start_thread () from /lib/libpthread.so.0
#5  0x00007ffcca497cbd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffcd080d6f0 (LWP 7002)):
[KCrash Handler]
#5  0x00007ffcca3e4015 in raise () from /lib/libc.so.6
#6  0x00007ffcca3e5b83 in abort () from /lib/libc.so.6
#7  0x00007ffcca3dcd89 in __assert_fail () from /lib/libc.so.6
#8  0x00007ffcb89c542d in KMMsgBase::getLongPart (this=0x57369c0, t=KMMsgBase::MsgSizePart) at /build/buildd/kdepim-4.2.0/kmail/kmmsgbase.cpp:1035
#9  0x00007ffcb89be049 in KMMsgBase::asIndexString (this=0x57369c0, length=@0x7fffd884c994) at /build/buildd/kdepim-4.2.0/kmail/kmmsgbase.cpp:1160
#10 0x00007ffcb89bed45 in KMMsgBase::syncIndexString (this=0x57369c0) at /build/buildd/kdepim-4.2.0/kmail/kmmsgbase.cpp:1196
#11 0x00007ffcb8b3d841 in KMFolderIndex::updateIndex (this=0x27fa6e0, aboutToClose=<value optimized out>) at /build/buildd/kdepim-4.2.0/kmail/kmfolderindex.cpp:57
#12 0x00007ffcb8a3263a in KMFolderMaildir::reallyDoClose (this=0x1b5a) at /build/buildd/kdepim-4.2.0/kmail/kmfoldermaildir.cpp:199
#13 0x00007ffcb8c655f7 in ~StorageModel (this=0x5970880) at /build/buildd/kdepim-4.2.0/kmail/messagelistview/storagemodel.cpp:186
#14 0x00007ffcb8cc6365 in KMail::MessageListView::Core::Widget::setStorageModel (this=0x269b120, storageModel=0x3479d10, preSelectionMode=KMail::MessageListView::Core::PreSelectLastSelected)
    at /build/buildd/kdepim-4.2.0/kmail/messagelistview/core/widgetbase.cpp:315
#15 0x00007ffcb8c69e08 in KMail::MessageListView::Widget::setFolder (this=0x269b120, fld=0x27f3150, icon=<value optimized out>, preSelectionMode=KMail::MessageListView::Core::PreSelectLastSelected)
    at /build/buildd/kdepim-4.2.0/kmail/messagelistview/widget.cpp:113
#16 0x00007ffcb8c6350b in KMail::MessageListView::Pane::setCurrentFolder (this=0x2699ef0, fld=0x27f3150, preferEmptyTab=false, preSelectionMode=KMail::MessageListView::Core::PreSelectLastSelected, 
    overrideLabel=@0x7fffd884ce20) at /build/buildd/kdepim-4.2.0/kmail/messagelistview/pane.cpp:204
#17 0x00007ffcb8b3964f in KMMainWidget::folderSelected (this=0x28b8b20, aFolder=0x27f3150, forceJumpToUnread=false, preferNewTabForOpening=6) at /build/buildd/kdepim-4.2.0/kmail/kmmainwidget.cpp:3066
#18 0x00007ffcb8b3be11 in KMMainWidget::qt_metacall (this=0x28b8b20, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffd884cfa0)
    at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/kmmainwidget.moc:505
#19 0x00007ffccb036134 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#20 0x00007ffcb88cb790 in KMail::FolderViewManager::folderActivated (this=0x1b5a, _t1=0x27f3150, _t2=false) at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/folderview.moc:87
#21 0x00007ffcb88d61c8 in KMail::FolderView::activateItemInternal (this=0x29c7c40, fvi=0x2a61050, keepSelection=false, notifyManager=true, middleButton=255)
    at /build/buildd/kdepim-4.2.0/kmail/folderview.cpp:999
#22 0x00007ffcb88d6c2a in KMail::FolderView::qt_metacall (this=0x29c7c40, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffd884d150)
    at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/folderview.moc:201
#23 0x00007ffcb88da546 in KMail::MainFolderView::qt_metacall (this=0x1b5a, _c=7002, _id=6, _a=0xffffffffffffffff) at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/mainfolderview.moc:63
#24 0x00007ffccb036134 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#25 0x00007ffccc0995c0 in QTreeWidget::itemClicked () from /usr/lib/libQtGui.so.4
#26 0x00007ffccc0a55e3 in QTreeWidget::qt_metacall () from /usr/lib/libQtGui.so.4
#27 0x00007ffccf2c2925 in KPIM::TreeWidget::qt_metacall (this=0x1b5a, _c=7002, _id=6, _a=0xffffffffffffffff) at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/libkdepim/moc_treewidget.cpp:67
#28 0x00007ffccf2c29d5 in KPIM::FolderTreeWidget::qt_metacall (this=0x1b5a, _c=7002, _id=6, _a=0xffffffffffffffff)
    at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/libkdepim/moc_foldertreewidget.cpp:63
#29 0x00007ffcb88d6a95 in KMail::FolderView::qt_metacall (this=0x1b5a, _c=7002, _id=6, _a=0xffffffffffffffff) at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/folderview.moc:183
#30 0x00007ffcb88da546 in KMail::MainFolderView::qt_metacall (this=0x1b5a, _c=7002, _id=6, _a=0xffffffffffffffff) at /build/buildd/kdepim-4.2.0/obj-x86_64-linux-gnu/kmail/mainfolderview.moc:63
#31 0x00007ffccb036134 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#32 0x00007ffccc024945 in QAbstractItemView::clicked () from /usr/lib/libQtGui.so.4
#33 0x00007ffccc03138e in QAbstractItemView::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#34 0x00007ffccbc0e329 in QWidget::event () from /usr/lib/libQtGui.so.4
#35 0x00007ffccc0338fd in QAbstractItemView::viewportEvent () from /usr/lib/libQtGui.so.4
#36 0x00007ffccc068530 in QTreeView::viewportEvent () from /usr/lib/libQtGui.so.4
#37 0x00007ffccb021038 in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /usr/lib/libQtCore.so.4
#38 0x00007ffccbbbbc0c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#39 0x00007ffccbbc422a in QApplication::notify () from /usr/lib/libQtGui.so.4
#40 0x00007ffcccef23eb in KApplication::notify (this=0x7fffd884eeb0, receiver=0x2976580, event=0x7fffd884e070) at /build/buildd/kde4libs-4.2.0/kdeui/kernel/kapplication.cpp:307
#41 0x00007ffccb021d61 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#42 0x00007ffccbbc35c8 in QApplicationPrivate::sendMouseEvent () from /usr/lib/libQtGui.so.4
#43 0x00007ffccbc27be9 in ?? () from /usr/lib/libQtGui.so.4
#44 0x00007ffccbc26607 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#45 0x00007ffccbc4e2c4 in ?? () from /usr/lib/libQtGui.so.4
#46 0x00007ffcc4d79d3b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#47 0x00007ffcc4d7d50d in ?? () from /usr/lib/libglib-2.0.so.0
#48 0x00007ffcc4d7d6cb in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#49 0x00007ffccb04a15f in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#50 0x00007ffccbc4da6f in ?? () from /usr/lib/libQtGui.so.4
#51 0x00007ffccb020682 in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#52 0x00007ffccb02080d in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#53 0x00007ffccb022cbd in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#54 0x0000000000404a15 in main (argc=3, argv=0x7fffd884f598) at /build/buildd/kdepim-4.2.0/kontact/src/main.cpp:218

Comment 2 Jaime Torres 2009-02-11 20:36:57 UTC
Confirmed in 64 bits, the same backtrace, with the following output in the konsole:


kontact(6343)/kmail (storage internals) KMFolderIndex::writeIndex: KDE_fopen(tempName= "/home/jtorres/.kde/share/apps/kmail/dimap/.1936280611.directory/.INBOX.index.temp" , "w") == tmpIndexStream ==  0x12ee060
kontact(6343)/kmail (storage internals) KMFolderIndex::writeIndex: fclose(tmpIndexStream =  0x12ee060 )
kontact(6343)/kmail (storage internals) KMFolderIndex::writeIndex: fclose(mIndexStream =  0x18503c0 )
kontact(6343)/kmail (storage internals) KMFolderIndex::writeIndex: KDE_fopen(indexName= "/home/jtorres/.kde/share/apps/kmail/dimap/.1936280611.directory/.INBOX.index" , "r+") == mIndexStream ==  0x159ea50
kontact: /g/kde4svn/kdepim/kmail/kmmsgbase.cpp:1042: off_t KMMsgBase::getLongPart(KMMsgBase::MsgPartType) const: La declaración `sizeOfLong == len' no se cumple.
Comment 3 Jaime Torres 2009-02-19 12:52:47 UTC
*** Bug 183155 has been marked as a duplicate of this bug. ***
Comment 4 Josh Berry 2009-02-24 20:39:35 UTC
Confirmed in svn r930674.

This crash also happens if I:
- Open a folder, read mail, etc.
- Select another message in that folder
- IMMEDIATELY (like, <1sec) select another folder

Here's another backtrace:

Application: KMail (kmail), signal SIGABRT
Thread 1 (Thread 0xb42fe920 (LWP 24307)):
[KCrash Handler]
#6  0xffffe424 in __kernel_vsyscall ()
#7  0xb66c9670 in raise () from /lib/libc.so.6
#8  0xb66caeb8 in abort () from /lib/libc.so.6
#9  0xb66c26ee in __assert_fail () from /lib/libc.so.6
#10 0xb75e0147 in KMMsgBase::getLongPart (this=0x904d368, t=KMMsgBase::MsgSizePart) at /usr/src/kde4/kdepim/kmail/kmmsgbase.cpp:1035
#11 0xb759928e in KMMsgInfo::msgSize (this=0x6) at /usr/src/kde4/kdepim/kmail/kmmsginfo.cpp:592
#12 0xb75df017 in KMMsgBase::asIndexString (this=0x904d368, length=@0xbfc69778) at /usr/src/kde4/kdepim/kmail/kmmsgbase.cpp:1160
#13 0xb75df9e1 in KMMsgBase::syncIndexString (this=0x904d368) at /usr/src/kde4/kdepim/kmail/kmmsgbase.cpp:1196
#14 0xb770bc8c in KMFolderIndex::updateIndex (this=0x86ffac0, aboutToClose=true) at /usr/src/kde4/kdepim/kmail/kmfolderindex.cpp:57
#15 0xb7608dec in KMFolderMbox::reallyDoClose (this=0x86ffac0) at /usr/src/kde4/kdepim/kmail/kmfoldermbox.cpp:289
#16 0xb7619473 in KMFolderImap::reallyDoClose (this=0x86ffac0) at /usr/src/kde4/kdepim/kmail/kmfolderimap.cpp:131
#17 0xb758550d in FolderStorage::close (this=0x6, aForced=243) at /usr/src/kde4/kdepim/kmail/folderstorage.cpp:110
#18 0xb7563322 in KMFolder::close (this=0x86feed0, owner=0xb79142ab "MessageListView::StorageModel", force=<value optimized out>) at /usr/src/kde4/kdepim/kmail/kmfolder.cpp:542
#19 0xb77fa767 in ~StorageModel (this=0x8edd968) at /usr/src/kde4/kdepim/kmail/messagelistview/storagemodel.cpp:186
#20 0xb784d664 in KMail::MessageListView::Core::Widget::setStorageModel (this=0x83eed48, storageModel=0x0, preSelectionMode=KMail::MessageListView::Core::PreSelectNone)
    at /usr/src/kde4/kdepim/kmail/messagelistview/core/widgetbase.cpp:315
#21 0xb77ff749 in KMail::MessageListView::Widget::setFolder (this=0x83eed48, fld=0x0, icon=@0xbfc69a38, preSelectionMode=KMail::MessageListView::Core::PreSelectNone)
    at /usr/src/kde4/kdepim/kmail/messagelistview/widget.cpp:113
#22 0xb77f779e in KMail::MessageListView::Pane::setCurrentFolder (this=0x84f77d0, fld=0x0, preferEmptyTab=false, preSelectionMode=KMail::MessageListView::Core::PreSelectNone, 
    overrideLabel=@0xbfc69a84) at /usr/src/kde4/kdepim/kmail/messagelistview/pane.cpp:204
#23 0xb76fb6eb in KMMainWidget::folderSelected (this=0x83ea320, aFolder=0x85f75f0, forceJumpToUnread=false, preferNewTabForOpening=<value optimized out>)
    at /usr/src/kde4/kdepim/kmail/kmmainwidget.cpp:3021
#24 0xb76fb84f in KMMainWidget::slotFolderViewManagerFolderActivated (this=0x83ea320, fld=0x85f75f0, middleClick=<value optimized out>) at /usr/src/kde4/kdepim/kmail/kmmainwidget.cpp:2884
#25 0xb7706669 in KMMainWidget::qt_metacall (this=0x83ea320, _c=QMetaObject::InvokeMetaMethod, _id=161, _a=0xbfc69bb8) at /usr/src/kde4/build/kdepim/kmail/kmmainwidget.moc:509
#26 0xb723d2f1 in QMetaObject::activate () from /usr/lib/qt4/libQtCore.so.4
#27 0xb723d8a3 in QMetaObject::activate () from /usr/lib/qt4/libQtCore.so.4
#28 0xb751965a in KMail::FolderViewManager::folderActivated (this=0x875d168, _t1=0x85f75f0, _t2=false) at /usr/src/kde4/build/kdepim/kmail/folderview.moc:89
#29 0xb751bf1e in KMail::FolderViewManager::viewFolderActivated (this=0x875d168, view=0x88fa760, fld=0x85f75f0, middleButton=<value optimized out>) at /usr/src/kde4/kdepim/kmail/folderview.cpp:149
#30 0xb7520af6 in KMail::FolderView::activateItemInternal (this=0x88fa760, fvi=0x8aee640, keepSelection=false, notifyManager=true, middleButton=<value optimized out>)
    at /usr/src/kde4/kdepim/kmail/folderview.cpp:999
#31 0xb7519273 in KMail::FolderView::activateItem (this=0x88fa760, fvi=0x8aee640, keepSelection=<value optimized out>, middleButton=<value optimized out>)
    at /usr/src/kde4/kdepim/kmail/folderview.cpp:976
#32 0xb751c661 in KMail::FolderView::slotItemClicked (this=0x88fa760, item=0x8aee648, column=0) at /usr/src/kde4/kdepim/kmail/folderview.cpp:529
#33 0xb7523b88 in KMail::FolderView::qt_metacall (this=0x88fa760, _c=QMetaObject::InvokeMetaMethod, _id=13, _a=0xbfc69db8) at /usr/src/kde4/build/kdepim/kmail/folderview.moc:204
#34 0xb7529043 in KMail::MainFolderView::qt_metacall (this=0x88fa760, _c=QMetaObject::InvokeMetaMethod, _id=139, _a=0xbfc69db8) at /usr/src/kde4/build/kdepim/kmail/mainfolderview.moc:64
#35 0xb723d2f1 in QMetaObject::activate () from /usr/lib/qt4/libQtCore.so.4
#36 0xb723d8a3 in QMetaObject::activate () from /usr/lib/qt4/libQtCore.so.4
#37 0xb6f7018a in QTreeWidget::itemClicked () from /usr/lib/qt4/libQtGui.so.4
#38 0xb6f73ea5 in ?? () from /usr/lib/qt4/libQtGui.so.4
#39 0x088fa760 in ?? ()
#40 0x08aee648 in ?? ()
#41 0x00000000 in ?? ()
Comment 5 Josh Berry 2009-03-02 21:46:22 UTC
I think this may be a cross-platform compatibility issue.

My KMail will no longer start (that is, it crashes consistently) due to this bug.  I recently converted from 64- to 32-bit on my system, and did not see this bug before then.  I noticed something interesting in the debug output before the crash:

kmail(25014) KMFolderIndex::updateIndexStreamPtr: utime( "/home/des/.kde4/share/apps/kmail/imap/.2000640747.directory/.INBOX.directory/.backup.index.ids" , 0) failed (KMMsgDict::getFolderIdsLocation( *this )) 
kmail(25014) KMFolderIndex::readIndexHeader: Index File sizeOfLong is 8  while sizeof(long) is 4  !
kmail: /usr/src/kde4/kdepim/kmail/kmmsgbase.cpp:1048: off_t KMMsgBase::getLongPart(KMMsgBase::MsgPartType) const: Assertion `sizeOfLong == len' failed.
Comment 6 Johan Thelmen 2009-03-15 12:04:10 UTC
Try delete the index file and then if possible and ok for you upgrade to jaunty with QT 4.5, KDE 4.2.1 and see if the problem is still there. It fixed a similar problem for me then switching to another message to fast. In bug 180741

Maybe another bug should be opened about the 64bit index problem or change the subject for this one.

Just a suggestion.
Comment 7 Johan Thelmen 2009-03-15 17:38:49 UTC
Hi
Found bug 113517 for crash with unclean indexes and different endianess or the 32 bits to 64 bits machine move. So please post that part over there.
Comment 8 Dario Andres 2009-04-01 23:18:19 UTC
*** Bug 188616 has been marked as a duplicate of this bug. ***
Comment 9 Dario Andres 2009-05-11 23:52:15 UTC
*** Bug 192311 has been marked as a duplicate of this bug. ***
Comment 10 Myriam Schweingruber 2012-08-19 11:05:52 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