Bug 76730 - kmail crashes while loading an email with attached jpeg from imap
Summary: kmail crashes while loading an email with attached jpeg from imap
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: encryption (show other bugs)
Version: 1.6
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 84306 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-04 15:08 UTC by Reto Hotz
Modified: 2007-09-14 12:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reto Hotz 2004-03-04 15:08:41 UTC
Version:           1.6 (using KDE 3.2.0, Gentoo)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)
OS:          Linux (i686) release 2.6.4-rc1-love1

Another nice crash with imap and/or s/mime:
- First I start kmail
- The selected folder is my local inbox.
- Then I click on the imap-inbox and kmail starts downloading the current message.
- after 50% displayed download-size kmail closes itself *without* a  backtrace.

So I compiled kdepim new with enable-debug=full to get some more informations. Have a look at the console output at the end of this report.

Some informations about the mail who makes kmail crash:
- it was a forwarded mail.
- the original mail has a jpeg attachment.
- the forwarded mail has a s/mime signature, but not the original mail.

The crash is 100% reproduceable.

Hope this help you find the bug.

Greetings
Reto

bash-2.05b$ kmail
libkdenetwork: creating new pgp object
libkdenetwork: Kpgp: gpg found
kmail: No Qt-native utf-7 codec found; registering QUtf7Codec from libkdenetwork
libkdenetwork: Loaded crypto plugin OpenPGP at location /usr/lib/cryptplug/gpgme-openpgp.so
libkdenetwork: Loaded crypto plugin SMIME at location /usr/lib/cryptplug/gpgme-smime.so
kmail: instantating IdentityManager
kmail: KMIdentity::readConfig(): UOID = 474327333 for identity named "Default"
kmail: pPopFilter set
kmail: KMKernel::openReader called
kdecore (KAccel): WARNING: KKeySequence::init( seq ): key[0] is null.
kdecore (KAccel): WARNING: KKeySequence::init( seq ): key[0] is null.
kmail: enable progress
kmail: setupSystray called
bash-2.05b$ kmail: set Msg, force = true
kmail: set Msg, force = true
kmail: set Msg, force = true
kmail: set Msg, force = false
kmail: set Msg, force = false
kmail: enable progress
kmail: processNextCheck, remaining 1
kmail: processing next mail check for ITA
kmail: KMFolderImap::checkValidity of: /INBOX/
kmail: ImapJob::slotGetMessageResult - retrieved part
kmail: (5720, last 0) FW: :-) Marcel Liebi, readyToShow true
kmail: set Msg, force = true
kmail:
#######
#######
#######  parseMsg(KMMessage* aMsg == aMsg )
#######
#######
kmail:
     ----->  First body part *was* found, filling the Mime Part Tree
kmail:
        partNode::partNode()      explicitType == DwMime::kTypeUnknown
kmail:
kmail:
        partNode::partNode()      explicitType == DwMime::kTypeUnknown
kmail:
kmail:
        partNode::partNode()      explicitType == DwMime::kTypeUnknown
kmail:
kmail:
        partNode::partNode()      explicitType == DwMime::kTypeUnknown
