Bug 227496

Summary: kmail always crashes when opening a certain mail (in preview mode)
Product: [Applications] kontact Reporter: jansen
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: crash CC: h.becker, simberger, tassilo
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
The email that crashes KMail
New crash information added by DrKonqi
New crash information added by DrKonqi
Stacktrace from KCrashHandler

Description jansen 2010-02-18 11:25:54 UTC
Application: kontact (4.4)
KDE Platform Version: 4.4.00 (KDE 4.4.0) "release 224"
Qt Version: 4.6.2
Operating System: Linux 2.6.31.12-0.1-desktop x86_64
Distribution: "openSUSE 11.2 (x86_64)"

-- Information about the crash:
KMail (from KDE SC 4.4, as in openSUSE Factory from this morning) always crahes with the attached stack trace when I open a certain mail in my IMAP (GroupWise 8) inbox. "Opening" here means clicking on it in the list to get it displayed in the preview area.

The crash can be reproduced every time.

 -- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
[KCrash Handler]
#5  0x00007fa705db6d40 in QTreeWidgetItem::addChild(QTreeWidgetItem*) () from /usr/lib64/libQtGui.so.4
#6  0x00007fa705db7143 in QTreeWidgetItem::QTreeWidgetItem(QTreeWidgetItem*, int) () from /usr/lib64/libQtGui.so.4
#7  0x00007fa6eed3d2a9 in KMMimePartTreeItem::KMMimePartTreeItem (this=0x1e5cdd0, parent=0x1df9700, node=0x1882000, description=..., mimetype=..., encoding=..., size=0, revertOrder=false)
    at /usr/src/debug/kdepim-4.4.0/kmail/kmmimeparttree.cpp:378
#8  0x00007fa6eed81db3 in partNode::fillMimePartTree (this=0x1882000, parentItem=0x1e5cdd0, mimePartTree=<value optimized out>, labelDescr=<value optimized out>, labelCntType=<value optimized out>, 
    labelEncoding=<value optimized out>, size=0, revertOrder=false) at /usr/src/debug/kdepim-4.4.0/kmail/partNode.cpp:549
#9  0x00007fa6eed7067c in KMail::ObjectTreeParser::insertAndParseNewChildNode (this=0x7fff07fb1cd0, startNode=..., content=<value optimized out>, cntDesc=<value optimized out>, append=false, 
    addToTextualContent=<value optimized out>) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:232
#10 0x00007fa6eed744a0 in KMail::ObjectTreeParser::processMessageRfc822Subtype (this=0x7fff07fb1cd0, node=0x1e7ed80) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:1582
#11 0x00007fa6eed6fda1 in KMail::ObjectTreeParser::parseObjectTree (this=0x7fff07fb1cd0, node=0x1e7ed80) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:318
#12 0x00007fa6eed700c5 in KMail::ObjectTreeParser::stdChildHandling (this=0x7fff07fb1fe0, child=0x1e7e9f0) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:1278
#13 0x00007fa6eed70474 in KMail::ObjectTreeParser::processMultiPartMixedSubtype (this=0x1e5cdd0, node=<value optimized out>) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:1291
#14 0x00007fa6eed6fda1 in KMail::ObjectTreeParser::parseObjectTree (this=0x7fff07fb1fe0, node=0x1e7e8c0) at /usr/src/debug/kdepim-4.4.0/kmail/objecttreeparser.cpp:318
#15 0x00007fa6eebf2310 in KMReaderWin::parseMsg (this=0x1878d90, aMsg=0x1cea510) at /usr/src/debug/kdepim-4.4.0/kmail/kmreaderwin.cpp:1611
#16 0x00007fa6eebe8570 in KMReaderWin::displayMessage (this=0x1878d90) at /usr/src/debug/kdepim-4.4.0/kmail/kmreaderwin.cpp:1535
#17 0x00007fa6eebe8740 in KMReaderWin::updateReaderWin (this=0x1878d90) at /usr/src/debug/kdepim-4.4.0/kmail/kmreaderwin.cpp:1478
#18 0x00007fa6eebe9015 in KMReaderWin::update (this=0x1878d90, observable=<value optimized out>) at /usr/src/debug/kdepim-4.4.0/kmail/kmreaderwin.cpp:903
#19 0x00007fa6eee0f581 in KMail::ISubject::notify (this=0x1cea5e0) at /usr/src/debug/kdepim-4.4.0/kmail/isubject.cpp:33
#20 0x00007fa6eeb0c2bc in KMMessage::updateBodyPart (this=0x1cea510, partSpecifier=) at /usr/src/debug/kdepim-4.4.0/kmail/kmmessage.cpp:3185
#21 0x00007fa6eede6ef9 in KMail::ImapJob::slotGetMessageResult (this=0x1cee140, job=<value optimized out>) at /usr/src/debug/kdepim-4.4.0/kmail/imapjob.cpp:435
#22 0x00007fa6eede8abb in KMail::ImapJob::qt_metacall (this=0x1cee140, _c=InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff07fb2aa0) at /usr/src/debug/kdepim-4.4.0/build/kmail/imapjob.moc:88
#23 0x00007fa70646d78f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#24 0x00007fa7068150b2 in KJob::result(KJob*) () from /usr/lib64/libkdecore.so.5
#25 0x00007fa70681c750 in KJob::emitResult() () from /usr/lib64/libkdecore.so.5
#26 0x00007fa703c5e4e3 in KIO::SimpleJob::slotFinished (this=0x1dfb6a0) at /usr/src/debug/kdelibs-4.4.0/kio/kio/job.cpp:486
#27 0x00007fa703cf8487 in KIO::TransferJob::slotFinished (this=0x1dfb6a0) at /usr/src/debug/kdelibs-4.4.0/kio/kio/job.cpp:1058
#28 0x00007fa703ce1671 in KIO::TransferJob::qt_metacall (this=0x1dfb6a0, _c=InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff07fb2eb0)
    at /usr/src/debug/kdelibs-4.4.0/build/kio/jobclasses.moc:367
