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
18.31k stars 761 forks source link

Crash after disconnecting a mirrored HDMI display #5241

Closed d4r1us-drk closed 3 months ago

d4r1us-drk commented 3 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit c5e28ebcfe00a510922779b2c568cfa52a317445 (props: bump ver 0.37.1). Date: Sat Mar 16 14:51:49 2024 Tag: v0.37.1 flags: (if any) System Information: System name: Linux Node name: thonkpad Release: 6.7.9-200.fc39.x86_64 Version: #1 SMP PREEMPT_DYNAMIC Wed Mar 6 19:35:04 UTC 2024 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-U GT2 [UHD Graphics] [8086:9b41] (rev 02) (prog-if 00 [VGA controller]) os-release: NAME="Fedora Linux" VERSION="39 (Thirty Nine)" ID=fedora VERSION_ID=39 VERSION_CODENAME="" PLATFORM_ID="platform:f39" PRETTY_NAME="Fedora Linux 39 (Thirty Nine)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:39" DEFAULT_HOSTNAME="fedora" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f39/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=39 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=39 SUPPORT_END=2024-11-12 plugins: ```

Bug or Regression?

Bug

Description

After connecting a mirrored display, my wallpaper manager 'swww' crashes and any existing clients aswell (not shown in the video). When disconnecting a mirrored display, all workspaces are gone (none appear in Waybar, even after killing it and open it again, for which I have a keybinding "Super+B"). If I then try to launch a client in this state (alacritty with a keybinding "Super+Enter" for instance), Hyprland crashes. But, if I don't launch anything and instead reconnect the display, workspaces are back and everything works fine, but disconnecting it again will bring back the problem.

I tested hyprland-git (from solopasha/hyprland Fedora COPR), all of these things happen, but if try to reconnect and disconnect the display a few times, it will go back to normal and the bug doesn't happen (I only tried this once tho).

Bugs that may be related are specially #2770, and for the missing workspaces: #3306.

How to reproduce

  1. Have Hyprland configured with a mirrored display.
  2. Connect an external display. Any existing client including wallpaper manager gets killed.
  3. Disconnect it. Workspaces are gone.
  4. Launch any client. Hyprland crashes.

Crash reports, logs, images, videos

