Bug 376385 - Restarting Akonadi while it fails to deliver content to frontend makes it crash
Summary: Restarting Akonadi while it fails to deliver content to frontend makes it crash
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2017-02-12 08:40 UTC by Dennis Schridde
Modified: 2017-02-23 18:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.4.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2017-02-12 08:40:35 UTC
Application: akonadiserver (5.4.2)

Qt Version: 5.7.1
Frameworks Version: 5.30.0
Operating System: Linux 4.9.9-gentoo x86_64
Distribution: "Gentoo Base System release 2.3"

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

I ran `akonadictl restart` to resolve a server hang that might be related to bug #338658.

- Unusual behavior I noticed:

Using KMail, I noticed that KMail seems to be unable to exchange information with Akonadi. At first, messages did not get marked as read. When I switched to other folders, the rotating "loading" icon appeared for them in the folder tree, but their content never appeared and the icon never stopped spinning. Also, "Check Mail" did not sync with the IMAP server of this account. The sync progress bar for other accounts appears, but for this particular account it does not. Syncing only this particular account (from the "Check Mail" sub menu) has no effect at all.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Akonadi Server (akonadiserver), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f4babed3f00 (LWP 5018))]

Thread 18 (Thread 0x7f4b77904700 (LWP 16418)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=30000, this=0x7f4b940284c0) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=30000, this=0x7f4b940284c0) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x7f4b94027dc0, mutex=mutex@entry=0x7f4b940035a0, time=30000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab2877f2 in QThreadPoolThread::run (this=0x7f4b94027db0) at thread/qthreadpool.cpp:133
#5  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4b94027db0) at thread/qthread_unix.cpp:368
#6  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#7  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 17 (Thread 0x7f4b3b7fe700 (LWP 16417)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=30000, this=0x7f4b9401cdd0) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=30000, this=0x7f4b9401cdd0) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x7f4b9401cc10, mutex=mutex@entry=0x7f4b940035a0, time=30000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab2877f2 in QThreadPoolThread::run (this=0x7f4b9401cc00) at thread/qthreadpool.cpp:133
#5  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4b9401cc00) at thread/qthread_unix.cpp:368
#6  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#7  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 16 (Thread 0x7f4b750ff700 (LWP 16416)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=30000, this=0x7f4b9401d690) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=30000, this=0x7f4b9401d690) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x7f4b9401d4d0, mutex=mutex@entry=0x7f4b940035a0, time=30000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab2877f2 in QThreadPoolThread::run (this=0x7f4b9401d4c0) at thread/qthreadpool.cpp:133
#5  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4b9401d4c0) at thread/qthread_unix.cpp:368
#6  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#7  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 15 (Thread 0x7f4b3bfff700 (LWP 16415)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=30000, this=0x7f4b9401d210) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=30000, this=0x7f4b9401d210) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x7f4b9401d050, mutex=mutex@entry=0x7f4b940035a0, time=30000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab2877f2 in QThreadPoolThread::run (this=0x7f4b9401d040) at thread/qthreadpool.cpp:133
#5  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4b9401d040) at thread/qthread_unix.cpp:368
#6  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#7  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 14 (Thread 0x7f4b38ff9700 (LWP 16414)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=30000, this=0x7f4b94028980) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=30000, this=0x7f4b94028980) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x7f4b940287c0, mutex=mutex@entry=0x7f4b940035a0, time=30000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab2877f2 in QThreadPoolThread::run (this=0x7f4b940287b0) at thread/qthreadpool.cpp:133
#5  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4b940287b0) at thread/qthread_unix.cpp:368
#6  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#7  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 13 (Thread 0x7f4b0cff9700 (LWP 7593)):
#0  0x00007f4baa91a18d in poll () from /lib64/libc.so.6
#1  0x00007f4ba7c6e88c in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b4004d1c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b0cff8dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#6  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x1775df0) at thread/qthread_unix.cpp:368
#7  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#8  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 12 (Thread 0x7f4b0d7fa700 (LWP 6415)):
#0  0x00007f4ba7cb2a6c in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6d8b5 in g_main_context_acquire () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e745 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b3405cc30, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b0d7f9dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#7  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x1772da0) at thread/qthread_unix.cpp:368
#8  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#9  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7f4b0dffb700 (LWP 6413)):
#0  0x00007f4ba7cb2a60 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6e41e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e8f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b2c06c7e0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b0dff9d70, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x0000000000578751 in Akonadi::Server::ItemRetriever::exec (this=this@entry=0x7f4b0dffa3d0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/storage/itemretriever.cpp:355
#7  0x000000000053ec79 in Akonadi::Server::FetchHelper::fetchItems (this=this@entry=0x7f4b0dffa5a0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/handler/fetchhelper.cpp:337
#8  0x000000000053bdab in Akonadi::Server::Fetch::parseStream (this=0x7f4b2d60b6d0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/handler/fetch.cpp:47
#9  0x000000000042c20b in Akonadi::Server::Connection::slotNewData (this=0x17a3110) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/connection.cpp:247
#10 0x00007f4bab448e71 in QtPrivate::QSlotObjectBase::call (a=0x7f4b0dffa940, r=0x17a3110, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#11 QMetaObject::activate (sender=0x7f4b2c06e8e0, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3723
#12 0x00007f4bab448b4f in QMetaObject::activate (sender=sender@entry=0x7f4b2c06f7d8, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3740
#13 0x00007f4bab4494a7 in QMetaObject::activate (sender=sender@entry=0x7f4b2c06f7d8, m=m@entry=0x7f4bab658ea0 <QIODevice::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3602
#14 0x00007f4bab4b23c0 in QIODevice::readyRead (this=this@entry=0x7f4b2c06f7d8) at .moc/moc_qiodevice.cpp:184
#15 0x00007f4babfb4465 in QAbstractSocketPrivate::emitReadyRead (this=this@entry=0x7f4b2c071c40) at socket/qabstractsocket.cpp:1303
#16 0x00007f4babfb4520 in QAbstractSocketPrivate::canReadNotification (this=0x7f4b2c071c40) at socket/qabstractsocket.cpp:724
#17 0x00007f4babfbeda9 in QReadNotifier::event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1209
#18 0x00007f4bab4233e2 in doNotify (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
#19 0x00007f4bab423519 in QCoreApplication::notifyInternal2 (receiver=0x7f4b2c043f60, event=event@entry=0x7f4b0dffaba0) at kernel/qcoreapplication.cpp:988
#20 0x00007f4bab46f1ae in QCoreApplication::sendEvent (event=0x7f4b0dffaba0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#21 socketNotifierSourceDispatch (source=0x7f4b2c026650) at kernel/qeventdispatcher_glib.cpp:106
#22 0x00007f4ba7c6e68e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#23 0x00007f4ba7c6e8f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#24 0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#25 0x00007f4bab46e8a7 in QEventDispatcherGlib::processEvents (this=0x7f4b2c06c7e0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#26 0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b0dffadc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#27 0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#28 0x00007f4bab28a60b in QThreadPrivate::start (arg=0x178e6b0) at thread/qthread_unix.cpp:368
#29 0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#30 0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7f4b197fa700 (LWP 6276)):
[KCrash Handler]
#6  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::data (this=0x8) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:141
#7  qGetPtrHelper<QScopedPointer<QObjectData> > (p=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:980
#8  QIODevice::d_func (this=0x0) at ../../include/QtCore/../../src/corelib/io/qiodevice.h:178
#9  QIODevice::write (this=0x0, data=data@entry=0x7f4b197f8cec "\227", maxSize=maxSize@entry=1) at io/qiodevice.cpp:1596
#10 0x00007f4bab7b9400 in Akonadi::Protocol::DataStream::operator<< <unsigned char> (this=0x7f4b197f8d70, val=151 '\227') at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/datastream_p_p.h:91
#11 0x00007f4bab7bc4bf in Akonadi::Protocol::CommandPrivate::serialize (stream=..., this=0x7f4b10055390) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/protocol.cpp:266
#12 Akonadi::Protocol::ResponsePrivate::serialize (stream=..., this=0x7f4b10055390) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/protocol.cpp:425
#13 Akonadi::Protocol::FetchItemsResponsePrivate::serialize (this=0x7f4b10055390, stream=...) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/protocol.cpp:3344
#14 0x00007f4bab7a3f3c in Akonadi::Protocol::operator<< (command=..., stream=...) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/protocol.cpp:383
#15 Akonadi::Protocol::serialize (device=<optimized out>, command=...) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/private/protocol.cpp:636
#16 0x000000000042a99b in Akonadi::Server::Connection::sendResponse (this=0x178edb0, tag=82, response=...) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/connection.cpp:404
#17 0x000000000054009e in Akonadi::Server::FetchHelper::fetchItems (this=this@entry=0x7f4b197f95a0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/handler/fetchhelper.cpp:607
#18 0x000000000053bdab in Akonadi::Server::Fetch::parseStream (this=0x7f4b100109d0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/handler/fetch.cpp:47
#19 0x000000000042c20b in Akonadi::Server::Connection::slotNewData (this=0x178edb0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/connection.cpp:247
#20 0x00007f4bab448e71 in QtPrivate::QSlotObjectBase::call (a=0x7f4b197f9940, r=0x178edb0, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#21 QMetaObject::activate (sender=0x7f4b100446a0, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3723
#22 0x00007f4bab448b4f in QMetaObject::activate (sender=sender@entry=0x7f4b1006f768, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3740
#23 0x00007f4bab4494a7 in QMetaObject::activate (sender=sender@entry=0x7f4b1006f768, m=m@entry=0x7f4bab658ea0 <QIODevice::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3602
#24 0x00007f4bab4b23c0 in QIODevice::readyRead (this=this@entry=0x7f4b1006f768) at .moc/moc_qiodevice.cpp:184
#25 0x00007f4babfb4465 in QAbstractSocketPrivate::emitReadyRead (this=this@entry=0x7f4b10071400) at socket/qabstractsocket.cpp:1303
#26 0x00007f4babfb4520 in QAbstractSocketPrivate::canReadNotification (this=0x7f4b10071400) at socket/qabstractsocket.cpp:724
#27 0x00007f4babfbeda9 in QReadNotifier::event (this=<optimized out>, e=<optimized out>) at socket/qnativesocketengine.cpp:1209
#28 0x00007f4bab4233e2 in doNotify (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
#29 0x00007f4bab423519 in QCoreApplication::notifyInternal2 (receiver=0x7f4b10070bb0, event=event@entry=0x7f4b197f9ba0) at kernel/qcoreapplication.cpp:988
#30 0x00007f4bab46f1ae in QCoreApplication::sendEvent (event=0x7f4b197f9ba0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#31 socketNotifierSourceDispatch (source=0x7f4b1006f440) at kernel/qeventdispatcher_glib.cpp:106
#32 0x00007f4ba7c6e68e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#33 0x00007f4ba7c6e8f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#34 0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#35 0x00007f4bab46e8a7 in QEventDispatcherGlib::processEvents (this=0x7f4b10055460, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#36 0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b197f9dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#37 0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#38 0x00007f4bab28a60b in QThreadPrivate::start (arg=0x16f4040) at thread/qthread_unix.cpp:368
#39 0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#40 0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7f4b98a66700 (LWP 6059)):
#0  0x00007f4baa91a18d in poll () from /lib64/libc.so.6
#1  0x00007f4ba7c6e88c in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b800008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b98a65dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#6  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x1732cf0) at thread/qthread_unix.cpp:368
#7  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#8  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7f4b99267700 (LWP 6058)):
#0  0x00007f4ba9c09f1f in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac4a in QWaitConditionPrivate::wait (time=18446744073709551615, this=0x173abc0) at thread/qwaitcondition_unix.cpp:143
#2  QWaitCondition::wait (this=this@entry=0x173a6e8, mutex=mutex@entry=0x173a6f0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:215
#3  0x000000000043e0c3 in Akonadi::Server::SearchTaskManager::searchLoop (this=0x173a6c0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/search/searchtaskmanager.cpp:222
#4  0x00007f4bab454d26 in QtPrivate::QSlotObjectBase::call (a=0x7f4b99266a20, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#5  QSingleShotTimer::timerEvent (this=0x16f4c90) at kernel/qtimer.cpp:317
#6  0x00007f4bab449c4b in QObject::event (this=0x16f4c90, e=<optimized out>) at kernel/qobject.cpp:1285
#7  0x00007f4bab4233e2 in doNotify (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
#8  0x00007f4bab423519 in QCoreApplication::notifyInternal2 (receiver=0x16f4c90, event=event@entry=0x7f4b99266b70) at kernel/qcoreapplication.cpp:988
#9  0x00007f4bab46def3 in QCoreApplication::sendEvent (event=0x7f4b99266b70, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#10 QTimerInfoList::activateTimers (this=0x7f4b7c0030d0) at kernel/qtimerinfo_unix.cpp:644
#11 0x00007f4bab46e464 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:182
#12 0x00007f4ba7c6e68e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#13 0x00007f4ba7c6e8f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#14 0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#15 0x00007f4bab46e8a7 in QEventDispatcherGlib::processEvents (this=0x7f4b7c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#16 0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b99266dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#17 0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#18 0x00007f4bab28a60b in QThreadPrivate::start (arg=0x173a7a0) at thread/qthread_unix.cpp:368
#19 0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#20 0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f4b99a68700 (LWP 6057)):
#0  0x00007f4baa91a18d in poll () from /lib64/libc.so.6
#1  0x00007f4ba7c6e88c in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b880008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b99a67dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#6  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x173a1f0) at thread/qthread_unix.cpp:368
#7  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#8  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f4b9a269700 (LWP 6056)):
#0  0x00007f4ba7cb2a6c in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6ddff in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e7bb in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b840008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b9a268dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#7  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x1739ce0) at thread/qthread_unix.cpp:368
#8  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#9  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f4b9aa6a700 (LWP 6055)):
#0  0x00007f4ba7cb2a6c in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6ddff in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e7bb in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b900008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b9aa69dc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#7  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x1739190) at thread/qthread_unix.cpp:368
#8  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#9  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f4b9b26b700 (LWP 6054)):
#0  0x00007f4ba7cb2a6c in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6e244 in g_main_context_check () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e830 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b8c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b9b26adc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#6  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#7  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x16fe2b0) at thread/qthread_unix.cpp:368
#8  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#9  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f4b9ba6c700 (LWP 6053)):
#0  0x00007f4ba7cb2a6c in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f4ba7c6e73d in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b940008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#4  0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4b9ba6bdc0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f4bab286494 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:507
#6  0x00007f4bab28a60b in QThreadPrivate::start (arg=0x16f4ec0) at thread/qthread_unix.cpp:368
#7  0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#8  0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f4ba0d74700 (LWP 5056)):
#0  0x00007f4bab283059 in std::__atomic_base<QMutexData*>::compare_exchange_strong (__m2=<optimized out>, __m1=std::memory_order_release, __p2=0x0, __p1=@0x7f4ba0d73b38: 0x1, this=0x16f0e50) at /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/bits/atomic_base.h:752
#1  std::atomic<QMutexData*>::compare_exchange_strong (__m=std::memory_order_release, __p2=0x0, __p1=@0x7f4ba0d73b38: 0x1, this=0x16f0e50) at /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/atomic:475
#2  QAtomicOps<QMutexData*>::testAndSetRelease<QMutexData*> (currentValue=<synthetic pointer>, newValue=0x0, expectedValue=0x1, _q_value=...) at ../../include/QtCore/../../src/corelib/arch/qatomic_cxx11.h:299
#3  QBasicAtomicPointer<QMutexData>::testAndSetRelease (currentValue=<synthetic pointer>: <optimized out>, newValue=0x0, expectedValue=<optimized out>, this=0x16f0e50) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:261
#4  QBasicMutex::fastTryUnlock (current=<synthetic pointer>: <optimized out>, this=0x16f0e50) at thread/qmutex.h:92
#5  QMutex::unlock (this=this@entry=0x16f0e50) at thread/qmutex.cpp:277
#6  0x00007f4bab46e7ad in QMutexLocker::unlock (this=<synthetic pointer>) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:147
#7  QMutexLocker::~QMutexLocker (this=<synthetic pointer>, __in_chrg=<optimized out>) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:141
#8  QThreadData::canWaitLocked (this=0x16f0e20) at ../../include/QtCore/5.7.1/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:253
#9  postEventSourcePrepare (s=0x7f4b9c0012d0, timeout=0x7f4ba0d73bc4) at kernel/qeventdispatcher_glib.cpp:259
#10 0x00007f4ba7c6de0c in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#11 0x00007f4ba7c6e7bb in ?? () from /usr/lib64/libglib-2.0.so.0
#12 0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#13 0x00007f4bab46e8cb in QEventDispatcherGlib::processEvents (this=0x7f4b9c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#14 0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7f4ba0d73d90, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#15 0x00007f4bab286494 in QThread::exec (this=this@entry=0x7f4bab72bec0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:507
#16 0x00007f4bab6ba635 in QDBusConnectionManager::run (this=0x7f4bab72bec0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#17 0x00007f4bab28a60b in QThreadPrivate::start (arg=0x7f4bab72bec0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:368
#18 0x00007f4ba9c0434c in start_thread () from /lib64/libpthread.so.0
#19 0x00007f4baa92339f in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f4babed3f00 (LWP 5018)):
#0  0x00007f4ba9c0a2c8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f4bab28ac28 in QWaitConditionPrivate::wait_relative (time=10000, this=0x178ece0) at thread/qwaitcondition_unix.cpp:133
#2  QWaitConditionPrivate::wait (time=10000, this=0x178ece0) at thread/qwaitcondition_unix.cpp:141
#3  QWaitCondition::wait (this=this@entry=0x178ecc0, mutex=mutex@entry=0x178eca0, time=time@entry=10000) at thread/qwaitcondition_unix.cpp:215
#4  0x00007f4bab28a236 in QThread::wait (this=<optimized out>, time=time@entry=10000) at thread/qthread_unix.cpp:698
#5  0x000000000052417a in Akonadi::Server::AkThread::quitThread (this=this@entry=0x178edb0) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/akthread.cpp:62
#6  0x000000000042b5ec in Akonadi::Server::Connection::~Connection (this=0x178edb0, __in_chrg=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/connection.cpp:149
#7  0x000000000042b731 in Akonadi::Server::Connection::~Connection (this=0x178edb0, __in_chrg=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/connection.cpp:154
#8  0x000000000042884e in qDeleteAll<QTypedArrayData<Akonadi::Server::Connection*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:323
#9  qDeleteAll<QVector<Akonadi::Server::Connection*> > (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:331
#10 Akonadi::Server::AkonadiServer::quit (this=0x16f2870) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/akonadi.cpp:304
#11 0x0000000000515a66 in ServerAdaptor::quit (this=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2_build/src/server/serveradaptor.cpp:39
#12 ServerAdaptor::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2_build/src/server/serveradaptor.moc:86
#13 0x0000000000515be3 in ServerAdaptor::qt_metacall (this=0x17238b0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff54eadc80) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2_build/src/server/serveradaptor.moc:120
#14 0x00007f4bab6c5f5e in QDBusConnectionPrivate::deliverCall (this=this@entry=0x7f4b9c0032f0, object=object@entry=0x17238b0, msg=..., metaTypes=..., slotIdx=<optimized out>) at qdbusintegrator.cpp:995
#15 0x00007f4bab6ca171 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7f4b9c0032f0, object=0x17238b0, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:898
#16 0x00007f4bab6caa62 in QDBusConnectionPrivate::activateObject (this=0x7f4b9c0032f0, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1488
#17 0x00007f4bab6cd17e in QDBusActivateObjectEvent::placeMetaCall (this=0x7f4b9c020520) at qdbusintegrator.cpp:1608
#18 0x00007f4bab449c91 in QObject::event (this=0x16f2870, e=<optimized out>) at kernel/qobject.cpp:1263
#19 0x00007f4bab4233e2 in doNotify (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1063
#20 0x00007f4bab423519 in QCoreApplication::notifyInternal2 (receiver=0x16f2870, event=event@entry=0x7f4b9c020520) at kernel/qcoreapplication.cpp:988
#21 0x00007f4bab425af1 in QCoreApplication::sendEvent (event=0x7f4b9c020520, receiver=<optimized out>) at kernel/qcoreapplication.h:231
#22 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x16ed550) at kernel/qcoreapplication.cpp:1649
#23 0x00007f4bab425f58 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1503
#24 0x00007f4bab46e833 in postEventSourceDispatch (s=0x16ef650) at kernel/qeventdispatcher_glib.cpp:276
#25 0x00007f4ba7c6e68e in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#26 0x00007f4ba7c6e8f0 in ?? () from /usr/lib64/libglib-2.0.so.0
#27 0x00007f4ba7c6e99c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#28 0x00007f4bab46e8a7 in QEventDispatcherGlib::processEvents (this=0x16ef700, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#29 0x00007f4bab42251a in QEventLoop::exec (this=this@entry=0x7fff54eae2a0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#30 0x00007f4bab429d44 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1261
#31 0x0000000000580f3d in AkApplicationBase::exec (this=this@entry=0x7fff54eae400) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/shared/akapplication.cpp:125
#32 0x0000000000423f92 in main (argc=1, argv=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-16.12.2/work/akonadi-16.12.2/src/server/main.cpp:81

Reported using DrKonqi
Comment 1 Daniel Vrátil 2017-02-23 18:46:19 UTC
Git commit 5219f770b998aad16a3d51bbd4f4c7ceb8b143c9 by Daniel Vrátil.
Committed on 23/02/2017 at 18:45.
Pushed by dvratil into branch 'Applications/16.12'.

DataStream: throw exception if device is null

During Connection destruction it can happen that the socket is
deleted, but the actual handler is still running and tries to
write to that socket (in which case it passes a nullptr to
DataStream). This is caused by the issue described in #376822.

To prevent the crash in this case (until the root cause is fixed)
the DataStream throws an exception if its used without a valid
device. This will effectively cause execution to leave the Handler
and return.
FIXED-IN: 5.4.3

M  +5    -2    src/private/datastream_p.cpp
M  +10   -6    src/private/datastream_p_p.h

https://commits.kde.org/akonadi/5219f770b998aad16a3d51bbd4f4c7ceb8b143c9