Bug 426937 - touchpad kded crashed in XlibNotifications::processEvents()
Summary: touchpad kded crashed in XlibNotifications::processEvents()
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_touchpad (show other bugs)
Version: 5.27.4
Platform: Arch Linux Linux
: HI crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 409073 417095 451045 466387 466944 471431 473262 474225 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-09-24 22:17 UTC by Michał Lubas
Modified: 2023-09-12 02:01 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.8


Attachments
KDE Crash Handler info (no backtrace). (228 bytes, text/plain)
2021-08-18 02:49 UTC, Noah Westervelt
Details
Journalctl output around time of crash. (5.15 KB, text/plain)
2021-08-18 02:49 UTC, Noah Westervelt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Lubas 2020-09-24 22:17:36 UTC
SUMMARY
kded5: Segmentation fault when I plug in Dualshock 4 (CUH-ZCT2E) controller using xf86-input-libinput. The problem does not occur with xf86-input-synaptics installed which seems to replace the libinput one as it changes the KDE system settings touchpad options.

STEPS TO REPRODUCE
1. Plug in Dualshock 4 controller.

OBSERVED RESULT
System tray icons disappear and then reappear shortly after. Some of them are missing (Discord). Getting notification about network connection again just like after system boot.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Kernel Version: 5.8.10-arch1-1
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4790K CPU @ 4.00GHz
Memory: 11.6 GiB of RAM
Graphics Processor: Radeon RX 570 Series

ADDITIONAL INFORMATION

drkonqi info after recompiling some packages with -DCMAKE_BUILD_TYPE=Debug and options=(debug !strip):

Application: kded5 (kded5), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f689f1a593a in XPending (dpy=0x18) at Pending.c:51
#5  0x00007f686d4a86b8 in XlibNotifications::processEvents() (this=0x55661d5894b0) at /usr/src/debug/plasma-desktop-5.19.5/kcms/touchpad/backends/x11/xlibnotifications.cpp:79
#6  0x00007f689fb8e070 in  () at /usr/lib/libQt5Core.so.5
#7  0x00007f689fb91615 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#8  0x00007f689fb91dc8 in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007f68a0849752 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007f689fb56cda in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#11 0x00007f689fbb0556 in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f689e748bfc in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007f689e79a1f9 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007f689e747421 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#15 0x00007f689fbaf941 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#16 0x00007f689fb5565c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007f689fb5daf4 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#18 0x000055661b18294e in main(int, char**) (argc=<optimized out>, argv=0x7ffef0b59fe8) at /usr/src/debug/kded-5.74.0/src/kded.cpp:796
[Inferior 1 (process 804) detached]
Comment 1 Noah Westervelt 2021-08-18 02:49:11 UTC
Created attachment 140807 [details]
KDE Crash Handler info (no backtrace).
Comment 2 Noah Westervelt 2021-08-18 02:49:32 UTC
Created attachment 140808 [details]
Journalctl output around time of crash.
Comment 3 Noah Westervelt 2021-08-18 02:49:43 UTC
This also happens to me on openSUSE Tumbleweed with the Dualshock 4 controller. It's been happening to me for a while, I just never bothered creating a bug report until now.

I've attached what the KDE Crash Handler tells me (backtrace doesn't work for some reason) and the output in my journalctl around the time that the crash happens.
Comment 4 Noah Westervelt 2021-08-28 06:21:39 UTC
For some reason, after I switched to using 'pipewire-pulseaudio' instead of 'pulseaudio' this crash stopped happening when plugging my Dualshock 4 controller into my computer.

The Dualshock 4 controller does have a 3.5mm aux jack on it (4-pole, input/output) so that could have something to do with it. I don't know for sure.
Comment 5 Nicolas Fella 2022-03-02 23:52:29 UTC
*** Bug 451045 has been marked as a duplicate of this bug. ***
Comment 6 Nicolas Fella 2022-03-03 01:23:54 UTC
*** Bug 409073 has been marked as a duplicate of this bug. ***
Comment 7 Nicolas Fella 2023-02-25 15:35:04 UTC
*** Bug 466387 has been marked as a duplicate of this bug. ***
Comment 8 Dylan 2023-04-18 15:41:06 UTC
Still having this issue when connecting CUH-ZCT2U via bluetooth (or even plugging in via USB I believe).

