hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.65k stars 901 forks source link

Intermittent xwayland crashes #3799

Open Beyley opened 1 year ago

Beyley commented 1 year ago

Hyprland Version

Hyprland, built from branch at commit 1b48642fd15c433c53876f1b933dcd46265caf8f dirty ().

(from the arch repos)

Bug or Regression?

Bug

Description

At complete random (theres no pattern), when i have a Jetbrains tool open (eg. Rider), multiple of my apps (Rider, Ghidra, and WebCord) will be brought down. WebCord closes with no extra information (exit code 1), but it seems to maybe dump some things into dmesg (maybe unrelated?), Rider and Ghidra dont seem to dump any logs anywhere relating to the error, they act as if they were closed normally

[25574.090012] traps: electron[56903] trap int3 ip:563c0662ae87 sp:7ffc629d7a30 error:0 in electron[563c02e7c000+7aaf000]
[25574.367469] traps: electron[57032] trap int3 ip:563c0662ae87 sp:7ffc629d7a30 error:0 in electron[563c02e7c000+7aaf000]
[25574.631896] traps: electron[57076] trap int3 ip:563c0662ae87 sp:7ffc629d7a30 error:0 in electron[563c02e7c000+7aaf000]
[25928.530973] traps: electron[64277] trap int3 ip:557c46eb9e87 sp:7ffcc3123e20 error:0 in electron[557c4370b000+7aaf000]
[25928.930195] traps: electron[64423] trap int3 ip:557c46eb9e87 sp:7ffcc3123e20 error:0 in electron[557c4370b000+7aaf000]
[25929.334403] traps: electron[64500] trap int3 ip:557c46eb9e87 sp:7ffcc3123e20 error:0 in electron[557c4370b000+7aaf000]

This is maybe related to XWayland, as those are the only apps of mine that are running under Xwayland

Important to note this does not happen on compositors such as kwin_wayland

How to reproduce

Open a Jetbrains tool such as Rider alongside WebCord, then just interact with either software for awhile, at random (sometimes after as much as 10mins), both apps will be brought down at the same time (WebCord is running under xwayland on my system)

Crash reports, logs, images, videos

hypr logs logs.tar.gz

vaxerski commented 1 year ago

that would suggest xwayland crashed. I don't think this is an issue with hyprland. Have you tried testing on sway-git whether it happens there too?

Another note, your hyprland version is very old.

Beyley commented 1 year ago

Another note, your hyprland version is very old.

I'll try sway after trying updating hyprland, it seems the hyprland in the arch repos is extremely old, i didnt realize that

Beyley commented 1 year ago

I havent gotten the webcord+rider crash yet, but i am now getting a weird rendering bug with the completions, where if the completions update without recreating the separate completions window, it shrinks more and more, didnt happen on the old version img (i used rider for an hour with no crashes of rider+webcord)

while i was writing this, it seems that the entirety of hyprland was brought down for some reason (kicked back to greeter), log folder from right after are here

and while i was writing that, firefox crashed when i tried to drag and drop a zip from dolphin, im going to assume thats a separate issue though

heres the coredump for hyprland from the above full crash to greeter hyprland.coredump.zip

edit: it just happened on latest hyprland, i'll try sway

Beyley commented 1 year ago

after >2hrs of running both rider and webcord (using both constantly), the crash did not occur with sway, and it doesnt happen with kwin either

vaxerski commented 1 year ago

Would be nice to get an xwayland debug stacktrace or a log. Might be a protocol error. Running xwayland with WAYLAND_DEBUG=1 and inspecting the output when it crashes might also help.

Beyley commented 1 year ago

Would be nice to get an xwayland debug stacktrace or a log. Might be a protocol error. Running xwayland with WAYLAND_DEBUG=1 and inspecting the output when it crashes might also help.

how would i set env vars for XWayland? i glanced through the hyprland wiki and didnt see anything about running xwayland manually also i dont see xwayland in coredumpctl, so i dont think xwayland itself is fully explicitly crashing, so yeah might be a protocol error

vaxerski commented 1 year ago

https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/docs/env_vars.md?ref_type=heads#wlroots-specific

wlr_xwayland

Beyley commented 1 year ago

i put env = WLR_XWAYLAND,WAYLAND_DEBUG=1 Xwayland in my hyprland config, but now it seems that Xwayland hasnt started up at all (all xorg apps fail to open), i also tried creating a wrapper script which just has

#!/bin/sh

WAYLAND_DEBUG=1 Xwayland

then setting env = WLR_XWAYLAND,/home/beyley/xwayland_debug.sh but that didnt work either, am i misunderstanding how this env var is supposed to work?

vaxerski commented 1 year ago

image

try > the output to a file and see whats wrong

Beyley commented 1 year ago

i get this output

_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
vaxerski commented 1 year ago

odd

Beyley commented 1 year ago

update: just had it occur with WebCord, VSCode, and Chromium, all running under XWayland, were just brought down at once, seems to not be related to Rider at least

