FS#36024 - KMail fails/freezes while verifying S/Mime signed emails (select in gpgme_op_getauditlog of libgpgme

Attached to Project: Arch Linux
Opened by Milian Wolff (milianw) - Thursday, 04 July 2013, 16:24 GMT
Last edited by Andrea Scarpino (BaSh) - Tuesday, 06 August 2013, 07:59 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Andrea Scarpino (BaSh)
Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I'm not sure whether this is the correct place, but so far only people using ArchLinux could reproduce this issue:

When reading a S/Mime signed email in KMail, it fails to verify the validity of the signature. Everytime such an email is read a new thread will be created that is locked in a select in libgpgme-pthread.so.11:

Thread 22 (Thread 0x7f93b8b4f700 (LWP 12910)):
#0 0x00007f94320a7d03 in select () from /usr/lib/libc.so.6
#1 0x00007f9423f85a99 in ?? () from /usr/lib/libgpgme-pthread.so.11
#2 0x00007f9423f81f99 in ?? () from /usr/lib/libgpgme-pthread.so.11
#3 0x00007f9423f695d6 in ?? () from /usr/lib/libgpgme-pthread.so.11
#4 0x00007f9423f73ee0 in gpgme_op_getauditlog () from /usr/lib/libgpgme-pthread.so.11
#5 0x00007f942c674080 in GpgME::Context::getAuditLog(GpgME::Data&, unsigned int) () from /usr/lib/libgpgme++-pthread.so.2
#6 0x00007f942c9351fc in ?? () from /usr/lib/libkleo.so.4
#7 0x00007f942c97e8ec in ?? () from /usr/lib/libkleo.so.4
#8 0x00007f942c97f456 in ?? () from /usr/lib/libkleo.so.4
#9 0x00007f942c981598 in ?? () from /usr/lib/libkleo.so.4
#10 0x00007f943290ad1f in ?? () from /usr/lib/libQtCore.so.4
#11 0x00007f942feafdd2 in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007f94320aecdd in clone () from /usr/lib/libc.so.6

While KMail still works, without ever finishing the verification, this is still a problem: If you read many S/Mime signed emails, you'll sooner or later kill your system by having too many threads open, all of which will allocate some stack space e.g.

A more pressing issue is that you'll freeze KMail completely when trying to answer an S/Mime signed email. The freeze shows this backtrace:

(gdb) bt
#0 0x00007f94320a7d03 in select () from /usr/lib/libc.so.6
#1 0x00007f9423f85a99 in ?? () from /usr/lib/libgpgme-pthread.so.11
#2 0x00007f9423f81f99 in ?? () from /usr/lib/libgpgme-pthread.so.11
#3 0x00007f9423f695d6 in ?? () from /usr/lib/libgpgme-pthread.so.11
#4 0x00007f9423f73ee0 in gpgme_op_getauditlog () from /usr/lib/libgpgme-pthread.so.11
#5 0x00007f942c674080 in GpgME::Context::getAuditLog(GpgME::Data&, unsigned int) () from /usr/lib/libgpgme++-pthread.so.2
#6 0x00007f942c9351fc in ?? () from /usr/lib/libkleo.so.4
#7 0x00007f942c97e8ec in ?? () from /usr/lib/libkleo.so.4
#8 0x00007f942c97ec01 in ?? () from /usr/lib/libkleo.so.4
#9 0x00007f942b2aaef2 in ?? () from /usr/lib/libmessageviewer.so.4
#10 0x00007f942b29fd14 in MessageViewer::ObjectTreeParser::writeOpaqueOrMultipartSignedData(KMime::Content*, KMime::Content&, QString const&, bool, QByteArray*, std::vector<GpgME::Signature, std::allocator<GpgME::Signature> > const&, bool) () from /usr/lib/libmessageviewer.so.4
#11 0x00007f942b2a50b7 in MessageViewer::ObjectTreeParser::processMultiPartSignedSubtype(KMime::Content*, MessageViewer::ProcessResult&) ()
from /usr/lib/libmessageviewer.so.4
#12 0x00007f942b2a212f in MessageViewer::ObjectTreeParser::parseObjectTreeInternal(KMime::Content*) () from /usr/lib/libmessageviewer.so.4
#13 0x00007f942d510b29 in TemplateParser::TemplateParser::processWithTemplate(QString const&) () from /usr/lib/libtemplateparser.so.4
#14 0x00007f942d50dc5c in TemplateParser::TemplateParser::process(boost::shared_ptr<KMime::Message> const&, Akonadi::Collection const&) ()
from /usr/lib/libtemplateparser.so.4
#15 0x00007f942e028c93 in MessageComposer::MessageFactory::createReply() () from /usr/lib/libmessagecomposer.so.4
#16 0x00007f9433b24224 in KMReplyCommand::execute() () from /usr/lib/libkmailprivate.so.4
#17 0x00007f9433b1e801 in KMCommand::slotPostTransfer(KMCommand::Result) () from /usr/lib/libkmailprivate.so.4
#18 0x00007f9432a1e8ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#19 0x00007f9433b1e73e in KMCommand::messagesTransfered(KMCommand::Result) () from /usr/lib/libkmailprivate.so.4
---Type <return> to continue, or q <return> to quit---
#20 0x00007f9433b21435 in KMCommand::slotJobFinished() () from /usr/lib/libkmailprivate.so.4
#21 0x00007f9432a1e8ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#22 0x00007f943418e382 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#23 0x00007f943418e3c0 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#24 0x00007f9432a22c5e in QObjectPrivate::sendPendingChildInsertedEvents() () from /usr/lib/libQtCore.so.4
#25 0x0000000000008000 in ?? ()
#26 0x0000000000000001 in ?? ()
#27 0x0000000000000000 in ?? ()

