Created attachment 112558 [details] This is the crash report generated by akonadiserver. I selected "find a message" in the kmail tool menu. I filled the popup window, typed search. Then kmail asked me either to re-index the directory (during all the tests I have done in order to reproduce the crash, kmail always asked me to re-index, even I did it before) or to continue. Kmail crashed for the both choices. The message I received (in french): "Le service de gestion des informations personnelles n'est pas opérationnel. Il est impossible d'utiliser cette application sans ce service." Best regards,
Analyzing the backtrace: Thread 37 crashes because of a null socket in Akonadi::Server::Connection::handleIncomingData(). We see that Thread 1 has already deleted Akonadi::Server::Connection. Pasting relevant parts of the backtrace: Thread 37 (Thread 0x7f07bedec700 (LWP 2056)): [KCrash Handler] #6 QLocalSocket::state (this=0x0) at socket/qlocalsocket.cpp:453 #7 0x0000000000423178 in Akonadi::Server::Connection::handleIncomingData (this=0x1d044d0) at /workspace/build/src/server/connection.cpp:208 #8 0x00007f081e082de6 in QtPrivate::QSlotObjectBase::call (a=0x7f07bedeb950, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:378 #9 QSingleShotTimer::timerEvent (this=0x7f07f000da50) at kernel/qtimer.cpp:318 #10 0x00007f081e077483 in QObject::event (this=0x7f07f000da50, e=<optimized out>) at kernel/qobject.cpp:1268 #11 0x00007f081e0493bb in doNotify (event=0x7f07bedeba70, receiver=0x7f07f000da50) at kernel/qcoreapplication.cpp:1134 Thread 1 (Thread 0x7f081f7d2900 (LWP 1744)): #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225 #1 0x00007f081de6d5b6 in QWaitConditionPrivate::wait_relative (time=10000, this=0x1d06790) at thread/qwaitcondition_unix.cpp:133 #2 QWaitConditionPrivate::wait (time=10000, this=0x1d06790) at thread/qwaitcondition_unix.cpp:141 #3 QWaitCondition::wait (this=this@entry=0x1d03f70, mutex=mutex@entry=0x1d03f50, time=time@entry=10000) at thread/qwaitcondition_unix.cpp:215 #4 0x00007f081de6c28e in QThread::wait (this=<optimized out>, time=time@entry=10000) at thread/qthread_unix.cpp:741 #5 0x000000000052635a in Akonadi::Server::AkThread::quitThread (this=this@entry=0x1d044d0) at /workspace/build/src/server/akthread.cpp:74 #6 0x0000000000421c4c in Akonadi::Server::Connection::~Connection (this=0x1d044d0, __in_chrg=<optimized out>) at /workspace/build/src/server/connection.cpp:170 #7 0x0000000000421d99 in Akonadi::Server::Connection::~Connection (this=0x1d044d0, __in_chrg=<optimized out>) at /workspace/build/src/server/connection.cpp:175 #8 0x00007f081e0774c9 in QObject::event (this=0x1bd8350, e=<optimized out>) at kernel/qobject.cpp:1246 #9 0x00007f081e0493bb in doNotify (event=0x7f07f000d960, receiver=0x1bd8350) at kernel/qcoreapplication.cpp:1134
Git commit 154cfb8fc2d2bb92e429523ba62ce90e257f0118 by Daniel Vrátil. Committed on 05/07/2018 at 12:15. Pushed by dvratil into branch 'Applications/18.04'. Server: handle race condition on connection shutdown When client sends a command and disconnects immediatelly it is possible that the Connection gets mostly torn down from a nested event loop before we get back to the main loop in handleIncomingData(), leading to m_socket being null when we try to access it. FIXED-IN: 5.8.3 M +3 -3 src/server/connection.cpp https://commits.kde.org/akonadi/154cfb8fc2d2bb92e429523ba62ce90e257f0118