Bug 178718 - KMail crashes on changing folders
Summary: KMail crashes on changing folders
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 182521 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-25 12:13 UTC by Tobias Leupold
Modified: 2009-03-19 00:37 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The valgrind output of KMail's crash (47.90 KB, text/plain)
2009-01-18 17:40 UTC, Tobias Leupold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Leupold 2008-12-25 12:13:40 UTC
Version:           4.1.85 (using Devel)
Compiler:          gcc-4.3.2 
OS:                Linux
Installed from:    Compiled sources

KDE 4.1.85's KMail crashes often for me when changing folders. At the moment, I have a reproducible situation. I access the inbox, mark the emails there as read, access another folder and do the same there. Now, wenn I access the inbox again, KMail crashes, every time. I did enable the debug use flag, but the crash manager also crashes while backtracing. So I can only post what the console output says:

kmail(14068) KMail::MessageListView::Core::Model::viewItemJobStepInternal: Emitted layoutChanged()
kmail(14068) KMail::MessageListView::Core::Model::viewItemJobStepInternal: EXPANDING THE TREE TOOK  0  MSECS
kmail(14068)/kmail (storage internals) KMFolderMaildir::reallyDoClose: fclose(mIndexStream =  0x8633870 )
QPaintEngine::setSystemClip: Should not be changed while engine is active
QPaintEngine::setSystemClip: Should not be changed while engine is active
QWidgetPrivate::beginSharedPainter: Painter is already active
*** KMail got signal 11 (Crashing)
KCrash: Application 'kmail' crashing...
sock_file=/home/tobias/.kde4/socket-schleppi/kdeinit4__0

I hope that I can manage to attach a real backtrace of the crash here, but at the moment, I just don't know how ...
Comment 1 Tobias Leupold 2009-01-01 17:49:57 UTC
After rebuilding some more libraries, I can also post the backtrace of the crash manager. The crash can still be reproduced by changing some folders in a particular order.

The following backtrace always appears:

Anwendung: KMail (kmail), Signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".

Thread 1 (Thread 0xb44a4700 (LWP 8779)):
#0  0xb80d9424 in __kernel_vsyscall ()
#1  0xb500bb76 in nanosleep () from /lib/libc.so.6
#2  0xb500b98f in sleep () from /lib/libc.so.6
#3  0xb7fc317d in ?? () from /usr/lib/libkdeui.so.5
#4  0x00000000 in ?? ()
Comment 2 Jaime Torres 2009-01-09 18:13:19 UTC
If you are still able to reproduce the crash, 
to have a usefull bactrace, compile at least kdelibs and kdepim using 
-DCMAKE_BUILD_TYPE=debug or even fulldebug.

http://techbase.kde.org/Getting_Started/Build/KDE4 

Comment 3 Tobias Leupold 2009-01-10 17:47:43 UTC
I set the "debug" use flag for all KDE 4 ebuilds. This adds "-DCMAKE_BUILD_TYPE=Debugfull". When the 4.1.96 sources are online (at the moment, there are just the 4.1.96 ebuilds), I'll build them and try to reproduce the crash.
Comment 4 Tobias Leupold 2009-01-18 12:52:37 UTC
The problem still exists in RC1 (4.1.96). I setup KMail and downloaded about 5000 Mails, organized them, etc. -- just worked with KMail. And still, there were reproduceable situations where KMail crashed when changing Folders. Two types of backtraces were produced:

either:

Anwendung: KMail (kmail), Signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".
[Current thread is 0 (LWP 3287)]

Thread 2 (Thread 0xb0699b90 (LWP 3290)):
#0  0xb7ef9424 in __kernel_vsyscall ()
#1  0xb6567b7c in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb65dddfc in QWaitCondition::wait () from /usr/lib/qt4/libQtCore.so.4
#3  0xb65d44ba in ?? () from /usr/lib/qt4/libQtCore.so.4
#4  0xb65dcf72 in ?? () from /usr/lib/qt4/libQtCore.so.4
#5  0xb6564080 in start_thread () from /lib/libpthread.so.0
#6  0xb59dcefe in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb41f6700 (LWP 3287)):
#0  0xb7ef9424 in __kernel_vsyscall ()
#1  0xb59a7b76 in nanosleep () from /lib/libc.so.6
#2  0xb59a798f in sleep () from /lib/libc.so.6
#3  0xb7de2a3d in ?? () from /usr/lib/libkdeui.so.5
#4  0x00000000 in ?? ()


or:

Anwendung: KMail (kmail), Signal SIGSEGV
Using host libthread_db library "/lib/libthread_db.so.1".

