Skip to content

delete client builder before d-pointer of KXMLGUIClient is killed

Christoph Cullmann requested to merge work/fix_closing_segfault into master

See crash report:

Application: Kate (kate), signal: Segmentation fault
Content of s_kcrashErrorMessage: [Current thread is 1 (Thread 0x7f3fe24cd8c0 (LWP 1722279))]
[KCrash Handler]
#5  KXMLGUIClient::clientBuilder (this=0x55a42b8c3258) at /local/ssd/cullmann/kde/src/frameworks/kxmlgui/src/kxmlguiclient.cpp:688
#6  0x00007f3fd3ae2311 in operator() (__closure=0x55a42ba6e660) at /local/ssd/cullmann/kde/src/kde/applications/konsole/src/session/SessionController.cpp:1770
#7  0x00007f3fd3ae3e4a in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Konsole::SessionController::showDisplayContextMenu(const QPoint&)::<lambda()> >::call(struct {...} &, void **) (f=..., arg=0x7ffd70e07630) at /usr/include/qt/QtCore/qobjectdefs_impl.h:146
#8  0x00007f3fd3ae3d87 in QtPrivate::Functor<Konsole::SessionController::showDisplayContextMenu(const QPoint&)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void **) (f=..., arg=0x7ffd70e07630) at /usr/include/qt/QtCore/qobjectdefs_impl.h:256
#9  0x00007f3fd3ae3ca2 in QtPrivate::QFunctorSlotObject<Konsole::SessionController::showDisplayContextMenu(const QPoint&)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1, this_=0x55a42ba6e650, r=0x55a42b8c3220, a=0x7ffd70e07630, ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:443
#10 0x00007f3fe69fcdd6 in ?? () from /usr/lib/libQt5Core.so.5
#11 0x00007f3fe69f6020 in QObject::destroyed(QObject*) () from /usr/lib/libQt5Core.so.5
#12 0x00007f3fe69fb0f7 in QObject::~QObject() () from /usr/lib/libQt5Core.so.5

=> clientBuild() will access the d-pointer of KXMLGUIClient that is long gone during the runtime of the ~QObject destructor.

BUG: 432421

Edited by Christoph Cullmann

Merge request reports