Operating System: Arch Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 6.2.11-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6650 XT

Application: kded5 (kded5), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f193cd08bfd in XPending () at /usr/lib/libX11.so.6
#5  0x00007f1929f26c87 in  () at /usr/lib/qt/plugins/kf5/kded/kded_touchpad.so
#6  0x00007f193d6becf0 in  () at /usr/lib/libQt5Core.so.5
#7  0x00007f193d6c0a69 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#8  0x00007f193d6c0b5b in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007f193e378b5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007f193d68e028 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#11 0x00007f193d6d7b96 in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f193c50f53b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007f193c56c219 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007f193c50e1a2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#15 0x00007f193d6d8d3c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#16 0x00007f193d68668c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007f193d6912f9 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#18 0x0000560427b42040 in  ()
#19 0x00007f193ce3c790 in  () at /usr/lib/libc.so.6
#20 0x00007f193ce3c84a in __libc_start_main () at /usr/lib/libc.so.6
#21 0x0000560427b420c5 in  ()
[Inferior 1 (process 745) detached]

It might have something to do with me manually disabling mouse acceleration through libinput, though I'm not sure:
File /etc/X11/xorg.conf.d/50-mouse-acceleration.conf:

Section "InputClass"
    Identifier "My Glorious Model D"
    Driver "libinput"
    MatchProduct "Glorious Model D"
    Option "AccelProfile" "flat"
    Option "AccelSpeed" "0"
EndSection
Comment 9 Dylan 2023-04-18 15:51:55 UTC
After installing debug symbols, the Crash Info from Dr Konqi is as follows:

Application: kded5 (kded5), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  0x00007f193cd08bfd in XPending (dpy=0x18) at /usr/src/debug/libx11/libX11-1.8.4/src/Pending.c:51
#7  0x00007f1929f26c87 in XlibNotifications::processEvents() (this=<optimized out>) at /usr/src/debug/plasma-desktop/plasma-desktop-5.27.4/kcms/touchpad/backends/x11/xlibnotifications.cpp:63
#8  XlibNotifications::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x560429d59f20, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/plasma-desktop/build/kcms/touchpad/touchpad_autogen/include/moc_xlibnotifications.cpp:91
#9  0x00007f193d6becf0 in doActivate<false>(QObject*, int, void**) (sender=0x560429c8e840, signal_index=5, argv=0x7ffc7f15d8b0) at kernel/qobject.cpp:3935
#10 0x00007f193d6c0a69 in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) (this=this@entry=0x560429c8e840, _t1=<optimized out>, _t2=...) at .moc/moc_qsocketnotifier.cpp:185
#11 0x00007f193d6c0b5b in QSocketNotifier::event(QEvent*) (this=0x560429c8e840, e=<optimized out>) at kernel/qsocketnotifier.h:115
#12 0x00007f193e378b5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x560429c8e840, e=0x7ffc7f15d9c0) at kernel/qapplication.cpp:3640
#13 0x00007f193d68e028 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x560429c8e840, event=0x7ffc7f15d9c0) at kernel/qcoreapplication.cpp:1064
#14 0x00007f193d6d7b96 in socketNotifierSourceDispatch(GSource*, GSourceFunc, gpointer) (source=0x560429a1f930) at kernel/qeventdispatcher_glib.cpp:107
#15 0x00007f193c50f53b in g_main_dispatch (context=0x7f1934000ee0) at ../glib/glib/gmain.c:3460
#16 g_main_context_dispatch (context=0x7f1934000ee0) at ../glib/glib/gmain.c:4200
#17 0x00007f193c56c219 in g_main_context_iterate.constprop.0 (context=0x7f1934000ee0, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4276
#18 0x00007f193c50e1a2 in g_main_context_iteration (context=0x7f1934000ee0, may_block=1) at ../glib/glib/gmain.c:4343
#19 0x00007f193d6d8d3c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x560429a23f30, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#20 0x00007f193d68668c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7ffc7f15dc40, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#21 0x00007f193d6912f9 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#22 0x00007f193db3b052 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#23 0x00007f193e376f2a in QApplication::exec() () at kernel/qapplication.cpp:2832
#24 0x0000560427b42040 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kded/kded-5.105.0/src/kded.cpp:785
[Inferior 1 (process 745) detached]
Comment 10 Nicolas Fella 2023-09-06 14:07:38 UTC
*** Bug 466944 has been marked as a duplicate of this bug. ***
Comment 11 Nicolas Fella 2023-09-06 14:10:22 UTC
*** Bug 471431 has been marked as a duplicate of this bug. ***
Comment 12 Nicolas Fella 2023-09-06 14:15:31 UTC
*** Bug 474225 has been marked as a duplicate of this bug. ***
Comment 13 Nicolas Fella 2023-09-06 14:18:27 UTC
*** Bug 473262 has been marked as a duplicate of this bug. ***
Comment 14 Nicolas Fella 2023-09-06 14:19:58 UTC
According to https://bugs.kde.org/show_bug.cgi?id=473262 this is fixed with https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1672 in Plasma 5.27.8
Comment 15 Nicolas Fella 2023-09-06 14:21:44 UTC
*** Bug 417095 has been marked as a duplicate of this bug. ***
Comment 16 Fushan Wen 2023-09-11 17:42:25 UTC
Git commit a01d42f13dd966dfc84719d421fa357b75436d97 by Fushan Wen.
Committed on 11/09/2023 at 19:36.
Pushed by fusionfuture into branch 'Plasma/5.27'.