Crash Logs ``` -------------------------------------------- Hyprland Crash Report -------------------------------------------- Maybe you should try dusting your PC in the meantime? Hyprland received signal 11 (Segmentation fault) Version: c5e28ebcfe00a510922779b2c568cfa52a317445 Tag: v0.37.1 System info: System name: Linux Node name: thonkpad Release: 6.7.9-200.fc39.x86_64 Version: #1 SMP PREEMPT_DYNAMIC Wed Mar 6 19:35:04 UTC 2024 GPU: 00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-U GT2 [UHD Graphics] [8086:9b41] (rev 02) (prog-if 00 [VGA controller]) os-release: NAME="Fedora Linux" VERSION="39 (Thirty Nine)" ID=fedora VERSION_ID=39 VERSION_CODENAME="" PLATFORM_ID="platform:f39" PRETTY_NAME="Fedora Linux 39 (Thirty Nine)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:39" DEFAULT_HOSTNAME="fedora" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f39/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=39 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=39 SUPPORT_END=2024-11-12 Backtrace: #0 | Hyprland(_Z12getBacktracev+0x69) [0x5647392e9619] getBacktrace() ??:? #1 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0x838) [0x5647392a4158] CrashReporter::createAndSaveCrash(int) ??:? #2 | Hyprland(_Z25handleUnrecoverableSignali+0x4d) [0x56473922746d] handleUnrecoverableSignal(int) ??:? #3 | /lib64/libc.so.6(+0x3e9a0) [0x7f7cdac5c9a0] ?? ??:0 #4 | Hyprland(_ZN6Events18listener_mapWindowEPvS0_+0x126) [0x5647392d6a36] Events::listener_mapWindow(void*, void*) ??:? #5 | Hyprland(_Z13handleWrappedP11wl_listenerPv+0x5b) [0x5647392f40bb] handleWrapped(wl_listener*, void*) ??:? #6 | /lib64/libwayland-server.so.0(wl_signal_emit_mutable+0x7c) [0x7f7cdb799dcc] ?? ??:0 #7 | Hyprland(+0x2771ad) [0x5647393c71ad] wlr_cursor_destroy ??:? #8 | /lib64/libffi.so.8(+0x9056) [0x7f7cdac17056] ?? ??:0 #9 | /lib64/libffi.so.8(+0x55ef) [0x7f7cdac135ef] ?? ??:0 #10 | /lib64/libffi.so.8(ffi_call+0x12e) [0x7f7cdac163fe] ?? ??:0 #11 | /lib64/libwayland-server.so.0(+0x9843) [0x7f7cdb798843] ?? ??:0 #12 | /lib64/libwayland-server.so.0(+0xe0b4) [0x7f7cdb79d0b4] ?? ??:0 #13 | /lib64/libwayland-server.so.0(wl_event_loop_dispatch+0xa2) [0x7f7cdb79b8e2] ?? ??:0 #14 | /lib64/libwayland-server.so.0(wl_display_run+0x35) [0x7f7cdb79c125] ?? ??:0 #15 | Hyprland(main+0x815) [0x56473920e225] main ??:? #16 | /lib64/libc.so.6(+0x2814a) [0x7f7cdac4614a] ?? ??:0 #17 | /lib64/libc.so.6(__libc_start_main+0x8b) [0x7f7cdac4620b] ?? ??:0 #18 | Hyprland(_start+0x25) [0x564739224925] _start ??:? Log tail: [LOG] Monitor HEADLESS-1 data dump: res 1920x1080@60.00Hz, scale 1.00, transform 0, pos 3840x0, 10b 0 [LOG] Added new monitor with name HEADLESS-1 at [3840, 0] with size [1920, 1080], pointer 56473acb4d00 [LOG] New monitor: WORKSPACEID 3, exists: 0 [LOG] Callback 56473b1cef00 -> 56473b1ceef8, CRenderbuffer removed. [LOG] Callback 56473b200c70 -> 56473b200c68, CRenderbuffer removed. [LOG] Removing monitor HDMI-A-1 from realMonitors [LOG] Callback 56473b1e0288 -> 56473b1e0280, removed. [LOG] Callback 56473b1e02f0 -> 56473b1e02e8, removed. [WARN] Attempted to render frame on inactive session! [LOG] Leaving unsafe state [LOG] onDisconnect called for HEADLESS-1 [LOG] Callback 56473acf6a90 -> 56473acf6a88, removed. [LOG] Callback 56473acf6bc8 -> 56473acf6bc0, removed. [LOG] Callback 56473acf6c30 -> 56473acf6c28, removed. [LOG] Callback 56473acf6c98 -> 56473acf6c90, removed. [LOG] Callback 56473acf6d00 -> 56473acf6cf8, removed. [LOG] Removed monitor HEADLESS-1! [LOG] moveWorkspaceToMonitor: Moving 1 to monitor 0 [LOG] moveWorkspaceToMonitor: Moving 3 to monitor 0 [LOG] moveWorkspaceToMonitor: Plugging gap with new 4 [LOG] moveWorkspaceToMonitor: Plugging gap with existing 4 [LOG] Destroying workspace ID 1 [LOG] Destroying workspace ID 3 [LOG] Destroying workspace ID 4 [LOG] Applying monitor rule for eDP-1 [LOG] Setting preferred mode for eDP-1 [LOG] output eDP-1 succeeded basic test on format DRM_FORMAT_XRGB8888 [LOG] arrangeMonitors: 1 to arrange [LOG] arrangeMonitors: eDP-1 auto [0, 0.00] [LOG] arrangeMonitors: eDP-1 xwayland [0, 0.00] [LOG] Monitor eDP-1 data dump: res 1920x1080@60.02Hz, scale 1.00, transform 0, pos 0x0, 10b 0 [LOG] Fading out a non-existent LS?? [backend/drm/drm.c:826] connector eDP-1: Failed to page-flip output: a page-flip is already pending [LOG] Registered signal for owner 56473b1dfde0: 56473b1be408 -> 56473b1e0218 (owner: layerSurface) [LOG] Registered signal for owner 56473b1dfde0: 56473b1c0db8 -> 56473b1e00e0 (owner: layerSurface) [LOG] Registered signal for owner 56473b1dfde0: 56473b1be418 -> 56473b1e0148 (owner: layerSurface) [LOG] Registered signal for owner 56473b1dfde0: 56473b1be428 -> 56473b1e01b0 (owner: layerSurface) [LOG] Registered signal for owner 564739e4d690: 56473b1c0dc8 -> 564739e4d810 (owner: CPopup Head) [LOG] LayerSurface 56473b1c0cf0 (namespace waybar layer 2) created on monitor eDP-1 [ERR] BUG THIS: No CWLSurface for surface in damageSurface!!! [WARN] Orphaned wlr_surface 56473b1be130 in setPreferredScaleForSurface [WARN] Orphaned wlr_surface 56473b1be130 in setPreferredTransformForSurface [LOG] LayerSurface 56473b1c0cf0 mapped [LOG] Registered signal for owner 56473b1dffc0: 56473b1be448 -> 56473b1e0008 (owner: CWLSurface) [LOG] Registered signal for owner 56473b1dffc0: 56473b1be408 -> 56473b1e0070 (owner: CWLSurface) [LOG] CWLSurface 56473b1dffc0 called init() [LOG] Keybind triggered, calling dispatcher (64, , 65293) [LOG] Executing alacritty [LOG] Process Created with pid 137215 [LOG] FractionalScaleManager bound successfully! [LOG] New TextInput added! [LOG] Registered signal for owner 56473a9ac500: 56473bea50b8 -> 56473a9ac518 (owner: textInput) [LOG] Registered signal for owner 56473a9ac500: 56473bea50c8 -> 56473a9ac5e8 (owner: textInput) [LOG] Registered signal for owner 56473a9ac500: 56473bea50d8 -> 56473a9ac580 (owner: textInput) [LOG] Registered signal for owner 56473a9ac500: 56473bea50e8 -> 56473a9ac650 (owner: textInput) [LOG] New XDG Toplevel created. (class: null) [LOG] Registered signal for owner 56473bea3820: 56473be9b668 -> 56473bea3888 (owner: XDG Window) [LOG] Registered signal for owner 56473bea3820: 56473be9b9c8 -> 56473bea3958 (owner: XDG Window) [LOG] Registered signal for owner 56473bea3820: 56473be9b658 -> 56473bea3820 (owner: XDG Window) [types/xdg_shell/wlr_xdg_surface.c:169] A configure is scheduled for an uninitialized xdg_surface 0x56473be9b920 [LOG] Searching for matching rules for Alacritty (title: Alacritty) [LOG] Layout predicts size [Vector2D: x: 0, y: 0] for [Window 56473bea3820: title: ""] ```

