Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Intermittent xwayland crashes

Open Beyley opened this issue 2 years ago • 26 comments

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

Beyley avatar Nov 08 '23 07:11 Beyley

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.

vaxerski avatar Nov 11 '23 17:11 vaxerski

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 avatar Nov 11 '23 18:11 Beyley

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 avatar Nov 11 '23 20:11 Beyley

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

Beyley avatar Nov 12 '23 00:11 Beyley

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.

vaxerski avatar Nov 12 '23 12:11 vaxerski

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

Beyley avatar Nov 12 '23 22:11 Beyley

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

wlr_xwayland

vaxerski avatar Nov 12 '23 22:11 vaxerski

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?

Beyley avatar Nov 12 '23 22:11 Beyley

image

try > the output to a file and see whats wrong

vaxerski avatar Nov 12 '23 23:11 vaxerski

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) 

Beyley avatar Nov 12 '23 23:11 Beyley

odd

vaxerski avatar Nov 13 '23 00:11 vaxerski

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)

Beyley avatar Nov 14 '23 01:11 Beyley

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

neilking01 avatar Nov 16 '23 18:11 neilking01

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

vaxerski avatar Nov 16 '23 20:11 vaxerski

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 avatar Nov 16 '23 20:11 neilking01

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 [email protected]_pool (EE) failed to dispatch Wayland events: Invalid argument

neilking01 avatar Nov 17 '23 03:11 neilking01

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 [email protected]_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

Beyley avatar Nov 17 '23 04:11 Beyley

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 avatar Nov 17 '23 05:11 neilking01

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.

neilking01 avatar Nov 18 '23 08:11 neilking01

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 [email protected]_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 [email protected]_pool
(EE) failed to dispatch Wayland events: Invalid argument

Beyley avatar Nov 19 '23 02:11 Beyley

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

neilking01 avatar Nov 19 '23 03:11 neilking01

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 avatar Nov 19 '23 04:11 Beyley

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

Beyley avatar Nov 22 '23 20:11 Beyley

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 [email protected]_pool
(EE) failed to dispatch Wayland events: Invalid argument

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

Eddio0141 avatar Jan 15 '24 22:01 Eddio0141

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.

neilking01 avatar Jan 16 '24 01:01 neilking01

Having this issue too, same error

cernoh avatar Mar 04 '24 22:03 cernoh

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!!!

GyaneshW avatar Mar 12 '24 16:03 GyaneshW

s/nearset/nearest/g

neilking01 avatar Mar 13 '24 16:03 neilking01

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

Eddio0141 avatar Mar 13 '24 18:03 Eddio0141

Tried this, but still causes xwayland crash for me

Do you have a reliable way of reproducing the crash?

neilking01 avatar Mar 13 '24 18:03 neilking01