Bug 452062 - Xwayland app doesn't launch in Wayland KDE 5.24.5
Summary: Xwayland app doesn't launch in Wayland KDE 5.24.5
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.24.5
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL: https://gitlab.freedesktop.org/xorg/x...
Keywords:
: 454306 454314 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-03-30 04:07 UTC by McCak
Modified: 2022-05-25 04:04 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description McCak 2022-03-30 04:07:14 UTC
STEPS TO REPRODUCE
1. Use the laptop internal monitor only (unplug any display outputs)
2. Login on Wayland
3. Launch apps that doesn't run under native wayland (or running at xwayland) 

OBSERVED RESULT
The app doesnt launch at all no matter its from pacman, flatpak or AUR, however they are sitting on the background

EXPECTED RESULT
The app should opened and show a window

SOFTWARE/OS VERSIONS
Linux : Arch Linux
KDE Plasma Version: 5.24.4 
KDE Frameworks Version:  5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
running the apps from terminal and checking journal doesnt say anything that bad or red. Plug in the external monitor will make this problem irrelevant, so does running it under X11. HDMI and DP port in this laptop connected directly to the GPU0
Hardware Specifications
Laptop : MSI Delta 15
CPU :Ryzen 7 5800H
GPU0 : RX 6700M 
GPU1: Vega 8
Comment 1 David Edmundson 2022-03-30 13:45:54 UTC
This is not reproducible here:

Does it happen with a nested session?

kwin_wayland --xwayland dolphin --platform xcb