kmail:
kmail:       Inserting one item into MimePartTree
kmail:                 Content-Type: multipart/signed
kmail:       Inserting one item into MimePartTree
kmail:                 Content-Type: application/x-pkcs7-signature
kmail:       Inserting one item into MimePartTree
kmail:                 Content-Type: multipart/mixed
kmail:       Inserting one item into MimePartTree
kmail:                 Content-Type: image/jpeg
kmail:       Inserting one item into MimePartTree
kmail:                 Content-Type: text/plain
kmail: partNode::findType() is looking at Multipart/Signed
kmail: partNode::findType() is looking at Multipart/Mixed
kmail: partNode::findType() is looking at Text/Plain
kmail: partNode::findType() is looking at Image/jpeg
kmail: KMMessage::emailAddrAsAnchor('"Marcel Liebi" <marcel.liebi@hsr.ch>') returns:
--><a href="mailto:%22Marcel%20Liebi%22%20%3Cmarcel.liebi%40hsr.ch%3E">&quot;Marcel Liebi&quot; &lt;marcel.liebi@hsr.ch&gt;</a><--
kmail: KMMessage::emailAddrAsAnchor('"'Reto Hotz'" <rhotz@hsr.ch>') returns:
--><a href="mailto:%22%27Reto%20Hotz%27%22%20%3Crhotz%40hsr.ch%3E">&quot;'Reto Hotz'&quot; &lt;rhotz@hsr.ch&gt;</a><--
kmail:
**
** ObjectTreeParser::parseObjectTree( node OK, showOnlyOneMimePart: FALSE ) **
**
kmail:        signed has children
kmail: partNode::findType() is looking at Multipart/Mixed
kmail: partNode::findType() is looking at Application/pkcs7-signature
kmail: partNode::findType() is looking at Multipart/Mixed
kmail: partNode::findType() is looking at Application/pkcs7-signature
kmail:        S/MIME signature found
kmail:        signed has data + signature
kmail: ObjectTreeParser::writeOpaqueOrMultipartSignedData: processing Multipart Signed data
kmail: ObjectTreeParser::writeOpaqueOrMultipartSignedData: going to call CRYPTPLUG /usr/lib/cryptplug/gpgme-smime.so
kmail: Converting LF to CRLF (see RfC 2633, 3.1.1 Canonicalization)
kmail:                                                        done.
kmail:

S I G N A T U R E = [binary data]

C O N T E N T = "Content-Type: multipart/mixed;
        boundary="----=_NextPart_001_0064_01C401C6.83355780"


------=_NextPart_001_0064_01C401C6.83355780
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

=20

-----Original Message-----
From: Rolf Sch=E4rer [mailto:rolf.schaerer@hsr.ch]=20
Sent: Donnerstag, 4. M=E4rz 2004 08:55
To: Marcel Liebi
Subject: :-)



--
| Rolf Schaerer        | Hochschule f=FCr Technik Rapperswil  |
| rolf.schaerer@hsr.ch | Cisco Networking Academy of        |
| PGP KeyID 0x639DAF26 | Eastern Switzerland                |
| Tel +41 55 222 46 26 | Oberseestrasse 10, 8640 Rapperswil |
| Fax +41 55 222 44 00 | http://cisco.netacad.ch            |=20

------=_NextPart_001_0064_01C401C6.83355780
Content-Type: image/jpeg;
        name="moon60.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
        filename="moon60.jpg"

/9j/4QmORXhpZgAASUkqAAgAAAAKAA8BAgAGAAAAhgAAABABAgAXAAAAjAAAABoBBQABAAAAowAA
ABsBBQABAAAAqwAAACgBAwABAAAAAgAAADEBAgAwAAAAswAAADsBAgAMAAAA4wAAABMCAwABAAAA
AgAAAJiCAgAMAAAA7wAAAGmHBAABAAAA+wAAAC8CAABD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wf6Vof2PDp1
oIJ4g0RfasgUZ9icDNAH51fHH4O6n8G/GD6ZOJZ9LuQZdNvSoxcR8ZBxwHXOGH0OMMCeAr7/AP2t
fh3H4u+Bt/epZSTXuglb2zaNFLqgIEwZsZ2eWWYgEcxqTnFfAB47UlpoAUlL+FFMBKWgUUAFJS0U
AJRRRQAtJRRQAUUUdO1ABV7QdROk6zaXoOPJlDE47d/0qlR+FAH2l8OvEcN1bR3kcsaqMEoT94Ec
Y+lei2+p2mo3STyHdtwwjYqAeeg7etfH3wd8eGAx6RcyYZeIiTgFfT8K+j9B1dTNDaTSqxaIGMlM
EEkEDP5/5NAHsmgagt3Dut12RghSqjocA4rfidtpDncDjg+vWuM8AWkcTi8afckoO2PkY75Pauxl
lQkBTjj8cUAcx8b9Rh0/4KeMfPkiiR9Eu0DOwALNCyqo9yxAA9cV+YLYr7b/AG6viXbaJ4BtfBEL
pJqGtSJNOnBMVtG24E85BaQKAcEEK/TAr4j4oAKKMUfSgAxRikooAXFFH4UUAJRRxRQAvFFJRQAU
tJSj2oAKKKSgB8cjxOrxuyMpypU4INeteBP2g59EtorbWLV5miwI7mIAuOoJIJx09P8A61eR0UAf
ZHh39qDwnAonm1SK3jZTJlgxfAyMFQCQeOnfj1yV8afty6Fo2n+X4W09tX1AoAklwGSFCR1YcM2O
kmail:
gpgmeplug checkMessageSignature status flags: 3
*** KMail got signal 11 (Crashing)

