Bug 452988 - kwin_wayland segfaults in KWin::LockScreenFilter::pointerEvent() when laptop screen is closed, turned off, and then reopened
Summary: kwin_wayland segfaults in KWin::LockScreenFilter::pointerEvent() when laptop ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-25 14:21 UTC by Luca Beltrame
Modified: 2022-04-27 18:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25


Attachments
Backtrace from coredumpctl (7.30 KB, text/plain)
2022-04-25 14:21 UTC, Luca Beltrame
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Beltrame 2022-04-25 14:21:02 UTC
Created attachment 148356 [details]
Backtrace from coredumpctl

SUMMARY

When I close my laptop screen (regardless if the machine suspends or not), if the laptop screen is turned off, kwin_wayland will crash once the screen is opened again and the screen is turned on again. This also happens if the screen is simply turned off for energy saving.

A look at the backtrace (attached) suggests that it attempts to access a member of an object that's however null.


STEPS TO REPRODUCE
1.  Close laptop screen
2.  Wait until laptop suspends
3.  Open laptop screen

OBSERVED RESULT

kwin_wayland crashes. 

EXPECTED RESULT

kwin_wayland should not crash.

SOFTWARE/OS VERSIONS
KDE Plasma Version:  latest git master
KDE Frameworks Version: latest git master
Qt Version: Qt 5.15.3 + KDE patches

ADDITIONAL INFORMATION

Test machine: Lenovo Thinkpad T470, with latest stable Mesa and kernel 5.17.3.

Excerpt from gdb debug session:

Core was generated by `/usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayl'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  KWin::LockScreenFilter::pointerEvent (this=<optimized out>, event=0x7ffe50e6bd80, nativeButton=0)
    at /usr/src/debug/kwin5-5.24.80git.20220423T142940~8455427dbc-ku.78.1.x86_64/src/input.cpp:354
354             if (window->isClient() && window->isLockScreen()) {
[Current thread is 1 (Thread 0x7f03e7d45980 (LWP 25016))]
(gdb) print window
$1 = (KWin::Window *) 0x0
(gdb)
Comment 1 Zamundaaa 2022-04-26 20:42:43 UTC
Should be fixed with https://invent.kde.org/plasma/kwin/-/merge_requests/2293