Bug 85175

Summary: kmail crashes when I select "View Source" to look at a message.
Product: [Applications] kmail Reporter: beirne
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: ana, michael, psychonaut
Priority: NOR    
Version: 1.9.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Kmail crashes when a "View Source" is done on this message

Description beirne 2004-07-14 14:17:51 UTC
Version:            (using KDE KDE 3.2.91)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.3.4 (Debian 1:3.3.4-3) Running Debian unstable.  
OS:                Linux

Whenever I try to view the full source of an email message by selecting "View Source" from the kmail menu or hitting the "V" key kmail crashes immediately.  I have pasted a backtrace below.  

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 25382)]
[KCrash handler]
#5  0x41d08a62 in QTextCodec::toUnicode ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#6  0x403684c7 in KMShowMsgSrcCommand::execute ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#7  0x403662da in KMCommand::slotPostTransfer ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#8  0x4035f794 in KMCommand::qt_invoke ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#9  0x40360e7d in KMShowMsgSrcCommand::qt_invoke ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#10 0x41a104cc in QObject::activate_signal ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#11 0x4035f61a in KMCommand::messagesTransfered ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#12 0x4036632d in KMCommand::transferSelectedMsgs ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#13 0x403660fb in KMCommand::slotStart ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#14 0x4035f77d in KMCommand::qt_invoke ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#15 0x40360e7d in KMShowMsgSrcCommand::qt_invoke ()
   from /extra/kde3.3-beta1/lib/libkmailprivate.so.0
#16 0x41a104cc in QObject::activate_signal ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#17 0x41d4a21a in QSignal::signal () from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#18 0x41a2a5cd in QSignal::activate ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#19 0x41a31db3 in QSingleShotTimer::event ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#20 0x419b3faf in QApplication::internalNotify ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#21 0x419b35ae in QApplication::notify ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#22 0x4153aca3 in KApplication::notify ()
   from /extra/kde3.3-beta1/lib/libkdecore.so.4
#23 0x419a3855 in QEventLoop::activateTimers ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#24 0x4195d5fb in QEventLoop::processEvents ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#25 0x419c6318 in QEventLoop::enterLoop ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#26 0x419c61c8 in QEventLoop::exec ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#27 0x419b4201 in QApplication::exec ()
   from /extra/kde3.3-beta1/lib/libqt-mt.so.3
#28 0x0804a6e4 in main ()
Comment 1 Andy Goossens 2004-07-15 00:28:08 UTC
I've got a similar crash and backtrace with latest KDE_3_2_BRANCH (a few days old):

0x420f5656 in waitpid () from /lib/i686/libpthread.so.0
#0  0x420f5656 in waitpid () from /lib/i686/libpthread.so.0
#1  0x4156a1f7 in KCrash::defaultCrashHandler(int) (sig=11)
    at /share/cvs/STABLE/kdelibs/kdecore/kcrash.cpp:246
#2  0x420f44ec in __pthread_clock_settime () from /lib/i686/libpthread.so.0
#3  0x42269ca8 in __libc_sigaction () from /lib/i686/libc.so.6
#4  0x40336258 in KMShowMsgSrcCommand::execute() (this=0x87f7ae0)
    at /share/cvs/STABLE/kdepim/kmail/kmcommands.cpp:557
#5  0x40334429 in KMCommand::slotPostTransfer(bool) (this=0x87f7ae0, 
    success=true) at /share/cvs/STABLE/kdepim/kmail/kmcommands.cpp:161
#6  0x4032fdb1 in KMCommand::qt_invoke(int, QUObject*) (this=0x87f7ae0, _id=3, 
    _o=0xbfffe950) at kmcommands.moc:121
#7  0x4033109e in KMShowMsgSrcCommand::qt_invoke(int, QUObject*) (
    this=0x87f7ae0, _id=3, _o=0xbfffe950) at kmcommands.moc:949
#8  0x419c400b in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x87f7ae0, clist=0x87f7bd8, o=0xbfffe950) at kernel/qobject.cpp:2333
#9  0x419c4971 in QObject::activate_signal_bool(int, bool) (this=0x87f7ae0, 
    signal=2, param=true) at kernel/qobject.cpp:2429
#10 0x4032fccf in KMCommand::messagesTransfered(bool) (this=0x87f7ae0, t0=true)
    at kmcommands.moc:108
#11 0x40334957 in KMCommand::transferSelectedMsgs() (this=0x87f7ae0)
    at /share/cvs/STABLE/kdepim/kmail/kmcommands.cpp:247