#29 0x00007fa70646d78f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#30 0x00007fa703d3a231 in KIO::SlaveInterface::dispatch (this=0x1061a20, _cmd=104, rawdata=...) at /usr/src/debug/kdelibs-4.4.0/kio/kio/slaveinterface.cpp:175
#31 0x00007fa703c20833 in KIO::SlaveInterface::dispatch (this=0x1061a20) at /usr/src/debug/kdelibs-4.4.0/kio/kio/slaveinterface.cpp:91
#32 0x00007fa703c62b06 in KIO::Slave::gotInput (this=0x1061a20) at /usr/src/debug/kdelibs-4.4.0/kio/kio/slave.cpp:324
#33 0x00007fa703c62cdc in KIO::Slave::qt_metacall (this=0x1061a20, _c=InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff07fb32d0) at /usr/src/debug/kdelibs-4.4.0/build/kio/slave.moc:82
#34 0x00007fa70646d78f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/libQtCore.so.4
#35 0x00007fa703c226e7 in KIO::ConnectionPrivate::dequeue (this=0x197a8f0) at /usr/src/debug/kdelibs-4.4.0/kio/kio/connection.cpp:82
#36 0x00007fa703c227ad in KIO::Connection::qt_metacall (this=0x13c5190, _c=InvokeMetaMethod, _id=<value optimized out>, _a=0x1e5b960) at /usr/src/debug/kdelibs-4.4.0/build/kio/connection.moc:79
#37 0x00007fa70646a6c9 in QObject::event(QEvent*) () from /usr/lib64/libQtCore.so.4
#38 0x00007fa705816e1c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#39 0x00007fa70581d3fb in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#40 0x00007fa706db8446 in KApplication::notify (this=0x7fff07fb3de0, receiver=0x13c5190, event=0x1e4a540) at /usr/src/debug/kdelibs-4.4.0/kdeui/kernel/kapplication.cpp:302
#41 0x00007fa70645a98c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#42 0x00007fa70645d107 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQtCore.so.4
#43 0x00007fa706484373 in ?? () from /usr/lib64/libQtCore.so.4
#44 0x00007fa6fdc6fdee in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#45 0x00007fa6fdc737b8 in ?? () from /usr/lib64/libglib-2.0.so.0
#46 0x00007fa6fdc738e0 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#47 0x00007fa706483eb3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#48 0x00007fa7058c551e in ?? () from /usr/lib64/libQtGui.so.4
#49 0x00007fa7064592a2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#50 0x00007fa70645967c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#51 0x00007fa70645d3cb in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#52 0x0000000000403ede in _start ()

