Bug 442573 - Kwin crashes after disconnecting a bluetooth drawing tablet
Summary: Kwin crashes after disconnecting a bluetooth drawing tablet
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.22.90
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability, wayland
Depends on:
Blocks:
 
Reported: 2021-09-17 04:06 UTC by Samuel Reddy
Modified: 2021-09-17 15:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23


Attachments
Kwin Backtrace (9.99 KB, text/vnd.kde.kcrash-report)
2021-09-17 04:06 UTC, Samuel Reddy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Reddy 2021-09-17 04:06:20 UTC
Created attachment 141635 [details]
Kwin Backtrace

SUMMARY:
When I connect my wacom drawing tablet to my computer using bluetooth and then disconnect the tablet by powering it off, kwin crashes, bringing down my whole wayland session and lose all my windows.

STEPS TO REPRODUCE:
1. Connect bluetooth drawing tablet
2. Use it for a bit
3. Disconnect the bluetooth drawing tablet
4. Kwin crashes and brings down the whole wayland session

OBSERVED RESULT:
Kwin crashes after I disconnect the bluetooth drawing tablet.

EXPECTED RESULT:
Kwin does not crash.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
Operating System: Arch Linux
KDE Plasma Version: 5.22.90
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.14.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 5 3450U with Radeon Vega Mobile Gfx
Memory: 5.7 GiB of RAM
Graphics Processor: AMD Radeon™ Vega 8 Graphics

ADDITIONAL INFORMATION:
I recompiled kwin, kwayland, kwayland-integration, kwayland-server, qt5-base, qt5-wayland and wayland with debugging support, because Arch Linux doesn't have debugging packages.
Comment 1 Vlad Zahorodnii 2021-09-17 10:08:41 UTC
#0  0x00007fb613383e08 in KWaylandServer::TabletV2Interface::isSurfaceSupported(KWaylandServer::SurfaceInterface*) const (this=this@entry=0x0, surface=surface@entry=0x5569d36ebc30)
    at /usr/src/debug/kwayland-server-5.22.90/src/server/tablet_v2_interface.cpp:63
#1  0x00007fb614174e2f in KWin::TabletInputFilter::tabletToolEvent(KWin::TabletEvent*) (this=0x5569d32e0c30, event=0x7ffcdafb55a0) at /usr/src/debug/kwin-5.22.90/src/input.cpp:1787

interesting... Aleix, do you know how TabletV2Interface can end up being nullptr?
Comment 2 Bug Janitor Service 2021-09-17 13:23:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1431
Comment 3 Aleix Pol 2021-09-17 13:34:52 UTC
Git commit 8825c01b15a3ca850cc0fa565f1c2fa483df6bbe by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 17/09/2021 at 13:33.
Pushed by apol into branch 'master'.

tablet: Fix disconnecting the tablet while the pen is still in proximity

libinput will send release and proximity out events after the device is
disconnected.
This just takes into account that tablet might be nullptr.

M  +3    -1    src/input.cpp

https://invent.kde.org/plasma/kwin/commit/8825c01b15a3ca850cc0fa565f1c2fa483df6bbe
Comment 4 Aleix Pol 2021-09-17 13:35:32 UTC
Git commit 0cce8bab42c5d3e53c09f5c104a863cbdd9b441d by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 17/09/2021 at 13:35.
Pushed by apol into branch 'Plasma/5.23'.

tablet: Fix disconnecting the tablet while the pen is still in proximity

libinput will send release and proximity out events after the device is
disconnected.
This just takes into account that tablet might be nullptr.


(cherry picked from commit 8825c01b15a3ca850cc0fa565f1c2fa483df6bbe)

M  +3    -1    src/input.cpp

https://invent.kde.org/plasma/kwin/commit/0cce8bab42c5d3e53c09f5c104a863cbdd9b441d