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
19.73k stars 839 forks source link

Rootless Xwayland Services Abort #6398

Closed hdm9527 closed 3 months ago

hdm9527 commented 3 months ago

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit 1423707dbefc0329e80895451903a77ab684f7ea dirty (output: remove wl_output globals for mirrored displays). Date: Mon Jun 10 06:06:42 2024 Tag: v0.40.0-183-g1423707d, commits: 4789 flags: (if any) System Information: System name: Linux Node name: Arch Release: 6.9.3-2-cachyos-echo-lto Version: #1 SMP PREEMPT_DYNAMIC Thu, 06 Jun 2024 06:05:56 +0000 GPU information: 64:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c7) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Bug or Regression?

Bug

Description

Rootless Xwayland service suddenly abort causing all xwayland apps to stop.

How to reproduce

above

Crash reports, logs, images, videos

Xwayland_coredumpctl.log

vaxerski commented 3 months ago

unless proven otherwise this is an xorg/xwayland issue

hdm9527 commented 3 months ago

unless proven otherwise this is an xorg/xwayland issue

The xwayland service did crash twice and I suspect this commit 6967a31450441fc5605c05db6f65505dace4b263 . I will run Hyprland with this 6967a31450441fc5605c05db6f65505dace4b263 and the previous commit to test rootless xwayland.

vaxerski commented 3 months ago

I am running xwayland with no issues

hdm9527 commented 3 months ago

I am running xwayland with no issues

It was running for a while and suddenly crashed. I was using intellij-idea and intellij-idea was suddenly shut down, launching intellij-idea from kitty revealed that it was xwayland services that had stopped. Something like the following error.

Start Failed
Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
    at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
    at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:65)
    at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:60)
    at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:68)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:103)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:88)
    at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:116)
    at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:513)
    at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:74)
    at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:595)
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invokeSuspend(ui.kt:161)
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.platform.ide.bootstrap.UiKt.initAwtToolkit(ui.kt:160)
    at com.intellij.platform.ide.bootstrap.UiKt.access$initAwtToolkit(ui.kt:1)
    at com.intellij.platform.ide.bootstrap.UiKt$scheduleInitAwtToolkit$task$1$1.invokeSuspend(ui.kt:123)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
        at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:74)
        at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:595)
        at com.intellij.util.ui.StartupUiUtil.isWaylandToolkit(StartupUiUtil.kt:190)
        at com.intellij.platform.ide.bootstrap.SplashManagerKt$showSplashIfNeeded$newJob$1.invokeSuspend(SplashManager.kt:93)
vaxerski commented 3 months ago

https://github.com/hyprwm/Hyprland/issues/6398#issuecomment-2158374836

qomosoloto commented 3 months ago

I am running xwayland with no issues

It was running for a while and suddenly crashed. I was using intellij-idea and intellij-idea was suddenly shut down, launching intellij-idea from kitty revealed that it was xwayland services that had stopped. Something like the following error.

Start Failed
Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
  at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
  at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:110)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
  at java.desktop/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:65)
  at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:60)
  at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:68)
  at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:103)
  at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:88)
  at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:116)
  at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:513)
  at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:74)
  at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:595)
  at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invokeSuspend(ui.kt:161)
  at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
  at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
  at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
  at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
  at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
  at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
  at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
  at com.intellij.platform.ide.bootstrap.UiKt.initAwtToolkit(ui.kt:160)
  at com.intellij.platform.ide.bootstrap.UiKt.access$initAwtToolkit(ui.kt:1)
  at com.intellij.platform.ide.bootstrap.UiKt$scheduleInitAwtToolkit$task$1$1.invokeSuspend(ui.kt:123)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
  Suppressed: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
      at java.desktop/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:74)
      at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:595)
      at com.intellij.util.ui.StartupUiUtil.isWaylandToolkit(StartupUiUtil.kt:190)
      at com.intellij.platform.ide.bootstrap.SplashManagerKt$showSplashIfNeeded$newJob$1.invokeSuspend(SplashManager.kt:93)

Just the same problem after today's upgrading...

hdm9527 commented 3 months ago

That's all the info I have so far, no way to reproduce it yet, XWaylan crashes randomly. From coredumpctl it looks like it's an internal XWayland call error.