bash-2.05b$
Comment 1 Ingo Klöcker 2004-03-04 19:12:33 UTC
Do you get a backtrace if you run kmail in gdb as follows?

> gdb kmail
[...]
(gdb) kmail --nofork
[make KMail crash.]
(gdb) bt

I suspect that it's crashing in the S/MIME code.
Comment 2 Reto Hotz 2004-03-05 09:01:22 UTC
In the meanwhile I can make kmail also crash with an encrypted mail. So I have 2 reproduceable testcases, one with signed message and one with encrypted message. If you also need the backtrace from the encrypted message, let me know.

Here ist the backtrace from the signed message. Hope this helps:

#0  0x413d93ca in posix_memalign () from /usr/kde/3.2/lib/libkdecore.so.4
#1  0x413d8c5d in malloc () from /usr/kde/3.2/lib/libkdecore.so.4
#2  0x41fc624f in xmalloc () from /usr/lib/cryptplug/gpgme-smime.so
#3  0x41fc8dcb in parse_dn () from /usr/lib/cryptplug/gpgme-smime.so
#4  0x41fca980 in obtain_signature_information ()
   from /usr/lib/cryptplug/gpgme-smime.so
#5  0x41fcad28 in checkMessageSignature ()
   from /usr/lib/cryptplug/gpgme-smime.so
#6  0x40995665 in CryptPlugWrapper::checkMessageSignature(char**, char const*, bool, int, CryptPlugWrapper::SignatureMetaData*) (this=0x8186d50,
    cleartext=0xbfffddd8,
    signaturetext=0x8405100 "0\200\006\t*\206H\206÷\r\001\a\002 \2000\200\002\001\0011\v0\t\006\005+\016\003\002\032\005", signatureIsBinary=true,
    signatureLen=3146, sigmeta=0xbfffde10) at cryptplugwrapper.cpp:1263
#7  0x40319179 in KMail::ObjectTreeParser::writeOpaqueOrMultipartSignedData(partNode*, partNode&, QString const&, bool, QCString*, CryptPlugWrapper::SignatureMetaData*, bool) (this=0xbfffe040, data=0x823aa88, sign=@0x823f8f8,
    fromAddress=@0x83d0638, doCheck=true, cleartextData=0x0, paramSigMeta=0x0,
    hideErrors=false) at objecttreeparser.cpp:440
#8  0x4031d1e9 in KMail::ObjectTreeParser::processMultiPartSignedSubtype(partNode*, KMail::ProcessResult&) (this=0xbfffe040, node=0x83d05b0, result=@0xbfffdfa0)
---Type <return> to continue, or q <return> to quit---
    at objecttreeparser.cpp:1256
#9  0x403251d7 in (anonymous namespace)::MultiPartSignedBodyPartFormatter::process(KMail::ObjectTreeParser*, partNode*, KMail::ProcessResult&) const (
    this=0x8395348, otp=0xbfffe040, node=0x83d05b0, result=@0xbfffdfa0)
    at bodypartformatter.cpp:111
#10 0x4031852a in KMail::ObjectTreeParser::parseObjectTree(partNode*) (
    this=0xbfffe040, node=0x83d05b0) at objecttreeparser.cpp:246
#11 0x40234167 in KMReaderWin::parseMsg(KMMessage*) (this=0x8252950,
    aMsg=0x83e6418) at kmreaderwin.cpp:1188
#12 0x402335f9 in KMReaderWin::displayMessage() (this=0x8252950)
    at kmreaderwin.cpp:1064
#13 0x40233163 in KMReaderWin::updateReaderWin() (this=0x8252950)
    at kmreaderwin.cpp:1006