This bug may be a duplicate of or related to bug 222216.

Possible duplicates by query: bug 227207, bug 226977, bug 222216.

Reported using DrKonqi
Comment 1 simberger 2010-02-22 13:32:36 UTC
Created attachment 41007 [details]
New crash information added by DrKonqi

This crash happens with at least two specific mails from my inbox. Both mails are large and contain embedded mails and files which were sent to me as a Fwd.

kdepim-mail package version is 4.4.0-2
Comment 2 Tassilo Horn 2010-02-23 13:49:24 UTC
Created attachment 41035 [details]
New crash information added by DrKonqi

The crash alwais happens with one mail.  The mail is a forward and the forwarded mail contains a PDF attachment.  I will attach the email to this bug report.
Comment 3 Tassilo Horn 2010-02-23 13:54:17 UTC
Created attachment 41036 [details]
The email that crashes KMail

I've exported the nasty mail via my provider's web interface.  It's a forwarded mail containing a quite big PDF attachment.
Comment 4 jansen 2010-02-23 14:40:21 UTC
The mail that caused troubles for me is also a rather complicated multipart message with a large (2.1 MB) attachment. By now I have a few other mails which are structually similar and expose the same kmail behaviour.

Using the newest packages from openSUSE Factory (kmail has the version number 4.4.0-2.2; Qt 4.6.2-2.1) kmail now no longer crashes always but still every now and then. I'll try to report another stack trace, if it's different.

The preview area, however, never shows the mail on first attempt. Sometimes clicking on another mail and then returning to a problematic mail makes it show up. Otherwise I can trigger its preview by opening the message code view.
Opening the mail in its own window works, though.
Comment 5 Tassilo Horn 2010-02-23 15:14:56 UTC
My KMail version says it's 1.13.0 (in About Kontact).  I also use qt 4.6.2.

With the mail I attached I can reproduce the crash each time.  But there are other mails where I can reproduce the effect jansen describes: the preview shows nothing, but double-clicking the mail shows it properly in a separate window.

I guess those are two different bugs.

Concerning the "no preview" thing, at least for me it's not very reproducible.  First, I get no preview for a mail, then I switch to another one and back again, and then the preview is there.  Switching around another time might again result in no proview...
Comment 6 Tassilo Horn 2010-02-24 21:01:58 UTC
I wanted to provide a more meaningfull backtrace, so I recompiled kmail with -ggdb, without strong optimization and without stripping the binary afterwards.  But it is as it always is with crashes in application written in C or C++.  As soon as you try to debug them, they will work just fine. ;-)

So with debugging flags enabled, I can preview the mails that always crashed kmail.
Comment 7 Tassilo Horn 2010-02-24 21:33:01 UTC
Argh, now I've recompiled it as usual, that is with -march=core2 -O2 and no debugging flags, AND STILL IT WORKS!

Is there a possibility that it only crashes for a certain mail when it tries to preview it for the first time (using IMAP, not disconnected IMAP)?  Maybe it caches some informations locally that prevent the crash?
Comment 8 Tassilo Horn 2010-02-25 14:10:10 UTC
Created attachment 41091 [details]
New crash information added by DrKonqi

Ok, I'm back to debugging flags, and with a new mail, kmail crashed again.  So here's a three-stars backtrace.
Comment 9 Tassilo Horn 2010-02-25 14:22:33 UTC
Created attachment 41092 [details]
New crash information added by DrKonqi

Ok, the crash is reproducible.  This backtrace was gathered when I ran kmail standalone (no kontact).

Now I have a real problem.  As soon as I select the folder containing the offending mail, it is selected automatically and kmail instantly crashes.  So that folder is basically locked for me, unfortunately, it contains important mails.  The "bad" one is one of them, so I cannot simply delete it via my provider's web interface. :-(

Any workarounds?
Comment 10 Henning Becker 2010-03-04 12:07:34 UTC
I can confirm the bug, same problem here.
If I open a specific imap folder, the problematic mail gets selected
and kmail crashes.

Regards,
Henning
Comment 11 Henning Becker 2010-03-04 12:09:21 UTC
Created attachment 41320 [details]
Stacktrace from KCrashHandler
Comment 12 Thomas McGuire 2010-03-05 11:50:50 UTC

*** This bug has been marked as a duplicate of bug 186502 ***