[LOG] Window rule opacity 0.90 0.90 -> class:^(jetbrains) matched [Window 61a922a13810: title: "win384"
]
[LOG] Window rule opacity 0.80 0.80 -> class:^(jetbrains) matched [Window 61a922a13810: title: "win384"
]
[LOG] CWLSurface 61a922642480 called destroy()
[LOG] xwayland window 61a922709ff0 -> association to 0
[LOG] XWayland surface 61a9229060c0 unmapping
[LOG] [Window 61a922a13810: title: "win384", class: jetbrains-idea] unmapped
[LOG] Framebuffer created, status 36053
[LOG] Unmapped was not focused, ignoring a refocus.
[LOG] CWLSurface 61a9229b1280 called destroy()
[LOG] xwayland window 61a9229060c0 -> association to 0
[hc] getShapesC: found 1 images for left_ptr
[LOG] Registered signal for owner 61a91622fd80: 61a9229bfc48 -> 61a91622fe38 (owner: CPointerManager)
[LOG] Registered signal for owner 61a922785c40: 61a9225e8b18 -> 61a922785c50 (owner: CRenderbuffer)
[LOG] Callback 61a922785c78 -> 61a922785c70, CRenderbuffer removed.

> [LOG] Destroying workspace ID 2
> [ERR] XWayland has yeeten the xwm off?!
> [CRITICAL] XWayland has yeeten the xwm off?!

[LOG] [PrimarySelection] New offer 61a922852e00 for data source 61a922742f00
[LOG] cursorImage request: surface 1
[LOG] CWLSurface 61a916e8fdb0 called init()
[LOG] Callback 61a91622fe60 -> 61a91622fe58, CPointerManager removed.
[LOG] Registered signal for owner 61a9227f8340: 61a9225e8b18 -> 61a9227f8350 (owner: CRenderbuffer)
[LOG] Callback 61a9227f8378 -> 61a9227f8370, CRenderbuffer removed.
[LOG] Registered signal for owner 61a9227f8340: 61a92255b998 -> 61a9227f8350 (owner: CRenderbuffer)
[LOG] Callback 61a9227f8378 -> 61a9227f8370, CRenderbuffer removed.
[LOG] cursorImage request: surface 1
[LOG] Registered signal for owner 61a9229bda40: 61a92255b998 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] Registered signal for owner 61a9229bda40: 61a9221cecc8 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] cursorImage request: surface 1
[LOG] Registered signal for owner 61a9229bda40: 61a9225e8b18 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] cursorImage request: surface 1
[LOG] Registered signal for owner 61a9229bda40: 61a9225e8b18 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] Registered signal for owner 61a9229bda40: 61a92255b998 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] cursorImage request: surface 1
[LOG] Registered signal for owner 61a9229bda40: 61a9225e8b18 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] Registered signal for owner 61a9229bda40: 61a9225e8b18 -> 61a9229bda50 (owner: CRenderbuffer)
[LOG] Callback 61a9229bda78 -> 61a9229bda70, CRenderbuffer removed.
[LOG] Hyprctl: dispatcher workspace : 1
[LOG] Destroying workspace ID 3
[LOG] cursorImage request: surface 1
[LOG] Registered signal for owner 61a9228d7bb0: 61a92255b998 -> 61a9228d7bc0 (owner: CRenderbuffer)
[LOG] Callback 61a9228d7be8 -> 61a9228d7be0, CRenderbuffer removed.
[LOG] Registered signal for owner 61a9226fb880: 61a92255b998 -> 61a9226fb890 (owner: CRenderbuffer)
[LOG] Callback 61a9226fb8b8 -> 61a9226fb8b0, CRenderbuffer removed.

image

hdm9527 commented 3 months ago

displayfd write failure causes Xwayland to abort server. image image

vaxerski commented 3 months ago

wayland display or X display?

if wayland, maybe it's simply overflowing the buffer? Though idk why that'd happen.

hdm9527 commented 3 months ago

wayland display or X display?

if wayland, maybe it's simply overflowing the buffer? Though idk why that'd happen.

X display? Only the xwayland app is affected. This commit 6967a31450441fc5605c05db6f65505dace4b263 has this problem after merge.

MCSeekeri commented 3 months ago

Same problem, hard to reproduce, some days it can work for hours without errors steadily, other days it may crash multiple times in half an hour. My computer is Intel+NVIDIA, and the logs don't give any further information at the moment.

