Bug 471789 - Crash in KWaylandServer::KeyboardInterface::sendKey
Summary: Crash in KWaylandServer::KeyboardInterface::sendKey
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.6
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-30 06:30 UTC by Mark
Modified: 2023-07-08 02:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
kwin_wayland backtrace (22.58 KB, text/plain)
2023-06-30 06:30 UTC, Mark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2023-06-30 06:30:48 UTC
Created attachment 159987 [details]
kwin_wayland backtrace

SUMMARY
kwin_wayland randomly crashes when (I believe) attempting to work with the clipboard, but cannot say for sure. It certainly appeared random, and I can say I certainly saw it happen at least twice. I have attached a backtrace of the latest crash.

STEPS TO REPRODUCE
1. Start a plasmashell session
2. Do things on the desktop
3. Crash

OBSERVED RESULT
kwin_wayland crashes.

EXPECTED RESULT
kwin_wayland shouldn't crash when attempting to use the clipboard.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230628
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.9-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 SUPER/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B450M DS3H

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2023-06-30 07:49:44 UTC
#0  KWaylandServer::ClientConnection::client() const (this=0x0) at /usr/include/c++/13/bits/unique_ptr.h:199
#1  0x00007fed6ebca328 in KWaylandServer::KeyboardInterfacePrivate::keyboardsForClient(KWaylandServer::ClientConnection*) const (this=0x560c5e4f57f0, client=0x0) at /usr/src/debug/kwin-5.27.6/src/wayland/keyboard_interface.cpp:52
#2  0x00007fed6ebcaac8 in KWaylandServer::KeyboardInterface::sendKey(unsigned int, KWaylandServer::KeyboardKeyState, KWaylandServer::ClientConnection*) (this=0x560c5e4f5770, key=28, state=KWaylandServer::KeyboardKeyState::Released, client=<optimized out>) at /usr/src/debug/kwin-5.27.6/src/wayland/keyboard_interface.cpp:174
        keyboards = {<QListSpecialMethods<QtWaylandServer::wl_keyboard::Resource*>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = std::atomic<int> = { -1 }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x1000021}, d = 0x1000021}}
        serial = <optimized out>
#3  0x00007fed6ea3d001 in std::__invoke_impl<void, void (KWin::InputEventSpy::*&)(KWin::KeyEvent*), KWin::InputEventSpy* const&, KWin::KeyEvent*&>(std::__invoke_memfun_deref, void (KWin::InputEventSpy::*&)(KWin::KeyEvent*), KWin::InputEventSpy* const&, KWin::KeyEvent*&) (__f=<optimized out>, __t=@0x560c5ed241f8: 0x560c5eba9910) at /usr/include/c++/13/bits/invoke.h:74
        type = QEvent::KeyRelease
        autoRepeat = <optimized out>
        previousLayout = 0
        keySym = 65507
        globalShortcutsModifiers = {i = <optimized out>}
Comment 2 Bug Janitor Service 2023-06-30 08:27:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4224
Comment 3 David Edmundson 2023-07-01 12:20:52 UTC
Git commit e93adbee074a2527e83851a1690440ce53aa021b by David Edmundson.
Committed on 01/07/2023 at 11:47.
Pushed by davidedmundson into branch 'master'.

xwayland: Guard against xwyayland connection closing in input spy

The event spy is removed when xwayland closed, but it's based on the
process not the wayland socket, so it can be temporarily out of sync.

There were no guards for the connection being null.

M  +4    -3    src/xwayland/xwayland.cpp

https://invent.kde.org/plasma/kwin/-/commit/e93adbee074a2527e83851a1690440ce53aa021b