Additional info:
* package version(s)
gpgme 1.4.1-1 from core
gnupg 2.0.20-2 from core
libassuan 2.1.0-1 from core
qca-gnupg 2.0.0-5 from extra
kdepim-kleopatra 4.10.5-1 from extra
kdepim-kmail 4.10.5-1 from extra (note: apparently this also happens with kmail from current git master)

* config and/or log files etc.
Please tell me what kind of config/log files I should provide. Furthermore note that I can reliably reproduce this issue. So if there is anything you want me to try out, please go ahead.


Steps to reproduce:
Read any S/Mime signed email in KMail. See another thread being created. Try to answer -> KMail freezes.

If you think that this report should be in a different bugtracker, please tell me which one. At least on OpenSuSe this problem apparently does not show up.
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Tuesday, 06 August 2013, 07:59 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#35112 
Comment by sergio (sergio) - Thursday, 04 July 2013, 16:46 GMT
Same here, only happens on archlinux.
Comment by Milian Wolff (milianw) - Friday, 05 July 2013, 10:10 GMT
Sometimes it even outright crashes when switching to a different email to read:

Application: KMail (kmail), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fb60f360780 (LWP 20353))]

Thread 7 (Thread 0x7fb5ec04b700 (LWP 20949)):
#0 0x00007fb60a4d28b4 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007fb6002702cd in ?? () from /usr/lib/libQtWebKit.so.4
#2 0x00007fb600270309 in ?? () from /usr/lib/libQtWebKit.so.4
#3 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7fb5aaeb9700 (LWP 20950)):
#0 0x00007fb60a4d28b4 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007fb5fffb274d in ?? () from /usr/lib/libQtWebKit.so.4
#2 0x00007fb60029fa66 in ?? () from /usr/lib/libQtWebKit.so.4
#3 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7fb5aa1f4700 (LWP 20951)):
#0 0x00007fb60c6c508d in poll () from /usr/lib/libc.so.6
#1 0x00007fb604a59094 in ?? () from /usr/lib/libglib-2.0.so.0
#2 0x00007fb604a5919c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3 0x00007fb60d056ba6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4 0x00007fb60d028b5f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5 0x00007fb60d028e55 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6 0x00007fb60cf276ef in QThread::exec() () from /usr/lib/libQtCore.so.4
#7 0x00007fb60cf29d8f in ?? () from /usr/lib/libQtCore.so.4
#8 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#9 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7fb58ffff700 (LWP 22229)):
#0 0x00007fb60c6c6d03 in select () from /usr/lib/libc.so.6
#1 0x00007fb60d007053 in ?? () from /usr/lib/libQtCore.so.4
#2 0x00007fb60cf29d8f in ?? () from /usr/lib/libQtCore.so.4
#3 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7fb5a2dd3700 (LWP 20522)):
#0 0x00007fb60a4d2c61 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007fb60cf2a244 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2 0x00007fb60cf1d945 in ?? () from /usr/lib/libQtCore.so.4
#3 0x00007fb60cf29d8f in ?? () from /usr/lib/libQtCore.so.4
#4 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#5 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7fb57affd700 (LWP 20561)):
[KCrash Handler]
#5 0x00007fb5f8868765 in assuan_sendfd () from /usr/lib/libassuan.so.0
#6 0x00007fb5fe59b357 in ?? () from /usr/lib/libgpgme-pthread.so.11
#7 0x00007fb5fe59bf4a in ?? () from /usr/lib/libgpgme-pthread.so.11
#8 0x00007fb5fe594e39 in gpgme_op_getauditlog () from /usr/lib/libgpgme-pthread.so.11
#9 0x00007fb606c93080 in GpgME::Context::getAuditLog(GpgME::Data&, unsigned int) () from /usr/lib/libgpgme++-pthread.so.2
#10 0x00007fb606f541fc in ?? () from /usr/lib/libkleo.so.4
#11 0x00007fb606f9d8ec in ?? () from /usr/lib/libkleo.so.4
#12 0x00007fb606f9e456 in ?? () from /usr/lib/libkleo.so.4
#13 0x00007fb606fa0598 in ?? () from /usr/lib/libkleo.so.4
#14 0x00007fb60cf29d8f in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007fb60a4cedd2 in start_thread () from /usr/lib/libpthread.so.0
#16 0x00007fb60c6cdcdd in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7fb60f360780 (LWP 20353)):
#0 0x00007fb60a4d28b4 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007fb60cf2a266 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2 0x00007fb60cf2995e in QThread::wait(unsigned long) () from /usr/lib/libQtCore.so.4
#3 0x00007fb60d006b7d in ?? () from /usr/lib/libQtCore.so.4
#4 0x00007fb60c61fc99 in __run_exit_handlers () from /usr/lib/libc.so.6
#5 0x00007fb60c61fce5 in exit () from /usr/lib/libc.so.6
#6 0x00007fb60d5bf938 in ?? () from /usr/lib/libQtGui.so.4
#7 0x00007fb60ed8f460 in KApplication::xioErrhandler(_XDisplay*) () from /usr/lib/libkdeui.so.5
#8 0x00007fb60becc1de in _XIOError () from /usr/lib/libX11.so.6
#9 0x00007fb60beca335 in _XReply () from /usr/lib/libX11.so.6
#10 0x00007fb60bec5c7d in XSync () from /usr/lib/libX11.so.6
#11 0x00007fb60d747475 in QRasterWindowSurface::syncX() () from /usr/lib/libQtGui.so.4
#12 0x00007fb60d747755 in QRasterWindowSurface::beginPaint(QRegion const&) () from /usr/lib/libQtGui.so.4
#13 0x00007fb60d760fa9 in ?? () from /usr/lib/libQtGui.so.4
#14 0x00007fb60d598060 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQtGui.so.4
#15 0x00007fb60d5a8042 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#16 0x00007fb60d95e5e3 in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#17 0x00007fb60ee7ce19 in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#18 0x00007fb60d55912c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007fb60d55f6f0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007fb60ed908aa in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#21 0x00007fb60d029efd in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#22 0x00007fb60d02cf4f in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#23 0x00007fb60d0572c3 in ?? () from /usr/lib/libQtCore.so.4
#24 0x00007fb604a58da6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0x00007fb604a590f8 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0x00007fb604a5919c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0x00007fb60d056b85 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007fb60d5f62e6 in ?? () from /usr/lib/libQtGui.so.4
#29 0x00007fb60d028b5f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007fb60d028e55 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#31 0x00007fb60d02df8b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#32 0x0000000000402cf9 in ?? ()
#33 0x00007fb60c609a15 in __libc_start_main () from /usr/lib/libc.so.6
#34 0x0000000000403195 in _start ()
Comment by sergio (sergio) - Wednesday, 24 July 2013, 09:49 GMT
Millian, can you run valgrind on it ? I didn't see any crash.
Comment by sergio (sergio) - Sunday, 04 August 2013, 17:45 GMT
This is fixed for me if configuring gpgme with --disable-fd-passing

See https://bugs.archlinux.org/task/35112 and https://bugs.g10code.com/gnupg/issue1502

Loading...