Bug 188219 - kmail crash when compact folder, mark all messages as read, then choose a new message
Summary: kmail crash when compact folder, mark all messages as read, then choose a new...
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: new message list (show other bugs)
Version: 1.11.1
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Szymon Stefanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-27 02:37 UTC by martinrs
Modified: 2009-07-03 03:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch ported to KDE 4.2 branch (4.94 KB, patch)
2009-07-03 03:16 UTC, S. Umar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description martinrs 2009-03-27 02:37:28 UTC
Version:            (using KDE 4.2.1)
Compiler:          gcc 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) 
OS:                Linux
Installed from:    Fedora RPMs

Running Fedora 10 x64 with kde-4.2.1, qt-4.4.3, kmail 1.11.1 from rpm.

In kmail, if I do the following,

  left-click on a mbox folder -> compact folder
  left-click on same folder -> Mark all messages read

none of the new messages are marked as read. If I click on a message in the list, it crashes with the following bug report below.

I also tried deleting .folder.index, .folder.index.ids and let kmail re-create it. the same problem.

Kmail also complains about utime(FILEPATH,0) failing at startup. I wonder if it has anything to do with NFS-mounted Mail directory.

The crash is always consistent with any mbox file, and the smallest mbox file I tried has only one read and one unread message, total 4kbytes.

Added info: Even if the folder has only one read message, if I do compact folder, then choose the message, it crashes.

Application: KMail (kmail), signal SIGSEGV
[?1034h[Thread debugging using libthread_db enabled]
0x0000003b7aaa7f50 in __nanosleep_nocancel () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7fc06dd3b800 (LWP 32761))]

Thread 1 (Thread 0x7fc06dd3b800 (LWP 32761)):
[KCrash Handler]
#5  KMail::MessageListView::Widget::getSelectionStats (this=0x2f1dfb0, selectedSernums=@0x7fff75d9ad00, selectedVisibleSernums=@0x7fff75d9acf0, allSelectedBelongToSameThread=0x7fff75d9ad1f, 
    includeCollapsedChildren=<value optimized out>) at /usr/src/debug/kdepim-4.2.1/kmail/messagelistview/widget.cpp:579
#6  0x0000003b97d8429e in KMMainWidget::updateMessageActions (this=0x2661470) at /usr/src/debug/kdepim-4.2.1/kmail/kmmainwidget.cpp:4288
#7  0x0000003b97d9b175 in KMMainWidget::qt_metacall (this=0x2661470, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff75d9ae20)
    at /usr/src/debug/kdepim-4.2.1/x86_64-redhat-linux-gnu/kmail/kmmainwidget.moc:363
#8  0x0000003b7a556764 in QMetaObject::activate () from /usr/lib64/libQtCore.so.4
#9  0x0000003b7a551073 in QObject::event () from /usr/lib64/libQtCore.so.4
#10 0x0000003b87f828dd in QApplicationPrivate::notify_helper () from /usr/lib64/libQtGui.so.4
#11 0x0000003b87f8a68a in QApplication::notify () from /usr/lib64/libQtGui.so.4
#12 0x0000003b89004f3b in KApplication::notify () from /usr/lib64/libkdeui.so.5
#13 0x0000003b7a542391 in QCoreApplication::notifyInternal () from /usr/lib64/libQtCore.so.4
#14 0x0000003b7a56e0d6 in ?? () from /usr/lib64/libQtCore.so.4
#15 0x0000003b7a56a83d in ?? () from /usr/lib64/libQtCore.so.4
#16 0x0000003b7d23779b in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#17 0x0000003b7d23af6d in ?? () from /lib64/libglib-2.0.so.0
#18 0x0000003b7d23b12b in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#19 0x0000003b7a56a79f in QEventDispatcherGlib::processEvents () from /usr/lib64/libQtCore.so.4
#20 0x0000003b8801328f in ?? () from /usr/lib64/libQtGui.so.4
#21 0x0000003b7a540cb2 in QEventLoop::processEvents () from /usr/lib64/libQtCore.so.4
#22 0x0000003b7a540e3d in QEventLoop::exec () from /usr/lib64/libQtCore.so.4
#23 0x0000003b7a5432ed in QCoreApplication::exec () from /usr/lib64/libQtCore.so.4
#24 0x0000000000402b5b in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdepim-4.2.1/kmail/main.cpp:146
Comment 1 martinrs 2009-03-27 02:52:37 UTC
Adding more debuginfo, here is a more detailed bug report.

Application: KMail (kmail), signal SIGSEGV
[?1034h[Thread debugging using libthread_db enabled]
0x0000003b7aaa7f50 in __nanosleep_nocancel () from /lib64/libc.so.6
[Current thread is 1 (Thread 0x7f888c18b800 (LWP 784))]

Thread 1 (Thread 0x7f888c18b800 (LWP 784)):
[KCrash Handler]
#5  KMail::MessageListView::Widget::getSelectionStats (this=0x1fdb3e0, selectedSernums=@0x7fff941e8170, selectedVisibleSernums=@0x7fff941e8160, allSelectedBelongToSameThread=0x7fff941e818f, 
    includeCollapsedChildren=<value optimized out>) at /usr/src/debug/kdepim-4.2.1/kmail/messagelistview/widget.cpp:579