#14 0x402326f6 in KMReaderWin::setMsg(KMMessage*, bool) (this=0x8252950,
    aMsg=0x83e6418, force=true) at kmreaderwin.cpp:854
#15 0x4034a51c in KMMainWidget::slotUpdateImapMessage(KMMessage*) (
    this=0x81cb4b0, msg=0x83e6418) at kmmainwidget.cpp:1724
#16 0x4034210a in KMMainWidget::qt_invoke(int, QUObject*) (this=0x81cb4b0,
    _id=149, _o=0xbfffe430) at kmmainwidget.moc:550
#17 0x416f7930 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
---Type <return> to continue, or q <return> to quit---
#18 0x40361151 in KMail::FolderJob::messageRetrieved(KMMessage*) (
    this=0x83e76e8, t0=0x83e6418) at folderjob.moc:124
#19 0x40369c05 in KMail::ImapJob::slotGetMessageResult(KIO::Job*) (
    this=0x83e76e8, job=0x83e7dd8) at imapjob.cpp:333
#20 0x4036abc6 in KMail::ImapJob::qt_invoke(int, QUObject*) (this=0x83e76e8,
    _id=2, _o=0xbfffe5c0) at imapjob.moc:120
#21 0x416f7930 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#22 0x40da9882 in KIO::Job::result(KIO::Job*) ()
   from /usr/kde/3.2/lib/libkio.so.4
#23 0x40d948bf in KIO::Job::emitResult() () from /usr/kde/3.2/lib/libkio.so.4
#24 0x40d95d3e in KIO::SimpleJob::slotFinished() ()
   from /usr/kde/3.2/lib/libkio.so.4
#25 0x40d9885e in KIO::TransferJob::slotFinished() ()
   from /usr/kde/3.2/lib/libkio.so.4
#26 0x40dab08d in KIO::TransferJob::qt_invoke(int, QUObject*) ()
   from /usr/kde/3.2/lib/libkio.so.4
#27 0x416f7930 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#28 0x416f7764 in QObject::activate_signal(int) ()
   from /usr/qt/3/lib/libqt-mt.so.3
---Type <return> to continue, or q <return> to quit---
#29 0x40d88e4e in KIO::SlaveInterface::finished() ()
   from /usr/kde/3.2/lib/libkio.so.4
#30 0x40d87c5d in KIO::SlaveInterface::dispatch(int, QMemArray<char> const&) ()
   from /usr/kde/3.2/lib/libkio.so.4
#31 0x40d87309 in KIO::SlaveInterface::dispatch() ()
   from /usr/kde/3.2/lib/libkio.so.4
#32 0x40d84c6b in KIO::Slave::gotInput() () from /usr/kde/3.2/lib/libkio.so.4
#33 0x40d86860 in KIO::Slave::qt_invoke(int, QUObject*) ()
   from /usr/kde/3.2/lib/libkio.so.4
#34 0x416f7930 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#35 0x416f7a90 in QObject::activate_signal(int, int) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#36 0x41a23722 in QSocketNotifier::activated(int) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#37 0x41713db0 in QSocketNotifier::event(QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#38 0x4169cb55 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#39 0x4169bf45 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
---Type <return> to continue, or q <return> to quit---
#40 0x412bdb4c in KApplication::notify(QObject*, QEvent*) ()
   from /usr/kde/3.2/lib/libkdecore.so.4
#41 0x4168c44a in QEventLoop::activateSocketNotifiers() ()
   from /usr/qt/3/lib/libqt-mt.so.3
#42 0x41648752 in QEventLoop::processEvents(unsigned) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#43 0x416ae956 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
#44 0x416ae7f8 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#45 0x4169cda1 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#46 0x0804a2ba in main (argc=2, argv=0xbffff474) at main.cpp:115
(gdb)
Comment 3 Till Adam 2004-07-18 17:18:20 UTC
*** Bug 84306 has been marked as a duplicate of this bug. ***
Comment 4 Till Adam 2004-12-13 23:25:26 UTC
Reto, thanks for reporting this. Since the crypto layer has been redone for KMail 1.7 and the test case you describe does not crash here, I'm closing this bug as fixed. Please feel free to reopen it if you can still reproduce with a current version of KMail.