Thread 1 (Thread 0xb4217700 (LWP 3029)):
#0  0xb7f1a424 in __kernel_vsyscall ()
#1  0xb59c8b76 in nanosleep () from /lib/libc.so.6
#2  0xb59c898f in sleep () from /lib/libc.so.6
#3  0xb7e03a3d in ?? () from /usr/lib/libkdeui.so.5
#4  0x00000000 in ?? ()


I had 10 crashes, the backtrace was always one of those.
Comment 5 George Kiagiadakis 2009-01-18 16:12:24 UTC
These backtraces are not complete. They do not show the thread that actually crashes, they show other threads...

Now, are you using IMAP? if this is the case, it might be a duplicate of bug 179765. Try a more recent version (>= r908525) and tell us if it persists. Thanks.
Comment 6 Tobias Leupold 2009-01-18 16:51:11 UTC
I don't use IMAP. The folders are all local maildirs.

How can I get a complete backtrace? Are there any packages that have to be built with debug symbols other than KDE, Qt and glibc?
Comment 7 George Kiagiadakis 2009-01-18 16:57:56 UTC
Maybe try running kmail inside gdb or valgrind and get the output from there.

For valgrind:
$ valgrind kmail --nofork

For gdb:
$ gdb kmail
(gdb) run --nofork
and when it crashes:
(gdb) bt
Comment 8 Tobias Leupold 2009-01-18 17:39:48 UTC
For gdb, the backtrace is:

#0  0xb5e5aa8e in QPainter::worldMatrixEnabled () from /usr/lib/qt4/libQtGui.so.4
#1  0xb5dbc96e in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#2  0xb5dbd343 in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#3  0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#4  0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#5  0xb5dbc76f in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#6  0xb5dbd343 in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#7  0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#8  0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#9  0xb5dbc76f in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#10 0xb5dbd343 in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#11 0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#12 0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#13 0xb5dbc76f in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#14 0xb5dbd343 in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#15 0xb5dbc76f in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#16 0xb5dbd343 in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#17 0xb5dbd23f in QWidgetPrivate::paintSiblingsRecursive () from /usr/lib/qt4/libQtGui.so.4
#18 0xb5dbc76f in QWidgetPrivate::drawWidget () from /usr/lib/qt4/libQtGui.so.4
#19 0xb5f173fe in ?? () from /usr/lib/qt4/libQtGui.so.4
#20 0xb5f1910c in ?? () from /usr/lib/qt4/libQtGui.so.4
#21 0xb5dc3ce1 in QWidget::event () from /usr/lib/qt4/libQtGui.so.4
#22 0xb610d331 in QMainWindow::event () from /usr/lib/qt4/libQtGui.so.4
#23 0xb7f32795 in KMainWindow::event () from /usr/lib/libkdeui.so.5
#24 0x00000000 in ?? ()

I really don't know what all the stuff valgrind outputted means -- I'll attach all the output.
Comment 9 Tobias Leupold 2009-01-18 17:40:37 UTC
Created attachment 30393 [details]
The valgrind output of KMail's crash
Comment 10 Jaime Torres 2009-01-19 11:46:35 UTC
I guess you are using gentoo (for the use flag).

This bug probably is a duplication of bug 174065, unless you can confirm that the Qt version you have uses the patch 0256-fix-recursive-backingstore-sync-crash.diff
(available in KDE qt-copy repository)
Comment 11 Tobias Leupold 2009-01-19 15:59:24 UTC
To be honest, I don't know if this patch is applied, as Gentoo seems to split up Qt to several ebuilds. I just rebuilt the latest version of Qt and kdelibs, etc. to be sure everything is okay (perhaps, there is/was something messed up with my Qt?).
I'll try to reproduce the error and if it still exists, I'll find out if this patch is applied. If not, this is perhaps a Gentoo issue, not a KDE one.
Comment 12 Tobias Leupold 2009-01-21 10:56:47 UTC
After rebuilding Qt (and probably fixing some inconsistent eralier installation?), kdelibs and kmail, I could not reproduce the crash anymore. So I think this problem was Gentoo-related and has been fixed in the meantime.

I set this to FIXED; if kmail will still crash, I'll find out if that qt patch is applied and if not, I could re-open this Bug.

Thanks for your help :-)
Comment 13 Tobias Leupold 2009-01-26 20:31:33 UTC
KMail still crashes like described above (but didn't for a few days ;-)

I'll find out if the patch you mentionned is applied in Gentoo and report it here.
Comment 14 Tobias Leupold 2009-01-31 10:28:21 UTC
Actually, this was a Gentoo problem which is fixed now: http://bugs.gentoo.org/show_bug.cgi?id=256462

Thanks a lot, guys :-)
Comment 15 Dario Andres 2009-01-31 13:28:30 UTC
*** Bug 182521 has been marked as a duplicate of this bug. ***