After a system upgrade, KDE Plasma (Wayland) fails to detect $DISPLAY

Hello,

I am using a rolling arch based distro…

I upgraded after some months, now after boot (which was very fast before) I am stuck in the Splash Screen for 40 seconds… Then it proceeds. I then found out that $DISPLAY is empty. Many software will not start:

❯ glxinfo
Error: unable to open display
❯ echo $DISPLAY
*empty output*
❯ echo $WAYLAND_DISPLAY
wayland-0
❯ echo $HOSTNAME
*empty output*

But if I logout, login to Plasma (X11), then logout again and into Plasma(Wayland), everything works fine! But this only lasts until the next reboot…

kinfo:

Operating System: CachyOS Linux 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.12.0-rc6-g42c5adef2d2b (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 7900X3D 12-Core Processor
Memory: 31.1 GiB of RAM
Graphics Processor: AMD Radeon RX 6900 XT

System Info:

Summary
System:
  Kernel: 6.11.6-2-cachyos arch: x86_64 bits: 64 compiler: clang v: 18.1.8
    clocksource: tsc
  Desktop: KDE Plasma v: 6.2.2 tk: Qt v: N/A wm: kwin_wayland vt: 1 dm: N/A
    Distro: CachyOS base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: MAG B650 TOMAHAWK WIFI (MS-7D75)
    v: 1.0 serial: <superuser required> uuid: <superuser required> UEFI: American
    Megatrends LLC. v: 1.74 date: 08/01/2023
CPU:
  Info: 12-core model: AMD Ryzen 9 7900X3D bits: 64 type: MT MCP smt: enabled
    arch: Zen 4 rev: 2 cache: L1: 768 KiB L2: 12 MiB L3: 128 MiB
  Speed (MHz): avg: 2999 min/max: 400/5660 boost: enabled cores: 1: 2999
    2: 2999 3: 2999 4: 2999 5: 2999 6: 2999 7: 2999 8: 2999 9: 2999 10: 2999
    11: 2999 12: 2999 13: 2999 14: 2999 15: 2999 16: 2999 17: 2999 18: 2999
    19: 2999 20: 2999 21: 2999 22: 2999 23: 2999 24: 2999 bogomips: 211200
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT
    / 6900 XT] vendor: Tul / PowerColor Red Devil driver: amdgpu v: kernel
    arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports: active: DP-2
    empty: DP-1, DP-3, HDMI-A-1, Writeback-1 bus-ID: 03:00.0
    chip-ID: 1002:73bf class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.14 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: 0
  Monitor-1: DP-2 res: 2048x1152 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi inactive: x11
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: mesa v: 24.2.6-cachyos1.2
    note: incomplete (EGL sourced) renderer: llvmpipe (LLVM 18.1.8 256 bits),
    AMD Radeon RX 6900 XT (radeonsi navi21 LLVM 18.1.8 DRM 3.59
    6.11.6-2-cachyos)
  API: Vulkan v: 1.3.295 layers: 9 surfaces: wayland device: 0
    type: discrete-gpu hw: amd driver: mesa radv device-ID: 1002:73bf
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 21/23 HDMI/DP Audio
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 03:00.1 chip-ID: 1002:ab28 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD] Family 17h/19h HD Audio
    vendor: Micro-Star MSI driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s
    lanes: 16 bus-ID: 11:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Device-3: Micro Star USB Audio driver: hid-generic,snd-usb-audio,usbhid
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-6:3 chip-ID: 0db0:422d
    class-ID: 0300
  API: ALSA v: k6.11.6-2-cachyos status: kernel-api
  Server-1: PipeWire v: 1.2.6 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8125 2.5GbE vendor: Micro-Star MSI driver: r8169
    v: kernel pcie: speed: 5 GT/s lanes: 1 port: e000 bus-ID: 0d:00.0
    chip-ID: 10ec:8125 class-ID: 0200
  IF: enp13s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    driver: mt7921e v: kernel pcie: speed: 5 GT/s lanes: 1 bus-ID: 0e:00.0
    chip-ID: 14c3:0616 class-ID: 0280
  IF: wlan0 state: down mac: <filter>
Bluetooth:
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1
    speed: 480 Mb/s lanes: 1 bus-ID: 1-7:6 chip-ID: 0e8d:0616 class-ID: e001
    serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: disabled
    rfk-block: hardware: no software: no address: N/A
