Bug 289347

Summary: KMail segfaults after forwarding SMIME encrypted mail inline
Product: [Applications] kmail2 Reporter: David Matscheko <d.matscheko>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: montel
Priority: NOR    
Version: 4.7   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description David Matscheko 2011-12-19 10:31:00 UTC
Application: kontact (4.7.2)
KDE Platform Version: 4.7.2 (4.7.2)
Qt Version: 4.7.4
Operating System: Linux 3.0.0-14-generic x86_64
Distribution: Ubuntu 11.10

-- Information about the crash:
- What I was doing when the application crashed:

Right-click on an SMIME encrypted mail.
Select Forward -> Inline... .
[KMail crashes]
After restarting Kontact or KMail, an empty Composer window appears additionally to the application window.


- What SMIME encrypted mails produced this error:

* Most encrypted mails can be forwarded inline without problems, but the "bad" ones always create the segfault.

* The "bad" ones seem to be created with a recent version of MS Outlook 2007, all other mails seem to work perfectly.

* Forwarding of signed (not encrypted) or plaintext mails received from Outlook 2007 also works without errors.

* Forwarding of encrypted Outlook 2010 mails also works without errors.

* There seems to be a second issue where attachments in encrypted mails created with Outlook 2007 can not be opened. It might be related (because of the recent version of Outlook 2007 as sender) but i found no bug reports concerning this. Also, attachments are irrelevant to reproduce this "Forward -> Inline..." bug.

The crash can be reproduced every time.

-- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f93b84bb7a0 (LWP 24217))]

