Bug 452243 - Programs running on Xwayland randomly crash and Xwayland stops working
Summary: Programs running on Xwayland randomly crash and Xwayland stops working
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.24.4
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL: https://gitlab.freedesktop.org/xorg/x...
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2022-04-03 23:03 UTC by db0
Modified: 2022-06-29 16:07 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
excerpt from system logs during time of crash (3.67 KB, text/x-log)
2022-04-03 23:03 UTC, db0
Details
SDDM wayland-session.log (1.29 MB, application/zip)
2022-05-18 16:25 UTC, winblocker
Details
journalctl (47.46 KB, application/zip)
2022-05-18 16:26 UTC, winblocker
Details
gdb log (3.04 KB, text/plain)
2022-05-24 13:26 UTC, winblocker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description db0 2022-04-03 23:03:24 UTC
Created attachment 147945 [details]
excerpt from system logs during time of crash

SUMMARY
While using the wayland session X11 programs running via Xwayland(such as STM32CubeIDE and Xilinx Vivado) randomly crash with no useful information in logs. After this happens, the session continues to work without any issues but X11 programs are not displayed anymore. They do run in the background but aren't displayed. This can only be fixed by logging out and in. Unfortunately no core dumps are generated and the logs only tell that Xwayland/the X11 server has died.

Unfortunately I don't have much than can be useful for identifying the cause but I would be more than happy to perform troubleshooting if anyone has any suggestions.

STEPS TO REPRODUCE
1. Run any X11 program via Xwayland
2. Wait for an indeterminate/seemingly random amount of time

OBSERVED RESULT
Xwayland(and thus the program) crashes and afterwards all X11 programs aren't being displayed anymore until the session gets restarted

EXPECTED RESULT
The program continues to run without issues

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.17.1-zen1-1-zen (64-bit)
Graphics Platform: Wayland
ADDITIONAL INFORMATION
Comment 1 Zamundaaa 2022-04-06 19:46:46 UTC
Please report Xwayland bugs to the xserver project: https://gitlab.freedesktop.org/xorg/xserver/-/issues

In order to get a usable backtrace though, what you can do is to ssh in from a different PC (or your phone) and debug Xwayland with "sudo gdb $(pidof Xwayland)". Use "c" to let it continue running and wait until it crashes. Once it crashed, "bt" will retrieve a backtrace.
Comment 2 db0 2022-04-08 20:15:29 UTC
(In reply to Zamundaaa from comment #1)
> Please report Xwayland bugs to the xserver project:
> https://gitlab.freedesktop.org/xorg/xserver/-/issues
> 
> In order to get a usable backtrace though, what you can do is to ssh in from
> a different PC (or your phone) and debug Xwayland with "sudo gdb $(pidof
> Xwayland)". Use "c" to let it continue running and wait until it crashes.
> Once it crashed, "bt" will retrieve a backtrace.

Thanks for the suggestion, the bug occurred again while gdb was running but "bt" just returns "no stack".
Comment 3 db0 2022-04-08 20:33:45 UTC
Also I forgot to mention that the whole panel freezes for a while too if I try to log out via the application launcher after this occurs. The launcher freezes for a while when I click log out and eventually closes without logging out so this isn't only related to xwayland I guess.
Comment 4 winblocker 2022-05-18 16:25:22 UTC
Created attachment 148961 [details]
SDDM wayland-session.log

SDDM wayland-session.log
Comment 5 winblocker 2022-05-18 16:26:07 UTC
I have the same bug i think. Since around the end of December (Arch repos) i get this bug. After around 3 hours of gameplay in World of Warcraft (Wine) all xwayland applications vanish (i guess the xserver died). This happens reproducibly. Switching wine version or between dxvk/vkd3d does not solve the issue. However if i run the same setup in a Gnome session i don't encounter this bug. I have attached my own logs.
Comment 6 winblocker 2022-05-18 16:26:48 UTC
Created attachment 148962 [details]
journalctl
Comment 7 David Edmundson 2022-05-20 07:17:12 UTC
>Thanks for the suggestion, the bug occurred again while gdb was running but "bt" just returns "no stack".

That typically means it didn't crash per-se but hit an assert and closed, technically gracefully.

Try adding "break exit" after attaching before typing "continue"
Comment 8 Matej Mrenica 2022-05-23 20:31:54 UTC
Isn't this the same issue as 452062 ?
Comment 9 db0 2022-05-23 20:33:58 UTC
(In reply to Matej Mrenica from comment #8)
> Isn't this the same issue as 452062 ?

That issue is about xwayland apps not launching at all if I'm not mistaken, this one's about xwayland apps randomly disappearing/crashing and xwayland apps not starting to launch after that.
Comment 10 Matej Mrenica 2022-05-24 08:11:56 UTC
Does installing xorg-xwayland-git from AUR fix this issue?
Comment 11 winblocker 2022-05-24 13:26:12 UTC
Created attachment 149165 [details]
gdb log

Attached gdb via ssh but xwayland just shuts down gracefully as already stated above.
Adding adding a breakpoint like David described results in xwayland constantly hitting it as i start my program.
From my observations i would assume that some part of plasma/kwin is shutting down the xserver. Sadly i do not have the knowledge to debug why it is doing this.
Comment 12 Nate Graham 2022-05-24 14:57:26 UTC
Looks to me like there's an upstream MR to fix this: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/905.
Comment 13 winblocker 2022-05-24 20:54:59 UTC
(In reply to Matej Mrenica from comment #10)
> Does installing xorg-xwayland-git from AUR fix this issue?

Installed from git and after a first test the crash seems to be gone.
Comment 14 winblocker 2022-05-25 22:40:54 UTC
Sadly i have to report that i encountered the bug again despite xorg-xwayland-git.