vaxerski commented 3 months ago

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1686

hdm9527 commented 3 months ago

https://gitlab.freedesktop.org/xorg/xserver/-/issues/1686

Thanks. The reason is that fs.file-max is not limited by default. https://github.com/systemd/systemd/commit/a8b627aaed409a15260c25988970c795bf963812

❯ sysctl fs.file-max
fs.file-max = 9223372036854775807
qomosoloto commented 3 months ago

I don't think modification fs.file-max can help to solve this problem. I still got this problem! This time, even the chrome browser can not started again.

图片

hdm9527 commented 3 months ago

I don't think modification fs.file-max can help to solve this problem. I still got this problem! This time, even the chrome browser can not started again.

图片

It is really not solved, more like a file descriptor leakage. My problem is all xwayland apps are simultaneously closed. Refer https://github.com/swaywm/sway/issues/5946

qomosoloto commented 3 months ago

I don't think modification fs.file-max can help to solve this problem. I still got this problem! This time, even the chrome browser can not started again. 图片

It is really not solved, more like a file descriptor leakage. My problem is all xwayland apps are simultaneously closed. Refer swaywm/sway#5946

And is any way to solve it? I had to siwtch to other DE to work...

hdm9527 commented 3 months ago

I don't think modification fs.file-max can help to solve this problem. I still got this problem! This time, even the chrome browser can not started again. 图片

It is really not solved, more like a file descriptor leakage. My problem is all xwayland apps are simultaneously closed. Refer swaywm/sway#5946

And is any way to solve it? I had to siwtch to other DE to work...

Downgrade to Hyprland v0.40.0 or use other WM/DE.

qomosoloto commented 3 months ago

I don't think modification fs.file-max can help to solve this problem. I still got this problem! This time, even the chrome browser can not started again. 图片

It is really not solved, more like a file descriptor leakage. My problem is all xwayland apps are simultaneously closed. Refer swaywm/sway#5946

And is any way to solve it? I had to siwtch to other DE to work...

Downgrade to Hyprland v0.40.0 or use other WM/DE.

Well, seems nothing else to do...

vaxerski commented 3 months ago

if you still have crashes, report them to xorg developers. It's xwayland crashing after all, not hyprland.

hdm9527 commented 3 months ago

if you still have crashes, report them to xorg developers. It's xwayland crashing after all, not hyprland.

It seems to be a wayland problem. xwayland-1132.log

[2658231.540] {Display Queue} wl_display#1.delete_id(516)
[2658231.548] {Default Queue} wl_buffer#472.release()
[2658238.129] {Display Queue} wl_display#1.delete_id(512)
[2658238.161] {Default Queue} wl_callback#512.done(24684158)
[2658259.448] {Default Queue}  -> zwp_linux_dmabuf_v1#13.create_params(new id zwp_linux_buffer_params_v1#512)
[2658259.465] {Default Queue}  -> zwp_linux_buffer_params_v1#512.add(fd 41, 0, 0, 3584, 33554432, 273070852)
[2658259.471] {Default Queue}  -> zwp_linux_buffer_params_v1#512.add(fd 42, 1, 1835008, 1024, 33554432, 273070852)
[2658259.474] {Default Queue}  -> zwp_linux_buffer_params_v1#512.create_immed(new id wl_buffer#516, 889, 476, 875713112, 0)
[2658259.478] {Default Queue}  -> zwp_linux_buffer_params_v1#512.destroy()
[2658259.483] {Default Queue}  -> wl_surface#522.attach(wl_buffer#516, 0, 0)
[2658259.487] {Default Queue}  -> wl_surface#522.damage_buffer(0, 88, 889, 388)
[2658259.490] {Default Queue}  -> wl_surface#522.frame(new id wl_callback#388)
[2658259.624] {Default Queue}  -> wl_surface#522.commit()
[2658259.775] {Display Queue} wl_display#1.error(wl_display#1, 1, "invalid arguments for zwp_linux_buffer_params_v1#512.add")
XWAYLAND: wl_display#1: error 1: invalid arguments for zwp_linux_buffer_params_v1#512.add
(EE) failed to dispatch Wayland events: Invalid argument

Edit: The FD in the parent compositor may be exhausted. https://github.com/swaywm/wlroots/issues/2594#issuecomment-753943889 ls /proc/$(pidof Hyprland)/fd image