https://github.com/hyprwm/Hyprland/assets/131416536/72360541-74f0-4100-a290-8fb69b92c005

Config ``` monitor=HDMI-A-1, preferred, auto, 1 monitor=eDP-1, preferred, auto, 1, mirror, HDMI-A-1 ``` full config available [here](https://github.com/d4r1us-drk/dotfiles/tree/hyprland)
vaxerski commented 3 months ago

patch.txt try

d4r1us-drk commented 3 months ago

It improved a lot with this, now Hyprland doesn't crash, but some weird behavior remains, like If I have a client opened before connecting the display, that client will vanish. If I then disconnect the display with a client opened, this time it will not kill it, but the compositor sends me to the next workspace, In this state I need to open another client first to be able to switch workspaces and see the client I left opened before disconnecting the display. Waybar still doesn't show the workspaces after disconnecting the display and sometimes it will crash, but restarting it fixes the problem and workspaces are back. I guess this has something to do with how Waybar detects Hyprland's workspaces.

Also I decided to switch to hyprpaper (swww was crashing weirdly in some circumstances), and with this config, the wallpaper will stay perfectly on both displays no matter if I disconnect it:

preload = $HOME/.config/hypr/wall/wall.png
wallpaper = eDP-1,$HOME/.config/hypr/wall/wall.png
wallpaper = HDMI-A-1,$HOME/.config/hypr/wall/wall.png
splash = false

I also found hyprpaper to be more stable than swww, so I will stick with it.

d4r1us-drk commented 3 months ago

Also I had to use an Arch container with distrobox to compile Hyprland, the linker was giving me some errors regarding some wlroots functions. I'm not sure what's wrong with compiling in Fedora. But anyways, I'm running Hyprland from the build dir at the moment, in the host system of course.

vhalragnarok-ffxiv commented 3 months ago

Commenting since I was directed here. I did switch to the git version and applied this patch.

I've not tried this overnight to see if it removes my issue entirely, however, the only thing that crashes is swww at this stage. If that remains true, I'll call this issue on my end fully solved, and just blame swww for being swww. I swapped my config to using Hyprpaper which hopefully should be more stable.

vaxerski commented 3 months ago

I've committed the patch. Feel free to close once confirmed working.

d4r1us-drk commented 3 months ago

Yup, I installed hyprland-git-0.37.1^26.gita9d7526-1.fc39.x86_64.rpm from the solopasha/hyprland Fedora COPR, and it's working good now, no crashes or anything. Also looks like what I said about the clients getting killed when connecting the monitor isn't totally correct, when I tested right now they stayed open (Firefox & Kitty in this case). But is there any reason why the compositor sends me to an empty workspace after disconnecting the display? I guess that's the only weird thing. Apart from that, I'll call this issue on my end fully solved too.

d4r1us-drk commented 3 months ago

Closing for now

vhalragnarok-ffxiv commented 3 months ago

I can confirm that this patch worked to also solve my issue.