#12 0x403343d2 in KMCommand::preTransfer() (this=0x87f7ae0)
    at /share/cvs/STABLE/kdepim/kmail/kmcommands.cpp:153
#13 0x4033418c in KMCommand::start() (this=0x87f7ae0)
    at /share/cvs/STABLE/kdepim/kmail/kmcommands.cpp:106
#14 0x40230ee2 in KMReaderWin::slotShowMsgSrc() (this=0x8236830)
    at /share/cvs/STABLE/kdepim/kmail/kmreaderwin.cpp:2154
#15 0x4023186e in KMReaderWin::qt_invoke(int, QUObject*) (this=0x8236830, 
    _id=73, _o=0xbfffebc0) at kmreaderwin.moc:297
#16 0x419c400b in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x820acc0, clist=0x820af80, o=0xbfffebc0) at kernel/qobject.cpp:2333
#17 0x419c3eaa in QObject::activate_signal(int) (this=0x820acc0, signal=2)
    at kernel/qobject.cpp:2302
#18 0x412754ac in KAction::activated() (this=0x820acc0) at kaction.moc:157
#19 0x41274e88 in KAction::slotActivated() (this=0x820acc0)
    at /share/cvs/STABLE/kdelibs/kdeui/kaction.cpp:1057
#20 0x412757b0 in KAction::qt_invoke(int, QUObject*) (this=0x820acc0, _id=14, 
    _o=0xbfffece0) at kaction.moc:181
#21 0x419c400b in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x8659bf8, clist=0x884e608, o=0xbfffece0) at kernel/qobject.cpp:2333
#22 0x419c3eaa in QObject::activate_signal(int) (this=0x8659bf8, signal=2)
    at kernel/qobject.cpp:2302
#23 0x4155f61a in KAccelPrivate::menuItemActivated() (this=0x8659bf8)
    at kaccelprivate.moc:110
#24 0x4155dae6 in KAccelPrivate::eventFilter(QObject*, QEvent*) (
    this=0x8659bf8, pEvent=0xbffff0c0)
    at /share/cvs/STABLE/kdelibs/kdecore/kaccel.cpp:324
#25 0x419c1bf8 in QObject::activate_filters(QEvent*) (this=0x805a7b8, 
    e=0xbffff0c0) at kernel/qobject.cpp:902
#26 0x419c1a6a in QObject::event(QEvent*) (this=0x805a7b8, e=0xbffff0c0)
    at kernel/qobject.cpp:735
#27 0x419fb703 in QWidget::event(QEvent*) (this=0x805a7b8, e=0xbffff0c0)
    at kernel/qwidget.cpp:4408
#28 0x41ac236f in QMainWindow::event(QEvent*) (this=0x805a7b8, e=0xbffff0c0)
    at widgets/qmainwindow.cpp:1669
#29 0x4196124f in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbffff5f0, receiver=0x805a7b8, e=0xbffff0c0)
    at kernel/qapplication.cpp:2582
#30 0x4196086a in QApplication::notify(QObject*, QEvent*) (this=0xbffff5f0, 
    receiver=0x81e8838, e=0xbffff0c0) at kernel/qapplication.cpp:2339
#31 0x414dfc63 in KApplication::notify(QObject*, QEvent*) (this=0xbffff5f0, 
    receiver=0x81e8838, event=0xbffff0c0)
    at /share/cvs/STABLE/kdelibs/kdecore/kapplication.cpp:512
#32 0x405516d5 in QApplication::sendEvent(QObject*, QEvent*) (
    receiver=0x81e8838, event=0xbffff0c0) at qapplication.h:492
#33 0x4155c7bc in KAccelEventHandler::x11Event(_XEvent*) (this=0x81d5620, 
    pEvent=0xbffff3e0) at /share/cvs/STABLE/kdelibs/kdecore/kaccel.cpp:114
#34 0x414f044b in KAppX11HackWidget::publicx11Event(_XEvent*) (this=0x81d5620, 
    e=0xbffff3e0) at /share/cvs/STABLE/kdelibs/kdecore/kapplication.cpp:1534
#35 0x414e4535 in KApplication::x11EventFilter(_XEvent*) (this=0xbffff5f0, 
    _event=0xbffff3e0)
    at /share/cvs/STABLE/kdelibs/kdecore/kapplication.cpp:1622
#36 0x418e5f9b in qt_x11EventFilter (ev=0xbffff3e0)
    at kernel/qapplication_x11.cpp:378
#37 0x418eecd0 in QApplication::x11ProcessEvent(_XEvent*) (this=0xbffff5f0, 
    event=0xbffff3e0) at kernel/qapplication_x11.cpp:3274