heres the current state of my scripts, which cause the above mentioned "cannot establish any listening sockets" error when i remove the env line, xwayland works fine env = WLR_XWAYLAND,/home/beyley/xwayland_debug.sh

#!/bin/bash

WAYLAND_DEBUG=1 Xwayland >> /home/beyley/xwaylandlog 2>&1

another update: i was doing work and noticed waybar crashed, so i restarted it from a terminal, and then almost all my open apps closed immediately after, with waybar just saying "media suddenly stopped" and nothing else of interest this time it wasnt exclusive to x11 apps, every app but kitty closed, including anki, firefox, webcord, and vscode (but this could be a totallly different issue manifesting itself as a similar one)

neilking01 commented 12 months ago

I get this Xwayland crash on a regular basis and its damn annoying. It seems to be something to do with having something in the clipboard, then opening a file open/save dialog. Here are a couple of logs:

journal log: https://pastes.io/co3dwld8ub hyprland log: https://pastes.io/gvy6lct3c6

vaxerski commented 12 months ago

would be nice if there were some clear repro steps, I've not had xwayland crash even once. Copying, pasting, opening dialogs.

neilking01 commented 12 months ago

would be nice if there were some clear repro steps, I've not had xwayland crash even once. Copying, pasting, opening dialogs.

I really wish I could reproduce it at will but it doesn't always work when I repeat what triggered it. I'll try and see if I can.

neilking01 commented 12 months ago

I made a wrapper for Xwayland so i can dump its output to a file. The last 2 lines of the output are:

XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool (EE) failed to dispatch Wayland events: Invalid argument

Beyley commented 12 months ago

I made a wrapper for Xwayland so i can dump its output to a file. The last 2 lines of the output are:

XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool (EE) failed to dispatch Wayland events: Invalid argument

Could you send your wrapper script and how to set it up with hyprland? I've been unable to get one working

neilking01 commented 12 months ago

mv /usr/bin/Xwayland /usr/bin/Xwayland_orig

/usr/bin/Xwayland:

#!/bin/bash

d=`date +%s`
mv /home/me/xwayland.log /home/me/xwayland_$d.log
/usr/bin/Xwayland_orig $@ &> /home/me/xwayland.log
neilking01 commented 12 months ago

I may have made some progress. In my hyprland.conf i have: env = QT_QPA_PLATFORM,xcb. I have removed this and only set this up for apps that really need it instead of it being system-wide. If you have this set system-wide, try what I did. I'm not 100% sure yet if this fully works around the Xwayland crashes but so far I am unable to reproduce it the way I usually do.

Beyley commented 12 months ago

I made a wrapper for Xwayland so i can dump its output to a file. The last 2 lines of the output are:

XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool (EE) failed to dispatch Wayland events: Invalid argument

Can confirm this is the issue i am getting as well, using your wrapper script, i have no consistent reproduction, but it happens multiple times a day

XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool
(EE) failed to dispatch Wayland events: Invalid argument
neilking01 commented 12 months ago

does the solution i mentioned above apply to you? would be interesting to know if it makes a difference.

Beyley commented 12 months ago

does the solution i mentioned above apply to you? would be interesting to know if it makes a difference.

ive had multiple xwayland crashes without any QT apps open, so i dont believe it is relevant to me

Beyley commented 11 months ago

i have found a semi-consistent reproduction, open Jetbrains Writerside, open this repository, open some document and start typing, consistently every time, in under a minute it will bring down xwayland

its always the same error inside of the xwayland logs

does not happen on plasma

Eddio0141 commented 10 months ago

also happens on my system on nixos, and never on plasma wayland happens often more if im playing buckshot roulette for some reason

last few lines of xwayland output

Errors from xkbcomp are not fatal to the X server
XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool
(EE) failed to dispatch Wayland events: Invalid argument

is there a way to at least restart xwayland? this happens way too often

neilking01 commented 10 months ago

Still an issue for me. My only solution is to run apps in it as little as possible but there's always the fear that it will crash at a very important moment. I only use QT_QPA_PLATFORM=xcb if the app has issues without it.

cernoh commented 8 months ago

Having this issue too, same error

Guan9Wu commented 8 months ago

I get this Xwayland crash on a regular basis and its damn annoying. It seems to be something to do with having something in the clipboard, then opening a file open/save dialog. Here are a couple of logs:我经常遇到 Xwayland 崩溃的情况,这真是太烦人了。这似乎与剪贴板中的内容有关,然后打开文件打开/保存对话框。以下是一些日志:

journal log: https://pastes.io/co3dwld8ub日志日志:https://pastes.io/co3dwld8ub hyprland log: https://pastes.io/gvy6lct3c6 hyprland 日志:https://pastes.io/gvy6lct3c6

Having the same error!!!

neilking01 commented 8 months ago

s/nearset/nearest/g

Eddio0141 commented 8 months ago

modifying hyprland configuration as below:

xwayland {
  # latest configuration
  # use_nearset_neighbor = true
  # force_zero_scaling = true
  # current configuration
  use_nearset_neighbor = false
  force_zero_scaling = false
}

