Bug 464525 - kwin_x11 hangs when USB keyboard unplugged while laptop suspended
Summary: kwin_x11 hangs when USB keyboard unplugged while laptop suspended
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.26.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-19 22:01 UTC by magiblot
Modified: 2023-03-09 20:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
kwin_x11 stacktrace during hang (gdb thread apply all bt) (38.78 KB, text/plain)
2023-01-19 22:01 UTC, magiblot
Details
Xorg stacktrace during hang (gdb thread apply all bt) (27.29 KB, text/plain)
2023-01-19 22:02 UTC, magiblot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description magiblot 2023-01-19 22:01:10 UTC
Created attachment 155438 [details]
kwin_x11 stacktrace during hang (gdb thread apply all bt)

SUMMARY

kwin_x11 hangs when USB keyboard is unplugged while the laptop is suspended.

STEPS TO REPRODUCE

1. Plug an external USB keyboard to my laptop. (probably a mouse also works, or both)
2. Start a X11 Plasma session.
3. Suspend the laptop and close the lid.
4. Unplug the external keyboard.
5. Open the laptop lid, so that it wakes up from suspension.

OBSERVED RESULT

The desktop doesn't show up. The screen remains black. The laptop's keyboard and touchpad are unresponsive. The external keyboard, if plugged again, is also unresponsive. I have to press SysRq key combinations to kill the X server or reboot, or log into the machine via SSH. Switching VTs does not work: chvt hangs.

EXPECTED RESULT

The desktop shows up and the laptop's keyboard and touchpad work properly.

SOFTWARE/OS VERSIONS

Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.6-arch1-3 (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-8750H CPU @ 2.20GHz
Memory: 30,8 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630

ADDITIONAL INFORMATION

Thank you very much.
Comment 1 magiblot 2023-01-19 22:02:55 UTC
Created attachment 155439 [details]
Xorg stacktrace during hang (gdb thread apply all bt)
Comment 2 Vlad Zahorodnii 2023-01-20 12:13:57 UTC
kwin hangs in QtXCB's Xinput code. While looking at the code, it seems like Qt waits for a reply from X server. Can you report this issue to Xorg developers please and leave a link here?
Comment 3 magiblot 2023-01-20 15:03:56 UTC
If I am to report this to Xorg it would be best to first collect more information. Is there any way I can get a log of the messages sent between Kwin and Xorg, so that it becomes evident which message Kwin is waiting a response for, and whether Xorg is actually at fault for not responding?
Comment 4 magiblot 2023-03-09 20:15:29 UTC
Hi @Vlad Zahorodnii, could you please help me with the question I made in Comment 3? Before reporting this as an Xorg bug, we should first make sure that Kwin is not, for example, waiting a reply to a message it has not even sent. A log would clear any doubts.

Thank you.