Drives:
  Local Storage: total: 6.37 TiB used: 654.25 GiB (10.0%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 2TB size: 1.82 TiB
    speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter> fw-rev: 5B2QGXA7
    temp: 42.9 C scheme: GPT
  ID-2: /dev/nvme1n1 vendor: Western Digital model: WDS100T1X0E-00AFY0
    size: 931.51 GiB speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 613000WD temp: 46.9 C scheme: GPT
  ID-3: /dev/sda vendor: Toshiba model: HDWT840 size: 3.64 TiB
    speed: 6.0 Gb/s tech: HDD rpm: 5400 serial: <filter> fw-rev: 0L scheme: GPT
Partition:
  ID-1: / size: 197.84 GiB used: 81.04 GiB (41.0%) fs: xfs dev: /dev/nvme0n1p6
  ID-2: /boot/efi size: 563.9 MiB used: 39.3 MiB (7.0%) fs: vfat
    dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 31.09 GiB used: 512 KiB (0.0%) priority: 100
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 27.94 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p2
Sensors:
  System Temperatures: cpu: 49.9 C mobo: 43.5 C gpu: amdgpu temp: 55.0 C
    mem: 50.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 0
Repos:
  Packages: pm: pacman pkgs: 1486
  Active pacman repo servers in: /etc/pacman.d/cachyos-mirrorlist
    1: https://mirror.cachyos.org/repo/$arch/$repo
    2: https://cdn.cachyos.org/repo/$arch/$repo
    3: https://mirror.fast0ne.com/repo/$arch/$repo
    4: https://mir.cachyos.fr/repo/$arch/$repo
    5: https://cdn77.cachyos.org/repo/$arch/$repo
    6: https://at.cachyos.org/repo/$arch/$repo
    7: https://us.cachyos.org/repo/$arch/$repo
    8: https://mirror.truenetwork.ru/cachy/repo/$arch/$repo
    9: https://aur.cachyos.org/repo/$arch/$repo
    10: https://cdn-1.cachyos.org/$arch/$repo
    11: https://no.mirror.cx/cachyos/repo/$arch/$repo
    12: https://mirror.lesviallon.fr/cachy/repo/$arch/$repo
  Active pacman repo servers in: /etc/pacman.d/cachyos-v4-mirrorlist
    1: https://mirror.cachyos.org/repo/$arch_v4/$repo
    2: https://cdn.cachyos.org/repo/$arch_v4/$repo
    3: https://mirror.fast0ne.com/repo/$arch_v4/$repo
    4: https://mir.cachyos.fr/repo/$arch_v4/$repo
    5: https://cdn77.cachyos.org/repo/$arch_v4/$repo
    6: https://at.cachyos.org/repo/$arch_v4/$repo
    7: https://us.cachyos.org/repo/$arch_v4/$repo
    8: https://mirror.truenetwork.ru/cachy/repo/$arch_v4/$repo
    9: https://aur.cachyos.org/repo/$arch_v4/$repo
    10: https://cdn-1.cachyos.org/$arch_v4/$repo
    11: https://no.mirror.cx/cachyos/repo/$arch_v4/$repo
    12: https://mirror.lesviallon.fr/cachy/repo/$arch_v4/$repo
  Active pacman repo servers in: /etc/pacman.d/mirrorlist
    1: https://mirrors.nxthost.com/archlinux/$repo/os/$arch
    2: https://mirrors.dotsrc.org/archlinux/$repo/os/$arch
    3: http://mirrors.kernel.org/archlinux/$repo/os/$arch
    4: https://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch
    5: http://mirroronet.pl/pub/mirrors/archlinux/$repo/os/$arch
    6: http://mirrors.dotsrc.org/archlinux/$repo/os/$arch
    7: https://mirroronet.pl/pub/mirrors/archlinux/$repo/os/$arch
    8: http://mirror.23m.com/archlinux/$repo/os/$arch
    9: https://mirror.23m.com/archlinux/$repo/os/$arch
    10: http://mirror.ihost.md/archlinux/$repo/os/$arch
    11: https://archlinux.mirror.liquidtelecom.com/$repo/os/$arch
    12: https://iad.mirrors.misaka.one/archlinux/$repo/os/$arch
    13: http://archlinux.mirror.liquidtelecom.com/$repo/os/$arch
    14: http://mirrors.nxthost.com/archlinux/$repo/os/$arch
    15: https://mirror.dal10.us.leaseweb.net/archlinux/$repo/os/$arch
    16: http://pkg.adfinis.com/archlinux/$repo/os/$arch
    17: https://ord.mirror.rackspace.com/archlinux/$repo/os/$arch
    18: https://mirror.mia11.us.leaseweb.net/archlinux/$repo/os/$arch
    19: https://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch
    20: http://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch
    21: http://ord.mirror.rackspace.com/archlinux/$repo/os/$arch
    22: http://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch
    23: https://pkg.adfinis.com/archlinux/$repo/os/$arch
    24: http://dfw.mirror.rackspace.com/archlinux/$repo/os/$arch
    25: http://mirror.dal10.us.leaseweb.net/archlinux/$repo/os/$arch
    26: http://syd.mirror.rackspace.com/archlinux/$repo/os/$arch
    27: https://mirror.ihost.md/archlinux/$repo/os/$arch
Info:
  Memory: total: 32 GiB available: 31.09 GiB used: 3.56 GiB (11.4%)
  Processes: 418 Power: uptime: 25m states: freeze,mem,disk suspend: deep
    wakeups: 0 hibernate: platform Init: systemd v: 256 default: graphical
  Compilers: clang: 18.1.8 gcc: 14.2.1 Shell: fish v: 3.7.1
    running-in: konsole inxi: 3.3.36

journalctl -rb -1 after reboot → stuck in splash screen (plasma on wayland) → logout and into plasma on x11 → logout again and into plasma on wayland (which fixes this issue but only for the current session):

(sorry I can neither include the log because it is too long, neither can I post a link to copy/paste websites…)

paste[dot]mozilla[dot]org/9AxQ3FHJ

Any help would be appreciated!
Thank you

What login display manager do you use? SDDM, LightDM, gdm?

When you login to Plasma Wayland, after a reboot, if you open a process list and look for kwin_wayland - does it has a bunch of options looking like this: --xwayland-fd 9 --xwayland-display :0 --xwayland-xauthority /run/user/1000/xauth_NJaHEC --xwayland ? If you can post the whole command line, that would be helpful.

Also, generally - for people looking for technical help on this forum, it is a good idea to post the KDE details from Info CenterCopy Details or the output of kinfo on the command line (its the same thing).

Thank you for your reply.

I am using SDDM.

❯ kinfo
Operating System: CachyOS Linux 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.12.0-rc6-g42c5adef2d2b (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 7900X3D 12-Core Processor
Memory: 31.1 GiB of RAM
Graphics Processor: AMD Radeon RX 6900 XT

I could not understand this part, I’m sorry. What command should I use?
Here is a screenshot of processes when it is working correctly (that is, after I log into plasma (x11) and then plasma (wayland) and it gets fixed):

And when not working (initial boot into Plasma wayland):

(sorry for multiple posts, does not allow me to post more than 1 picture in every post)

Is this what you asked?

❯ kwin_wayland --xwayland-fd 9 --xwayland-display :0 --xwayland-xauthority /run/user/1000/xauth_NJaHEC --xwayland
No backend specified, automatically choosing Wayland because WAYLAND_DISPLAY is set
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
Accepting client connections on sockets: QList("wayland-1")
kf.globalaccel.kglobalacceld: Failed to register service org.kde.kglobalaccel

Please don’t run kwin_wayland manually - this is something that the Plasma session script should do.

What I wanted to see, is what actual parameters the Plasma session script of your Linux OS is using when running the Kwin compositor. If you use the KDE System Monitor app’s “Processes” view, then click on “Configure Columns”, find the column “Command” and enable it (set its display to “text only”) then you can find kwin_wayland in the list, right click its “Command” column and choose “Copy Current Column” - then paste it here.

Here is when it is not working:

/usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland

when it is working:

/usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayland-fd 9 --xwayland-display :0 --xwayland-xauthority /run/user/1000/xauth_NeHcHo --xwayland

This is the problem then - the kwin_wayland invocation is missing all of the Xwayland socket parameters. I think the most likely explanation is that the wrapper failed to create the Xwayland socket, though I’m unsure why.

Can you please run

journalctl | grep kwin_wayland_wrapper

(you don’t need to log in to the broken session - this looks at all past logs, so it will take a while to run to completion)

See if it says something like “Failed to create Xwayland connection sockets” and if so - does it have some other logs before that (that happen at about the same time)?

Thank you for trying to help me.

Here is the log from terminal:

❯ journalctl | grep kwin_wayland_wrapper
Nov 05 10:21:34 tea-cachyos kwin_wayland_wrapper[4329]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 10:21:34 tea-cachyos kwin_wayland_wrapper[4329]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 10:24:50 tea-cachyos kwin_wayland_wrapper[6647]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 10:24:50 tea-cachyos kwin_wayland_wrapper[6647]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 10:29:13 tea-cachyos kwin_wayland_wrapper[8920]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 10:29:13 tea-cachyos kwin_wayland_wrapper[8920]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 10:46:19 tea kwin_wayland_wrapper[13593]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 10:46:19 tea kwin_wayland_wrapper[13593]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 10:48:19 tea kwin_wayland_wrapper[898]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 10:48:19 tea kwin_wayland_wrapper[898]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 11:31:38 tea kwin_wayland_wrapper[885]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 11:31:38 tea kwin_wayland_wrapper[885]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: >                   X11 cannot support keycodes above 255.
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 05 11:33:02 tea kwin_wayland_wrapper[3337]: Errors from xkbcomp are not fatal to the X server
Nov 05 12:27:27 tea kwin_wayland_wrapper[922]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 12:27:27 tea kwin_wayland_wrapper[922]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: >                   X11 cannot support keycodes above 255.
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 05 12:28:28 tea kwin_wayland_wrapper[2550]: Errors from xkbcomp are not fatal to the X server
Nov 05 12:28:29 tea kwin_wayland_wrapper[2781]: syntax error: line 1 of stdin
Nov 05 12:28:29 tea kwin_wayland_wrapper[2781]: Errors encountered in stdin; not compiled.
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: >                   X11 cannot support keycodes above 255.
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 05 12:29:42 tea kwin_wayland_wrapper[4121]: Errors from xkbcomp are not fatal to the X server
Nov 05 12:29:42 tea kwin_wayland_wrapper[4331]: syntax error: line 1 of stdin
Nov 05 12:29:42 tea kwin_wayland_wrapper[4331]: Errors encountered in stdin; not compiled.
Nov 05 13:24:57 tea kwin_wayland_wrapper[901]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 13:24:57 tea kwin_wayland_wrapper[901]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: >                   X11 cannot support keycodes above 255.
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 05 13:26:16 tea kwin_wayland_wrapper[3735]: Errors from xkbcomp are not fatal to the X server
Nov 05 14:10:18 tea kwin_wayland_wrapper[897]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 05 14:10:18 tea kwin_wayland_wrapper[897]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 06 10:14:37 tea kwin_wayland_wrapper[901]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 06 10:14:37 tea kwin_wayland_wrapper[901]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: >                   X11 cannot support keycodes above 255.
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 06 10:20:40 tea kwin_wayland_wrapper[4935]: Errors from xkbcomp are not fatal to the X server
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: >                   X11 cannot support keycodes above 255.
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 06 12:08:34 tea kwin_wayland_wrapper[14831]: Errors from xkbcomp are not fatal to the X server
Nov 06 12:09:45 tea kwin_wayland_wrapper[14716]: malloc(): unsorted double linked list corrupted
Nov 06 12:09:46 tea kwin_wayland_wrapper[14788]: (EE) failed to read Wayland events: Broken pipe
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: > Warning:          Unsupported maximum keycode 708, clipping.
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: >                   X11 cannot support keycodes above 255.
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Nov 06 12:09:46 tea kwin_wayland_wrapper[16360]: Errors from xkbcomp are not fatal to the X server

Maybe this is the root cause?

Nov 06 10:14:37 tea kwin_wayland_wrapper[901]: kwin_xwl: /tmp/.X11-unix does not exist. Please check your installation
Nov 06 10:14:37 tea kwin_wayland_wrapper[901]: kwin_wayland_wrapper: Failed to create Xwayland connection sockets

I tried to reinstall every single package before, trying to fix this issue… but still wasn’t fixed…

That indeed looks to be the problem.

The /tmp/.X11-unix directory must exist for the XWayland setup to work, and KDE expects the operating system to make sure it was created.

On my system this is created by the systemd-tmpfiles system and is configured in /usr/lib/tmpfiles.d/x11.conf that is installed as part of the systemd package.

From the behavior you describe it sounds like the creation of the /tmp/.X11-unix directory is done “just in time” when your system starts an X11 session - which is bad for XWayland.

I’m not an Arch expert, but as far as I understand CachyOS does have systemd so I would look in /usr/lib/tmpfiles.d and see if there is a file there that mentions /tmp/.X11-unix. From looking at the Arch wiki, I can’t find anything that discusses this specific issue, though you can learn about systemd-tmpfiles here.

I found this file named x11.conf that had mentioned this (in both broken and normal session):

# Make sure these are created by default so that nobody else can
# or empty them at startup
D! /tmp/.X11-unix 1777 root root 10d
D! /tmp/.ICE-unix 1777 root root 10d
D! /tmp/.XIM-unix 1777 root root 10d
D! /tmp/.font-unix 1777 root root 10d

# Unlink the X11 lock files
r! /tmp/.X[0-9]*-lock

Is there any way to fix this without reinstalling the entire OS again?

The /usr/lib/tmpfiles.d/x11.conf file is just part of the system installation, it is not a temporary file that is related to the current session

The content of the file looks fine - its pretty much identical to what I have.

The most likely cause of the failure of systemd-tmpfiles to create the /tmp/.X11-unix directory is because the service hadn’t been started for some reason, during system startup.

To check that, please run:

systemctl status systemd-tmpfiles-setup.service

The result should look something like this:

● systemd-tmpfiles-setup.service - Create Volatile Files and Directories
     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
     Active: active (exited) since Mon 2024-10-28 11:16:32 IST; 1 week 2 days ago
       Docs: man:tmpfiles.d(5)
             man:systemd-tmpfiles(8)
   Main PID: 934 (code=exited, status=0/SUCCESS)
        CPU: 19ms

Where the “Active” time stamp should be more recent than the last time you restarted your machine, and “Main PID” entry listed as “status=0/SUCCCESS”. The unit should not report that it is “disabled” or “masked”.

Thank you for your patience with me.

You are correct, in broken session, it is not showing “SUCCESS” for “Main PID status”, but Main PID: 743 (code=exited, status=73):

❯ systemctl status systemd-tmpfiles-setup.service
● systemd-tmpfiles-setup.service - Create System Files and Directories
     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
     Active: active (exited) since Thu 2024-11-07 07:53:53 +0330; 15min ago
 Invocation: 4d00c96830b8448a8b8a2cdf4f81f08a
       Docs: man:tmpfiles.d(5)
             man:systemd-tmpfiles(8)
    Process: 743 ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=73)
   Main PID: 743 (code=exited, status=73)
   Mem peak: 1.9M
        CPU: 18ms

Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /proc (owned by root) during canonicalization of proc/sys/dev/h>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /usr (owned by root) during canonicalization of usr/bin/groupme>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /run (owned by root) during canonicalization of run/log/journal.
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /run (owned by root) during canonicalization of run/log/journal.
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /var (owned by root) during canonicalization of var/log/journal>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /var (owned by root) during canonicalization of var/log/journal>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /sys (owned by root) during canonicalization of sys/kernel/mm/t>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /sys (owned by root) during canonicalization of sys/kernel/mm/t>
Nov 07 07:53:53 tea systemd-tmpfiles[743]: Detected unsafe path transition / (owned by tea) → /var (owned by root) during canonicalization of var/lib/tpm2-ts>
Nov 07 07:53:53 tea systemd[1]: Finished Create System Files and Directories.

In X11 session it is also showing the same thing:

● systemd-tmpfiles-setup.service - Create System Files and Directories
     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
     Active: active (exited) since Thu 2024-11-07 07:53:53 +0330; 20min ago
 Invocation: 4d00c96830b8448a8b8a2cdf4f81f08a
       Docs: man:tmpfiles.d(5)
             man:systemd-tmpfiles(8)
    Process: 743 ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=73)
   Main PID: 743 (code=exited, status=73)
   Mem peak: 1.9M
        CPU: 18ms

and in fixed wayland session it is also the same:

● systemd-tmpfiles-setup.service - Create System Files and Directories
     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
     Active: active (exited) since Thu 2024-11-07 08:20:59 +0330; 4min 39s ago
 Invocation: 4e4bfde6a341403cb66c539620d9de87
       Docs: man:tmpfiles.d(5)
             man:systemd-tmpfiles(8)
    Process: 749 ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=73)
   Main PID: 749 (code=exited, status=73)
   Mem peak: 2.4M
        CPU: 18ms