That works for me. Maybe the different scaling between xwayland and wayland lead to this error. If crashing again, I will report.

Tried this, but still causes xwayland crash for me

neilking01 commented 8 months ago

Tried this, but still causes xwayland crash for me

Do you have a reliable way of reproducing the crash?

Eddio0141 commented 8 months ago

Tried this, but still causes xwayland crash for me

Do you have a reliable way of reproducing the crash?

Yes it's a jank way of doing but it crashes xwayland every time for me I only asked one person to test it and they don't have the same problem that I do with xwayland, and it didn't do anything for them, so I can't guarantee this would work for any of you here

This is a unity project, so get the correct unity version or add the project on unityhub to let it download the correct unity version Link Read the readme for the instructions

Eddio0141 commented 8 months ago

What is you wlroots version? If yours is 1.7, try to use wlroots-1.8.0 instead of wlroots-1.7.

Mine is on the latest git

Guan9Wu commented 8 months ago

What is you wlroots version? If yours is 1.7, try to use wlroots-1.8.0 instead of wlroots-1.7.

There's a 1.8? I only see up to 1.7.2 on the releases on their gitlab

In AUR, there is a git version of wlroots-1.8. But I'm sorry to tell you, I'm still having this problem with wlroots-1.8, and I don't know how to fix it now. When I open a choose file dialog in piclist-bin application, the crash happened again. At the time, I run a Window11 virtual machine in VirtualBox, Vivaldi browser with some webs, Obsidian application, and Zotero for paper reading. Along with the crash appeared, virtualbox, piclist-bin suddenly disappeard. Then I try to rerun these application in terminal, but nothing I got, only a freezing terminal with only one command for reruning application.

jennydaman commented 7 months ago

I am observing the same behavior on NixOS unstable. Running TurboVNC's vncviewer for some while will cause XWayland to crash, without any clear cause.

I set debug:disable_logs = false in hyprland.conf, are there more ways to toggle on logging?

Eddio0141 commented 6 months ago

update to this issue on my pc after updating hyprland to latest git at this point in time, going through the steps to cause the xwayland crash no longer works, no matter how many times I try this issue might have been fixed, will see if long term use causes xwayland to crash like it used to

Eddio0141 commented 1 month ago

Yeah this issue doesn't happen anymore on my side

littleblack111 commented 1 month ago

same here. crashed a few times. along with a waybar crash. some logs:

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808669784

src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808669784

error in client communication (pid 496472)
Gdk-Message: 21:50:09.371: Error reading events from display: Broken pipe
error in client communication (pid 490771)
error in client communication (pid 496427)
error in client communication (pid 608380)
Gdk-Message: 21:50:09.383: Error reading events from display: Broken pipe
error in client communication (pid 490716)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
Gdk-Message: 21:50:09.386: Error reading events from display: Broken pipe
Gdk-Message: 21:50:09.386: Error reading events from display: Broken pipe
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
error in client communication (pid 490630)
(EE) failed to read Wayland events: Connection reset by peer
error in client communication (pid 609684)
Io error: Broken pipe (os error 32)
Io error: Broken pipe (os error 32)
Io error: Broken pipe (os error 32)
Error: ExitFailure(1)
polybar|error: X connection error, terminating... (what: Socket, pipe or stream error)
polybar|notice:  Termination signal received, shutting down...
W2024-09-22 21:50:09.458260 xcbeventreader.cpp:51] XCB connection ":2" got error: 1
XIO:  fatal IO error 2 (No such file or directory) on X server ":2"
      after 26 requests (26 known processed) with 0 events remaining.
I2024-09-22 21:50:09.458806 xcbmodule.cpp:76] Disconnected from X11 Display :2
[0922/215009.464885:ERROR:elf_dynamic_array_reader.h(64)] tag not found
No players found
[WebContents] crashed (reason: crashed, exitCode: 134)... reloading
error in client communication (pid 490832)
[490832:0922/215011.057670:ERROR:wayland_event_watcher.cc(68)] Fatal Wayland communication error: Broken pipe.
[490832:0922/215011.057729:FATAL:electron_browser_main_parts.cc(502)] Failed to shutdown.
[0922/215011.062441:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0922/215011.062573:ERROR:elf_dynamic_array_reader.h(64)] tag not found
littleblack111 commented 1 month ago

and gnome-polkit seems to be going up 2 100% cpu after this as well...

EDIT: pkexec etc wont work. but sudo does... is gnome polkit running in xwayland?

Eddio0141 commented 1 month ago

@littleblack111 I also have waybar crash happening after resuming from a sleep, so it might not be hyprland related If you have cava enabled then might be related to https://github.com/Alexays/Waybar/issues/3437

littleblack111 commented 1 month ago

same, but i have this issue: https://github.com/hyprwm/Hyprland/issues/7822 i dont have cava enabled

littleblack111 commented 1 month ago

@vaxerski still experiencing this issue, please reopen