#6  0x0000003b97d8429e in KMMainWidget::updateMessageActions (this=0x25629c0) at /usr/src/debug/kdepim-4.2.1/kmail/kmmainwidget.cpp:4288
#7  0x0000003b97d9b175 in KMMainWidget::qt_metacall (this=0x25629c0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff941e8290)
    at /usr/src/debug/kdepim-4.2.1/x86_64-redhat-linux-gnu/kmail/kmmainwidget.moc:363
#8  0x0000003b7a556764 in QMetaObject::activate (sender=0x7f888312e500, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x7f887db098f0) at kernel/qobject.cpp:3031
#9  0x0000003b7a551073 in QObject::event (this=0x7f888312e500, e=0x0) at kernel/qobject.cpp:1120
#10 0x0000003b87f828dd in QApplicationPrivate::notify_helper (this=0x1ddfc30, receiver=0x7f888312e500, e=0x7fff941e8940) at kernel/qapplication.cpp:3803
#11 0x0000003b87f8a68a in QApplication::notify (this=0x7fff941e8da0, receiver=0x7f888312e500, e=0x7fff941e8940) at kernel/qapplication.cpp:3768
#12 0x0000003b89004f3b in KApplication::notify (this=0x7fff941e8da0, receiver=0x7f888312e500, event=0x7fff941e8940) at /usr/src/debug/kdelibs-4.2.1/kdeui/kernel/kapplication.cpp:307
#13 0x0000003b7a542391 in QCoreApplication::notifyInternal (this=0x7fff941e8da0, receiver=0x7f888312e500, event=0x7fff941e8940) at kernel/qcoreapplication.cpp:587
#14 0x0000003b7a56e0d6 in QCoreApplication::sendEvent () at ../../src/corelib/kernel/qcoreapplication.h:209
#15 QTimerInfoList::activateTimers (this=0x1de30f0) at kernel/qeventdispatcher_unix.cpp:557
#16 0x0000003b7a56a83d in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:160
#17 0x0000003b7d23779b in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#18 0x0000003b7d23af6d in ?? () from /lib64/libglib-2.0.so.0
#19 0x0000003b7d23b12b in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#20 0x0000003b7a56a79f in QEventDispatcherGlib::processEvents (this=0x1ddfb60, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:319
#21 0x0000003b8801328f in QGuiEventDispatcherGlib::processEvents (this=0x25bc6e0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:198
#22 0x0000003b7a540cb2 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:143
#23 0x0000003b7a540e3d in QEventLoop::exec (this=0x7fff941e8bf0, flags=) at kernel/qeventloop.cpp:194
#24 0x0000003b7a5432ed in QCoreApplication::exec () at kernel/qcoreapplication.cpp:845
#25 0x0000000000402b5b in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdepim-4.2.1/kmail/main.cpp:146
Comment 2 martinrs 2009-03-27 02:57:52 UTC
More info. Here are messages that appear at the console if I run kmail from command line and when it crashes:

kdeinit4: preparing to launch 
kdeinit4: preparing to launch 
QPainter::begin: Widget painting can only begin as a result of a paintEvent
QPainter::setWorldTransform: Painter not active
kmail(880) KMail::MessageListView::StorageModel::releaseMessage: Trying to release a message at row  7  that no longer exists in the folder 
*** KMail got signal 11 (Crashing)
KCrash: Application 'kmail' crashing...
sock_file=/home/user/.kde/socket-hostname/kdeinit4__0
kdeinit4: preparing to launch /usr/libexec/kde4/drkonqi
Comment 3 Dario Andres 2009-03-27 13:18:18 UTC
Bug 186940 seens to have a similar backtrace.
Comment 4 Szymon Stefanek 2009-06-11 04:31:17 UTC
SVN commit 980061 by stefanek:

Possibly fix the issues with the folder being closed by
the compaction jobs (and thus various asserts triggering
in the StorageModel code).

Not totally sure that all the bugs I'm closing had exactly
the same cause (though the backtrace is exactly the same).
If you still can reproduce the bug please reopen ONE of
these.

BUG: 186940
BUG: 188219
BUG: 194960
BUG: 195893




 M  +4 -0      folderstorage.h  
 M  +1 -0      kmfolder.cpp  
 M  +4 -0      kmfolder.h  
 M  +1 -0      kmfoldermaildir.cpp  
 M  +3 -1      kmfoldermbox.cpp  
 M  +2 -0      messagelistview/core/model.cpp  
 M  +1 -0      messagelistview/core/view.cpp  
 M  +17 -1     messagelistview/storagemodel.cpp  
 M  +5 -0      messagelistview/storagemodel.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=980061
Comment 5 S. Umar 2009-07-03 03:08:40 UTC
This problem also exists for KDE 4.2.4 but the patches above are
for KDE 4.3. I have applied them to KDE 4.2.4 with only one line
modified in view.cpp and it seems to work.

Any plans to port it to KDE-4.2.4 officially so we can convince
the distributions to apply the patch?

I filed this bug #196763 which should be added to the above list.
Thanks
Comment 6 S. Umar 2009-07-03 03:16:02 UTC
Created attachment 35008 [details]
Patch ported to KDE 4.2 branch

The original author needs the certify that this is correect!