XlibNotifications: port to modern signal-slot

To prevent orphaned slots from being activated.
Related: bug 473262
FIXED-IN: 5.27.8
(cherry picked from commit 5de6a801b4c777256665db525513633516da6bb8)

M  +1    -1    kcms/touchpad/backends/x11/xlibnotifications.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/a01d42f13dd966dfc84719d421fa357b75436d97
Comment 17 Fushan Wen 2023-09-11 17:42:49 UTC
Git commit 1476b602bcab5d181d0b48b1f40a3b39923517e9 by Fushan Wen.
Committed on 11/09/2023 at 19:36.
Pushed by fusionfuture into branch 'Plasma/5.27'.

XlibBackend: port to modern signal-slot

To prevent orphaned slots from being activated.
Related: bug 473262
(cherry picked from commit 9538a770c40bb64dadae84d198a3551ae4e531d5)

M  +5    -5    kcms/touchpad/backends/x11/xlibbackend.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/1476b602bcab5d181d0b48b1f40a3b39923517e9
Comment 18 Gabriel Souza Franco 2023-09-12 01:55:55 UTC
Git commit a501f0987778ffb5c4508b314d2e04863dd9fb2a by Gabriel Souza Franco.
Committed on 12/09/2023 at 03:46.
Pushed by gabrielsf into branch 'master'.

Fix touchpad kded crash on X11

XlibBackend::devicePlugged gets called by m_notifications, need to use
deleteLater() here to avoid a user-after-free crash.

M  +2    -1    kcms/touchpad/backends/x11/xlibbackend.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/a501f0987778ffb5c4508b314d2e04863dd9fb2a
Comment 19 Gabriel Souza Franco 2023-09-12 02:01:40 UTC
Git commit 38b4e328f9a961114c506fcf72ef6deccd71368c by Gabriel Souza Franco.
Committed on 12/09/2023 at 03:54.
Pushed by gabrielsf into branch 'Plasma/5.27'.

Fix touchpad kded crash on X11

XlibBackend::devicePlugged gets called by m_notifications, need to use
deleteLater() here to avoid a user-after-free crash.
(cherry picked from commit a501f0987778ffb5c4508b314d2e04863dd9fb2a)

M  +2    -1    kcms/touchpad/backends/x11/xlibbackend.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/38b4e328f9a961114c506fcf72ef6deccd71368c