Please include output when run with:
KWIN_XWAYLAND_DEBUG=1
Comment 2 McCak 2022-03-30 21:12:51 UTC
(In reply to David Edmundson from comment #1)
> This is not reproducible here:
> 
> Does it happen with a nested session?
> 
> kwin_wayland --xwayland dolphin --platform xcb
> 
> Please include output when run with:
> KWIN_XWAYLAND_DEBUG=1

If i am right for the full command in terminal, it should like this right ? KWIN_XWAYLAND_DEBUG=1 kwin_wayland --xwayland dolphin --platform xcb.. if it yes then it doesnt output and opened anything, it just stay there like a stuck command.. i cant terminate it either using CTRL+C either..
Comment 3 McCak 2022-03-31 00:51:29 UTC
(In reply to McCak from comment #0)
> STEPS TO REPRODUCE
> 1. Use the laptop internal monitor only (unplug any display outputs)
> 2. Login on Wayland
> 3. Launch apps that doesn't run under native wayland (or running at
> xwayland) 
> 
> OBSERVED RESULT
> The app doesnt launch at all no matter its from pacman, flatpak or AUR,
> however they are sitting on the background
> 
> EXPECTED RESULT
> The app should opened and show a window
> 
> SOFTWARE/OS VERSIONS
> Linux : Arch Linux
> KDE Plasma Version: 5.24.4 
> KDE Frameworks Version:  5.92.0
> Qt Version: 5.15.3
> 
> ADDITIONAL INFORMATION
> running the apps from terminal and checking journal doesnt say anything that
> bad or red. Plug in the external monitor will make this problem irrelevant,
> so does running it under X11. HDMI and DP port in this laptop connected
> directly to the GPU0
> Hardware Specifications
> Laptop : MSI Delta 15
> CPU :Ryzen 7 5800H
> GPU0 : RX 6700M 
> GPU1: Vega 8

I almost forgot that Shutdown menu also affected.. it just crashed the menu and i cant shutdown/restart/etc without terminal
Comment 4 McCak 2022-03-31 14:45:20 UTC
I found some clue here.. So MSI laptop have a indicator when dGPU utilized by some apps their laptop .. I managed to grab some data from some apps like steam by forcing it to run under the iGPU (DRI_PRIME=0 steam) and it opened for a while then crashed.. 
The output:
Fatal IO error 0 (Success) on X server :1.

So the number one method doesnt relevant because when charging the dGPU will be activated then apps will open normally but not when on battery power..

STEPS TO REPRODUCE (Updated)
1. Use the laptop internal monitor only (unplug any display outputs, make sure dGPU is not activated or utilized, and the laptop is not charging)
2. Login on Wayland
3. Launch apps that doesn't run under native wayland (or running at xwayland)
Comment 5 Bug Janitor Service 2022-04-15 04:34:51 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Aleix Pol 2022-04-19 14:14:01 UTC
can you check if you have Xwayland crashing in coredumpctl?
Comment 7 McCak 2022-04-20 02:40:27 UTC
(In reply to Aleix Pol from comment #6)
> can you check if you have Xwayland crashing in coredumpctl?

No.. i didnt see anything about Xwayland crashed on coredumpctl..
Comment 8 koopacabras 2022-04-23 21:14:38 UTC
I'm not sure if I should open another ticket but the title just nails it about my issue... tho with the comment suggested I get something in konsole

'No backend specified through command line argument, trying auto resolution
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
kf.globalaccel.kglobalacceld: Failed to register service org.kde.kglobalaccel
OpenGL vendor string:                   AMD
OpenGL renderer string:                 AMD Radeon RX 5600 XT (navi10, LLVM 13.0.1, DRM 3.42, 5.15.35-xanmod1)
OpenGL version string:                  4.6 (Core Profile) Mesa 22.0.1
OpenGL shading language version string: 4.60
Driver:                                 Unknown
GPU class:                              Unknown
OpenGL version:                         4.6
GLSL version:                           4.60
Mesa version:                           22.0.1
Linux kernel version:                   5.15.35
Requires strict binding:                no
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
[ 942451.388]  -> wl_display@1.get_registry(new id wl_registry@2)
[ 942451.398]  -> wl_display@1.sync(new id wl_callback@3)
(EE) could not connect to wayland server
Violación de segmento (`core' generado)'
Comment 9 koopacabras 2022-04-23 23:34:24 UTC
I don't know if this pertains to kde... maybe it's a bug in wayland or chromium, but it's rather peculiar that all xwayland apps are crashing this is what I get when Launching Discord for example

Discord 0.0.17
Starting app.
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/joaco1/.config/discord/0.0.17/modules
[Modules] Module installed file path: /home/joaco1/.config/discord/0.0.17/modules/installed.json
[Modules] Module download path: /home/joaco1/.config/discord/0.0.17/modules/pending
../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption detected.
../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption detected.
[Modules] No updates to install
[Modules] Checking for host updates.
../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption detected.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json
[Modules] No module updates available.
Module ./ElectronTestRpc was not included.

Failed to get crash dump id.
Report Id: cbab8f3d-b92c-4e

Failed to get crash dump id.
Report Id: 7e9599a0-e927-4d

Failed to get crash dump id.
Report Id: 63cf014f-7a88-44

Failed to get crash dump id.
Report Id: 415d4f5a-d971-4e
Comment 10 McCak 2022-04-24 04:27:02 UTC
(In reply to koopacabras from comment #9)
> I don't know if this pertains to kde... maybe it's a bug in wayland or
> chromium, but it's rather peculiar that all xwayland apps are crashing this
> is what I get when Launching Discord for example
> 
> Discord 0.0.17
> Starting app.
> Starting updater.
> [Modules] Modules initializing
> [Modules] Distribution: remote
> [Modules] Host updates: enabled
> [Modules] Module updates: enabled
> [Modules] Module install path: /home/joaco1/.config/discord/0.0.17/modules
> [Modules] Module installed file path:
> /home/joaco1/.config/discord/0.0.17/modules/installed.json
> [Modules] Module download path:
> /home/joaco1/.config/discord/0.0.17/modules/pending
> ../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption
> detected.
> ../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption
> detected.
> [Modules] No updates to install
> [Modules] Checking for host updates.
> ../../third_party/tcmalloc/chromium/src/free_list.cc:135] Memory corruption
> detected.
> [Modules] Host is up to date.
> [Modules] Checking for module updates at
> https://discord.com/api/modules/stable/versions.json
> [Modules] No module updates available.
> Module ./ElectronTestRpc was not included.
> 
> Failed to get crash dump id.
> Report Id: cbab8f3d-b92c-4e
> 
> Failed to get crash dump id.
> Report Id: 7e9599a0-e927-4d
> 
> Failed to get crash dump id.
> Report Id: 63cf014f-7a88-44
> 
> Failed to get crash dump id.
> Report Id: 415d4f5a-d971-4e

I dont think this is Wayland issue personally because other DE seems fine.. anyway thx for providing several info..
Comment 11 McCak 2022-04-25 02:59:02 UTC
So in my curiosity i tried to ran that command again and i got some output

No backend specified through command line argument, trying auto resolution
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
kf.globalaccel.kglobalacceld: Failed to register service org.kde.kglobalaccel
ICE default IO error handler doing an exit(), pid = 2250, errno = 32
Destroyed Wayland display
 
Which is pretty same with the previous person who tested the command..
Comment 12 McCak 2022-05-09 11:39:52 UTC
Changing some info because the bug still exist in latest update
Comment 13 McCak 2022-05-09 11:42:52 UTC
Changing some info because the bug still exist on latest.. However in latest version XWayland crashing now exist on journalctl and coredumpctl.. 

From coredumpctl 

Mon 2022-05-09 18:27:03 WIB   2184 1000 998 SIGABRT present  /usr/bin/Xwayland                                                  2.6M

From journalctl
 
https://pastebin.com/ny0vbWKf

I hope this will give enough info to know about something that wrong..
Comment 14 Jordan Bottoms 2022-05-18 10:25:33 UTC
I'm having this exact same issue myself.

STEPS TO REPRODUCE
1. Use internal display
2. Login with wayland
3. Launch apps like steam or discord

OBSERVED RESULT
Nothing happens. Desktop freezes a bit/slows down and wont restart from the menu.
If running the app from a terminal the terminal window such as Konsole also wont accept input anymore.
Opening a new terminal window seems to be fine.

EXPECTED RESULT
Apps should show a window.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 36 KDE 
(available in About System)
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel: 5.17.7-300

ADDITIONAL INFORMATION
Using an X11 session works like normal.
Couple other notes I tried Fedora with gnome which worked fine
and another computer with an amd 3900x cpu and amd radeon 5700xt (gigabyte brand) gpu which worked fine.

Hardware Specs
Laptop: MSI Alpha 17
CPU: Ryzen 7 4800H
GPU: Radeon RX 5600M
Ram: 32GB

https://pastebin.com/BnQHYdq5
https://pastebin.com/Uxw4JR52


TIME                          PID  UID  GID SIG     COREFILE EXE                                             >
Wed 2022-05-18 04:55:07 CDT  1814 1000 1000 SIGABRT present  /usr/bin/Xwayland                               >
Wed 2022-05-18 05:15:24 CDT  9969 1000 1000 SIGABRT present  /usr/bin/Xwayland                               >
Wed 2022-05-18 05:15:25 CDT 17337 1000 1000 SIGSEGV present  /home/jordan/.var/app/com.valvesoftware.Steam/.l>
Wed 2022-05-18 05:16:55 CDT  1834 1000 1000 SIGABRT present  /usr/bin/Xwayland                               >
Wed 2022-05-18 05:16:56 CDT  3393 1000 1000 SIGSEGV present  /home/jordan/.var/app/com.valvesoftware.Steam/.l>
Wed 2022-05-18 05:18:09 CDT  1812 1000 1000 SIGABRT present  /usr/bin/Xwayland                               >
Wed 2022-05-18 05:20:42 CDT  3469 1000 1000 SIGABRT present  /usr/bin/Xwayland                               >
Wed 2022-05-18 05:20:43 CDT  5131 1000 1000 SIGABRT present  /usr/bin/kwin_wayland                           >
lines 1-9/9 (END)...skipping...
TIME                          PID  UID  GID SIG     COREFILE EXE                                                                                SIZE
Wed 2022-05-18 04:55:07 CDT  1814 1000 1000 SIGABRT present  /usr/bin/Xwayland                                                                  2.7M
Wed 2022-05-18 05:15:24 CDT  9969 1000 1000 SIGABRT present  /usr/bin/Xwayland                                                                  3.2M
Wed 2022-05-18 05:15:25 CDT 17337 1000 1000 SIGSEGV present  /home/jordan/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam 7.4M
Wed 2022-05-18 05:16:55 CDT  1834 1000 1000 SIGABRT present  /usr/bin/Xwayland                                                                  2.7M
Wed 2022-05-18 05:16:56 CDT  3393 1000 1000 SIGSEGV present  /home/jordan/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam 7.5M
Wed 2022-05-18 05:18:09 CDT  1812 1000 1000 SIGABRT present  /usr/bin/Xwayland                                                                  2.7M
Wed 2022-05-18 05:20:42 CDT  3469 1000 1000 SIGABRT present  /usr/bin/Xwayland                                                                  2.5M
Wed 2022-05-18 05:20:43 CDT  5131 1000 1000 SIGABRT present  /usr/bin/kwin_wayland
Comment 15 Matej Mrenica 2022-05-22 17:38:17 UTC
I think I have the same issue. I can't open any Xwayland apps, I get either an XWayland crash or the app starts but has an invisible main window. Also the log out screen doesn't open just like someone above.

Backtrace from Xwayland crash looks like this (when trying to start Discord):

#0  0x00007f047544d36c in ?? () from /usr/lib/libc.so.6
#1  0x00007f04753fd838 in raise () from /usr/lib/libc.so.6
#2  0x00007f04753e7535 in abort () from /usr/lib/libc.so.6
#3  0x0000556dc4d99851 in OsAbort () at ../xwayland-22.1.1/os/utils.c:1353
#4  0x0000556dc4da363f in AbortServer () at ../xwayland-22.1.1/os/log.c:879
#5  FatalError (f=<optimized out>) at ../xwayland-22.1.1/os/log.c:1017
#6  0x0000556dc4d97843 in OsSigHandler (unused=<optimized out>, sip=<optimized out>, signo=11) at ../xwayland-22.1.1/os/osinit.c:156
#7  OsSigHandler (signo=11, sip=<optimized out>, unused=<optimized out>) at ../xwayland-22.1.1/os/osinit.c:110
#8  <signal handler called>
#9  xwl_screen_destroy_drm_lease_device (xwl_screen=0x556dc61be830, wp_drm_lease_device_v1=0x556dc61be7d0) at ../xwayland-22.1.1/hw/xwayland/xwayland-drm-lease.c:430
#10 0x00007f04752c5536 in ffi_closure_unix64 () at ../src/x86/unix64.S:315
#11 0x0000000000000000 in ?? ()

"kwin_wayland --xwayland dolphin --platform xcb" also always results in a crash. BT:

#0  0x00007f8d4cd0a36c in ?? () from /usr/lib/libc.so.6
#1  0x00007f8d4ccba838 in raise () from /usr/lib/libc.so.6
#2  0x00007f8d4cca4535 in abort () from /usr/lib/libc.so.6
#3  0x000055dc1393b851 in OsAbort () at ../xwayland-22.1.1/os/utils.c:1353
#4  0x000055dc1394563f in AbortServer () at ../xwayland-22.1.1/os/log.c:879
#5  FatalError (f=<optimized out>) at ../xwayland-22.1.1/os/log.c:1017
#6  0x000055dc13939843 in OsSigHandler (unused=<optimized out>, sip=<optimized out>, signo=11) at ../xwayland-22.1.1/os/osinit.c:156
#7  OsSigHandler (signo=11, sip=<optimized out>, unused=<optimized out>) at ../xwayland-22.1.1/os/osinit.c:110
#8  <signal handler called>
#9  xwl_screen_destroy_drm_lease_device (xwl_screen=0x55dc149593e0, wp_drm_lease_device_v1=0x55dc14959380) at ../xwayland-22.1.1/hw/xwayland/xwayland-drm-lease.c:430
#10 0x00007f8d4cb822fe in ffi_call_unix64 () at ../src/x86/unix64.S:105
#11 0x00007f8d4cb81692 in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#12 0x00007f8d4d19a523 in wl_closure_invoke (closure=closure@entry=0x55dc14696860, target=<optimized out>, target@entry=0x55dc14959380, opcode=opcode@entry=3, data=<optimized out>, flags=1)
    at ../wayland-1.20.0/src/connection.c:1025
#13 0x00007f8d4d19ace3 in dispatch_event (display=0x55dc13e0b210, queue=<optimized out>) at ../wayland-1.20.0/src/wayland-client.c:1583
#14 0x00007f8d4d19aeec in dispatch_queue (queue=0x55dc13e0b2e0, display=0x55dc13e0b210) at ../wayland-1.20.0/src/wayland-client.c:1729
#15 wl_display_dispatch_queue_pending (display=0x55dc13e0b210, queue=0x55dc13e0b2e0) at ../wayland-1.20.0/src/wayland-client.c:1971
#16 0x00007f8d4d19af51 in wl_display_dispatch_pending (display=<optimized out>) at ../wayland-1.20.0/src/wayland-client.c:2034
#17 0x000055dc1380a73d in xwl_read_events (xwl_screen=0x55dc13d6e700) at ../xwayland-22.1.1/hw/xwayland/xwayland-screen.c:482
#18 xwl_read_events (xwl_screen=0x55dc13d6e700) at ../xwayland-22.1.1/hw/xwayland/xwayland-screen.c:469
#19 0x000055dc1393acb2 in ospoll_wait (ospoll=0x55dc13d62be0, timeout=<optimized out>) at ../xwayland-22.1.1/os/ospoll.c:657
#20 0x000055dc13873f89 in WaitForSomething (are_ready=0) at ../xwayland-22.1.1/os/WaitFor.c:208
#21 Dispatch () at ../xwayland-22.1.1/dix/dispatch.c:492
#22 0x000055dc1380084c in dix_main (envp=<optimized out>, argv=<optimized out>, argc=<optimized out>) at ../xwayland-22.1.1/dix/main.c:271
#23 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../xwayland-22.1.1/dix/stubmain.c:34

Any other info I should provide?
Comment 16 Joshua Goins 2022-05-23 22:41:32 UTC
I can also reproduce on a fresh Gentoo system with KDE 5.24.5 and XWayland 22.1.1. I'm still in the process of trying to get useful backtraces off of XWayland...

However looking through these reports it seems all of them have two GPUs and I wonder if that's playing into this somehow. I also happen to have two GPUs and I'll see about disabling one of them and see if that makes any difference.
Comment 17 Joshua Goins 2022-05-23 23:42:50 UTC
(In reply to Joshua Goins from comment #16)
> However looking through these reports it seems all of them have two GPUs and
> I wonder if that's playing into this somehow. I also happen to have two GPUs
> and I'll see about disabling one of them and see if that makes any
> difference.

It seems my suspicions were correct, I removed the second discrete GPU (via VFIO, as I didn't want to crack open my case) and XWayland works without issue now. I don't know anything about the Linux graphics stack, but this seems to be backed up by the callstacks posted before including things like xwl_screen_destroy_drm_lease_device which deals with DRM devices. Is xwayland maybe mixing up different GPUs or screens were it shouldn't be?

I should also mention I run two discrete AMD GPUs (6800 XT and 6600) on the mesa + amdgpu stack.
Comment 18 Alastor Tenebris 2022-05-24 07:40:29 UTC
*** Bug 454306 has been marked as a duplicate of this bug. ***
Comment 19 Alastor Tenebris 2022-05-24 07:45:50 UTC
I also have this issue and have dual AMD graphics (Vega8/Polaris11).

Running glxinfo is fine, but the second I run "DRI_PRIME=1 glxinfo", xwayland crashes.
Comment 20 Alastor Tenebris 2022-05-24 08:05:07 UTC
This should be fixed by https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/894.
Comment 21 Matej Mrenica 2022-05-24 08:06:28 UTC
(In reply to Alastor Tenebris from comment #20)
> This should be fixed by
> https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/894.

Yes, it is, installing xorg-xwayland-git from AUR fixes this issue and others.
Comment 22 Joshua Goins 2022-05-24 12:06:12 UTC
(In reply to Alastor Tenebris from comment #20)
> This should be fixed by
> https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/894.

I can confirm that this fixes my issue as well!
Comment 23 Nate Graham 2022-05-24 14:57:05 UTC
Fantastic!
Comment 24 Nate Graham 2022-05-24 17:07:57 UTC
*** Bug 454314 has been marked as a duplicate of this bug. ***
Comment 25 McCak 2022-05-25 04:04:15 UTC
I am  surprised this is actually a XWayland bug instead of KWIN itself.. because other DE with Wayland Functionality seems fine.. Anyway thank  you for giving some info..