Bug 394071 - Kmail crash after searching message
Summary: Kmail crash after searching message
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: akonadiconsole (show other bugs)
Version: 5.8.1
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-10 08:45 UTC by Alain
Modified: 2018-07-05 12:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.8.3


Attachments
This is the crash report generated by akonadiserver. (86.87 KB, text/plain)
2018-05-10 08:45 UTC, Alain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alain 2018-05-10 08:45:55 UTC
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,
Comment 1 Christoph Feck 2018-06-05 22:45:24 UTC
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
Comment 2 Daniel Vrátil 2018-07-05 12:16:27 UTC
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