#38 0x419090e0 in QEventLoop::processEvents(unsigned) (this=0x811a218, flags=4)
    at kernel/qeventloop_x11.cpp:192
#39 0x41976d72 in QEventLoop::enterLoop() (this=0x811a218)
    at kernel/qeventloop.cpp:198
#40 0x41976c8e in QEventLoop::exec() (this=0x811a218)
    at kernel/qeventloop.cpp:145
#41 0x419613cf in QApplication::exec() (this=0xbffff5f0)
    at kernel/qapplication.cpp:2705
#42 0x0804a6c5 in main (argc=7, argv=0xbffff764)
    at /share/cvs/STABLE/kdepim/kmail/main.cpp:115
#43 0x42256c57 in __libc_start_main () from /lib/i686/libc.so.6
Comment 2 Till Adam 2004-07-15 11:02:19 UTC
Does this happen with any mail, or just some? If the later, can you attach one of those mails to this bug report, please, so I can try to reproduce and fix the problem?
Comment 3 beirne 2004-07-15 13:29:11 UTC
Created attachment 6684 [details]
Kmail crashes when a "View Source" is done on this message

The body of this sample message is empty, but kmail also crashes when viewing
the source of some messages with content.
Comment 4 beirne 2004-07-15 13:30:19 UTC
It turns out that only some messages cause the crash.  Kmail doesn't crash, for example, when I try to view the source of the bug update notifications.  I tried moving a crashing message from an mbox folder to a maildir folder and got the same behavior.  I also took a brief look at each type of message but didn't see an obvious difference.  I'm hoping it becomes clearer with the attached message, which causes kmail to crash when viewed.
Comment 5 Till Adam 2004-07-15 18:20:46 UTC
Thanks for the test mail. I can't reproduce the crash with current cvs (3.3 branch, not 3.2), so hopefully the issue you are seeing has been resolved. Is there a chance that either of you could verify that the issue is indeed fixed by compiling kdepim from cvs, or maybe testing with the beta2, once it is out?
Comment 6 beirne 2004-07-19 14:30:53 UTC
I've had bad luck getting the beta to build.  I may end up waiting for beta2 to test again.
Comment 7 A. Pfaller 2004-08-05 00:38:30 UTC
Also happens with self compiled kmail from current KDE_3_2_BRANCH.
Backing out patch from 1.99.2.5 to 1.99.2.6 of kmcommands.cpp fixes
this. I got the crash with all mails I tried (5 from different mbox
folders).
Comment 8 Adeodato Simó 2004-08-08 15:19:56 UTC
In KDE_3_3_BRANCH, this was fixed on rev. 1.156 of kmcommands.cpp. I'm hereby asking for the backport of this fix to 3_2_BRANCH. I can do it myself if developers are short of time with 3.3 polishing.

Thanks,
Comment 9 Till Adam 2004-08-08 16:50:39 UTC
I'm told there probably wont be another 3.2.x release and the crash is fixed in 3.3 and later, I'll therefore close this bug. We don't have the resources to maintain more than one stable version and 3.3 is the new stable version (or will be very shortly). Thanks for understanding.
Comment 10 Till Adam 2004-08-09 15:28:17 UTC
*** Bug 86849 has been marked as a duplicate of this bug. ***
Comment 11 Michael van Gemmern 2004-08-09 16:01:16 UTC
Because my example isn´t shown here:

my kmail1.6.82(kde3.3beta1) crashes when "charset=us-ascii" is in the header of the mail. Three is no problem with any other charset. Mine is iso-8859-15 (locale).
Comment 12 Siddhesh Poyarekar 2006-04-18 12:48:34 UTC
Seems like this bug has crept up again. I am getting the same error, this time on the following specs:

i386 binary package dist-upgrade'd from debian sid
KDE 3.5.2
KMail 1.9.1
Debian unstable

This happens with all the random messages I tried on.

Steps for reproduction:

1) Start KMail
2) Click on "View > View Source" menu


Here's the backtrace, if it's useful at all:


(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1248810784 (LWP 24188)]
[New Thread -1275548752 (LWP 24192)]
[New Thread -1267160144 (LWP 24191)]
[New Thread -1258771536 (LWP 24190)]
[New Thread -1250382928 (LWP 24189)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[KCrash handler]
#5  0xb7e39263 in KMMainWidget::slotShowMsgSrc ()
   from /usr/lib/libkmailprivate.so
#6  0xb7e5042d in KMMainWidget::qt_invoke () from /usr/lib/libkmailprivate.so
#7  0xb712454b in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#8  0xb7124fdc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#9  0xb5ec5e99 in KAction::activated () from /usr/lib/libkdeui.so.4
#10 0xb5f00031 in KAction::slotActivated () from /usr/lib/libkdeui.so.4
#11 0xb5f1f0fe in KAction::slotPopupActivated () from /usr/lib/libkdeui.so.4
#12 0xb5f1f3d1 in KAction::qt_invoke () from /usr/lib/libkdeui.so.4
#13 0xb712454b in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#14 0xb74b61a9 in QSignal::signal () from /usr/lib/libqt-mt.so.3
#15 0xb7141c4c in QSignal::activate () from /usr/lib/libqt-mt.so.3
#16 0xb7249419 in QPopupMenu::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#17 0xb5ed3211 in KPopupMenu::mouseReleaseEvent () from /usr/lib/libkdeui.so.4
#18 0xb715ec78 in QWidget::event () from /usr/lib/libqt-mt.so.3
#19 0xb70ba87a in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#20 0xb70badff in QApplication::notify () from /usr/lib/libqt-mt.so.3
#21 0xb77c402e in KApplication::notify () from /usr/lib/libkdecore.so.4
#22 0xb704c06f in QApplication::sendSpontaneousEvent ()
   from /usr/lib/libqt-mt.so.3
#23 0xb70474f1 in QETWidget::translateMouseEvent ()
   from /usr/lib/libqt-mt.so.3
#24 0xb7045c94 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#25 0xb705f2a2 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#26 0xb70d3255 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#27 0xb70d317a in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#28 0xb70b938d in QApplication::exec () from /usr/lib/libqt-mt.so.3
#29 0x0804a098 in ?? ()
#30 0xbfed5df8 in ?? ()
#31 0xbfed5fe4 in ?? ()
#32 0x00000000 in ?? ()
Comment 13 Michal Seweryniak 2006-04-20 20:58:11 UTC
I've got the same crash as in Comment #12 at Opensuse 10.0 + KDE 3.5.2 + Kmail 1.9.1 (from Suse RPM). It happens for every message. 
To reproduce: 
before you go to menu View/View Source, first you need to switch off the message preview panel in Kmail configuration. The crash doesn't happen when the message preview panel is on.

BTW
Why the status is 'RESOLVED'? It's unresolved in my opinion.
Comment 14 Siddhesh Poyarekar 2006-04-20 21:10:37 UTC
> BTW
> Why the status is 'RESOLVED'? It's unresolved in my opinion.

I guess the status is such because the bug was closed previously. I
guess it needs to be re-opened or a new bug filed. Strange that none
of the maintainers have responded yet.

Siddhesh

--
http://siddhesh.tk
Comment 15 Ismail Onur Filiz 2006-04-20 21:37:35 UTC
Sorry about not responding earlier, I had reopening this bug in mind, but I forgot. By the way, I was able to reproduce the bug with using the description in comment 13. Thanks for that Michal.
Comment 16 Ismail Onur Filiz 2006-04-23 11:58:42 UTC
SVN commit 532913 by onurf:

Fix crash when trying to view source while the Message Preview Pane is hidden.

BUG: 85175



 M  +2 -1      kmmainwidget.cpp  


--- branches/KDE/3.5/kdepim/kmail/kmmainwidget.cpp #532912:532913
@@ -2863,7 +2863,8 @@
 //-----------------------------------------------------------------------------
 void KMMainWidget::slotShowMsgSrc()
 {
-  mMsgView->setUpdateAttachment( false );  
+  if ( mMsgView )
+    mMsgView->setUpdateAttachment( false );  
   KMMessage *msg = mHeaders->currentMsg();
   if ( !msg )
     return;
Comment 17 Ismail Onur Filiz 2006-04-23 12:08:26 UTC
SVN commit 532918 by onurf:

Forward port 532913:

Fix crash when trying to view source while the Message Preview Pane is hidden.

CCBUG: 85175



 M  +3 -1      kmmainwidget.cpp  


--- trunk/KDE/kdepim/kmail/kmmainwidget.cpp #532917:532918
@@ -2894,7 +2894,9 @@
 //-----------------------------------------------------------------------------
 void KMMainWidget::slotShowMsgSrc()
 {
-  mMsgView->setUpdateAttachment( false );
+  if ( mMsgView )
+    mMsgView->setUpdateAttachment( false );
+
   KMMessage *msg = mHeaders->currentMsg();
   if ( !msg )
     return;