Thread 4 (Thread 0x7f939e8d9700 (LWP 24218)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f93b4d07c2c in WTF::TCMalloc_PageHeap::scavengerThread (this=0x7f93b56be220) at wtf/FastMalloc.cpp:2495
#2  0x00007f93b4d07d59 in WTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at wtf/FastMalloc.cpp:1618
#3  0x00007f93b0106efc in start_thread (arg=0x7f939e8d9700) at pthread_create.c:304
#4  0x00007f93b5a1589d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#5  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f939e0d8700 (LWP 24219)):
#0  0x00007f93b5a09773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f93af638f68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f93af639429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f93b6e50f3e in QEventDispatcherGlib::processEvents (this=0x1099840, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007f93b6e24cf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f93b6e24ef7 in QEventLoop::exec (this=0x7f939e0d7de0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007f93b6d3c27f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#7  0x00007f93b6d3ed05 in QThreadPrivate::start (arg=0x1098880) at thread/qthread_unix.cpp:331
#8  0x00007f93b0106efc in start_thread (arg=0x7f939e0d8700) at pthread_create.c:304
#9  0x00007f93b5a1589d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f934fbea700 (LWP 24223)):
#0  0x00007f93b5a09773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f93af638f68 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f93af639429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f93b6e50ed6 in QEventDispatcherGlib::processEvents (this=0x7f9398001050, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#4  0x00007f93b6e24cf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f93b6e24ef7 in QEventLoop::exec (this=0x7f934fbe9db0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007f93b6d3c27f in QThread::exec (this=<optimized out>) at thread/qthread.cpp:498
#7  0x00007f93b6e07cbf in QInotifyFileSystemWatcherEngine::run (this=0x12fba40) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f93b6d3ed05 in QThreadPrivate::start (arg=0x12fba40) at thread/qthread_unix.cpp:331
#9  0x00007f93b0106efc in start_thread (arg=0x7f934fbea700) at pthread_create.c:304
#10 0x00007f93b5a1589d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f93b84bb7a0 (LWP 24217)):
[KCrash Handler]
#6  __memcpy_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1629
#7  0x00007f93b6d40cda in QByteArray::realloc (this=0x7fffda802cb0, alloc=33554400) at /usr/include/x86_64-linux-gnu/bits/string3.h:52
#8  0x00007f93b6d41c3f in QByteArray::append (this=0x7fffda802cb0, ch=10 '\n') at tools/qbytearray.cpp:1660
#9  0x00007f93acd057cf in operator+= (c=10 '\n', this=0x7fffda802cb0) at /usr/include/qt4/QtCore/qbytearray.h:488
#10 KMime::Content::encodedContent (this=0x5b7a030, useCrLf=false) at ../../kmime/kmime_content.cpp:283
#11 0x00007f93acd053a9 in KMime::Content::encodedBody (this=<optimized out>) at ../../kmime/kmime_content.cpp:339
#12 0x00007f93acd057dc in KMime::Content::encodedContent (this=0x5b69770, useCrLf=false) at ../../kmime/kmime_content.cpp:284
#13 0x00007f9355555c6c in Message::ComposerViewBase::setMessage (this=0x5bc9b40, msg=...) at ../../messagecomposer/composerviewbase.cpp:176
#14 0x00007f9355e854c5 in KMComposeWin::setMsg (this=0x154f680, newMsg=..., mayAutoSign=true, allowDecryption=<optimized out>, isModified=false) at ../../kmail/kmcomposewin.cpp:1466
#15 0x00007f9355e88982 in KMComposeWin::KMComposeWin (this=0x154f680, aMsg=..., context=<optimized out>, id=<optimized out>, textSelection=<optimized out>, customTemplate=<optimized out>, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ../../kmail/kmcomposewin.cpp:443
#16 0x00007f9355e89825 in KMComposeWin::create (msg=..., context=KMail::Composer::Forward, identity=1225000542, textSelection=..., customTemplate=...) at ../../kmail/kmcomposewin.cpp:165
#17 0x00007f9355e27ee5 in KMForwardCommand::execute (this=0x5b61280) at ../../kmail/kmcommands.cpp:1007
#18 0x00007f9355e1fd91 in KMCommand::slotPostTransfer (this=0x5b61280, result=KMCommand::OK) at ../../kmail/kmcommands.cpp:264
#19 0x00007f9355e26ac3 in KMCommand::qt_metacall (this=0x5b61280, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffda8040a0) at ./kmcommands.moc:88
#20 0x00007f93b6e38eba in QMetaObject::activate (sender=0x5b61280, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffda8040a0) at kernel/qobject.cpp:3278
#21 0x00007f9355e1fbde in KMCommand::messagesTransfered (this=<optimized out>, _t1=KMCommand::OK) at ./kmcommands.moc:103
#22 0x00007f9355e240d9 in KMCommand::slotJobFinished (this=0x5b61280) at ../../kmail/kmcommands.cpp:374
#23 0x00007f9355e26a8c in KMCommand::qt_metacall (this=0x5b61280, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffda804210) at ./kmcommands.moc:90
#24 0x00007f93b6e38eba in QMetaObject::activate (sender=0x3becaa0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fffda804210) at kernel/qobject.cpp:3278
#25 0x00007f93b728b5b2 in KJob::result (this=<optimized out>, _t1=0x3becaa0) at ./kjob.moc:194
#26 0x00007f93b728b5f0 in KJob::emitResult (this=0x3becaa0) at ../../kdecore/jobs/kjob.cpp:312
#27 0x00007f93b2836f4d in Akonadi::Job::qt_metacall (this=0x3becaa0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x43b4920) at ./job.moc:91
#28 0x00007f93b2824745 in Akonadi::ItemFetchJob::qt_metacall (this=0x3becaa0, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x43b4920) at ./itemfetchjob.moc:73
#29 0x00007f93b6e3ca5e in QObject::event (this=0x3becaa0, e=<optimized out>) at kernel/qobject.cpp:1217
#30 0x00007f93b61d6424 in notify_helper (e=0x5baf800, receiver=0x3becaa0, this=0xf838a0) at kernel/qapplication.cpp:4486
#31 QApplicationPrivate::notify_helper (this=0xf838a0, receiver=0x3becaa0, e=0x5baf800) at kernel/qapplication.cpp:4458
#32 0x00007f93b61db291 in QApplication::notify (this=0x7fffda804a90, receiver=0x3becaa0, e=0x5baf800) at kernel/qapplication.cpp:4365
#33 0x00007f93b785b126 in KApplication::notify (this=0x7fffda804a90, receiver=0x3becaa0, event=0x5baf800) at ../../kdeui/kernel/kapplication.cpp:311
#34 0x00007f93b6e25afc in QCoreApplication::notifyInternal (this=0x7fffda804a90, receiver=0x3becaa0, event=0x5baf800) at kernel/qcoreapplication.cpp:787
#35 0x00007f93b6e2951f in sendEvent (event=0x5baf800, receiver=0x3becaa0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#36 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0xf538e0) at kernel/qcoreapplication.cpp:1428
#37 0x00007f93b6e50a73 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#38 postEventSourceDispatch (s=<optimized out>) at kernel/qeventdispatcher_glib.cpp:277
#39 0x00007f93af638a5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007f93af639258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007f93af639429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007f93b6e50ed6 in QEventDispatcherGlib::processEvents (this=0xf54fd0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#43 0x00007f93b627e07e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#44 0x00007f93b6e24cf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#45 0x00007f93b6e24ef7 in QEventLoop::exec (this=0x7fffda804a20, flags=...) at kernel/qeventloop.cpp:201
#46 0x00007f93b6e29789 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#47 0x0000000000403629 in main (argc=1, argv=0x7fffda8050b8) at ../../../kontact/src/main.cpp:218

Reported using DrKonqi
Comment 1 Laurent Montel 2011-12-19 11:43:25 UTC
could you send me in private emails please ?
Comment 2 Denis Kurz 2016-09-24 17:54:38 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 3 Denis Kurz 2017-01-07 22:06:23 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.