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 837 forks source link

Crash when turning DPMS on from off #6082

Open AndreasBackx opened 4 months ago

AndreasBackx commented 4 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch at commit cba1ade848feac44b2eda677503900639581c3f4 (props: bump version to 0.40.0). Date: Sat May 4 15:42:32 2024 Tag: v0.40.0, commits: 4606 flags: (if any) System Information: System name: Linux Node name: andreasbackx-fedora-MJ0HJDFH Release: 6.8.9-300.fc40.x86_64 Version: #1 SMP PREEMPT_DYNAMIC Thu May 2 18:59:06 UTC 2024 GPU information: 61:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3080 Lite Hash Rate] [10de:2216] (rev a1) (prog-if 00 [VGA controller]) os-release: NAME="Fedora Linux" VERSION="40 (Workstation Edition)" ID=fedora VERSION_ID=40 VERSION_CODENAME="" PLATFORM_ID="platform:f40" PRETTY_NAME="Fedora Linux 40 (Workstation Edition)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:40" DEFAULT_HOSTNAME="fedora" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=40 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=40 SUPPORT_END=2025-05-13 VARIANT="Workstation Edition" VARIANT_ID=workstation plugins: ```

Bug or Regression?

Bug

Description

Using the following hypridle setup, my monitors were first turned off and then swaylock (lock there is a wrapper script) was called afterwards:

general {
    lock_cmd = pidof lock || lock
    before_sleep_cmd = loginctl lock-session    # lock before suspend.
    after_sleep_cmd = hyprctl dispatch dpms on  # to avoid having to press a key twice to turn on the display.
}

listener {
    timeout = 120
    on-timeout = hyprctl dispatch dpms off        # screen off when timeout has passed
    on-resume = hyprctl dispatch dpms on          # screen on when activity is detected after timeout has fired.
}

listener {
    timeout = 300
    on-timeout = loginctl lock-session            # lock screen when timeout has passed
}

When I came back to my desk and moved my mouse, the monitors turned back on and while I was typing my password (or right after I pressed enter, unsure) Hyprland crashed.

How to reproduce

Likely by turning DPMS back on, and potentially combining it with a lock, though I don't think the lock is necesary. This combined with Nvidia and multiple monitors.

Crash reports, logs, images, videos

Crash:

--------------------------------------------
   Hyprland Crash Report
--------------------------------------------
This was an accident, I swear!

Hyprland received signal 11(SEGV)
Version: cba1ade848feac44b2eda677503900639581c3f4
Tag: v0.40.0

System info:
    System name: Linux
    Node name: andreasbackx-fedora-MJ0HJDFH
    Release: 6.8.9-300.fc40.x86_64
    Version: #1 SMP PREEMPT_DYNAMIC Thu May  2 18:59:06 UTC 2024

GPU:
    61:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3080 Lite Hash Rate] [10de:2216] (rev a1) (prog-if 00 [VGA controller])

os-release:
    NAME="Fedora Linux"
    VERSION="40 (Workstation Edition)"
    ID=fedora
    VERSION_ID=40
    VERSION_CODENAME=""
    PLATFORM_ID="platform:f40"
    PRETTY_NAME="Fedora Linux 40 (Workstation Edition)"
    ANSI_COLOR="0;38;2;60;110;180"
    LOGO=fedora-logo-icon
    CPE_NAME="cpe:/o:fedoraproject:fedora:40"
    DEFAULT_HOSTNAME="fedora"
    HOME_URL="https://fedoraproject.org/"
    DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
    SUPPORT_URL="https://ask.fedoraproject.org/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_BUGZILLA_PRODUCT="Fedora"
    REDHAT_BUGZILLA_PRODUCT_VERSION=40
    REDHAT_SUPPORT_PRODUCT="Fedora"
    REDHAT_SUPPORT_PRODUCT_VERSION=40
    SUPPORT_END=2025-05-13
    VARIANT="Workstation Edition"
    VARIANT_ID=workstation
Backtrace:
    # | /usr/bin/Hyprland(_Z12getBacktracev+0x60) [0x55ba8d1c1140]
        getBacktrace()
        ??:?
    #1 | /usr/bin/Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0x188e) [0x55ba8d15500e]
        CrashReporter::createAndSaveCrash(int)
        ??:?
    #2 | /usr/bin/Hyprland(_Z25handleUnrecoverableSignali+0x68) [0x55ba8d0eed58]
        handleUnrecoverableSignal(int)
        ??:?
    #3 | /lib64/libc.so.6(+0x40710) [0x7f3be7e53710]
        ??
        ??:0
    #4 | /usr/bin/Hyprland(+0x2913f5) [0x55ba8d2593f5]
        CGammaControlProtocol::applyGammaToState(CMonitor*)
        ??:?
    #5 | /usr/bin/Hyprland(+0x105e70) [0x55ba8d0cde70]
        _start
        ??:?
    #6 | /lib64/libffi.so.8(+0x9056) [0x7f3be82bc056]
        ??
        ??:0
    #7 | /lib64/libffi.so.8(+0x56a0) [0x7f3be82b86a0]
        ??
        ??:0
    #8 | /lib64/libffi.so.8(ffi_call+0x12e) [0x7f3be82bb4ee]
        ??
        ??:0
    #9 | /lib64/libwayland-server.so.0(+0x67e3) [0x7f3be89497e3]
        ??
        ??:0
    #1 | /lib64/libwayland-server.so.0(+0xb080) [0x7f3be894e080]
        ??
        ??:0
    #11 | /lib64/libwayland-server.so.0(wl_event_loop_dispatch+0xa2) [0x7f3be894c852]
        ??
        ??:0
    #12 | /lib64/libwayland-server.so.0(wl_display_run+0x35) [0x7f3be894d0d5]
        ??
        ??:0
    #13 | /usr/bin/Hyprland(_ZN17CEventLoopManager9enterLoopEP10wl_displayP13wl_event_loop+0x53) [0x55ba8d2197e3]
        CEventLoopManager::enterLoop(wl_display*, wl_event_loop*)
        ??:?
    #14 | /usr/bin/Hyprland(main+0x863) [0x55ba8d0a5b73]
        main
        ??:?
    #15 | /lib64/libc.so.6(+0x2a088) [0x7f3be7e3d088]
        ??
        ??:0
    #16 | /lib64/libc.so.6(__libc_start_main+0x8b) [0x7f3be7e3d14b]
        ??
        ??:0
    #17 | /usr/bin/Hyprland(_start+0x25) [0x55ba8d0cc455]
        _start
        ??:?

Log tail:
[LOG] Hyprctl: dispatcher dpms : on
[LOG] Registered signal for owner 55ba8e0639d0: 55ba8df1c5e8 -> 55ba8e0639d8 (owner: CRenderbuffer)
[LOG] Registered signal for owner 55ba8e0a2500: 55ba8dce6ad8 -> 55ba8e0a2508 (owner: CRenderbuffer)
[LOG] Registered signal for owner 55ba9088a060: 55ba8d97ab98 -> 55ba9088a068 (owner: CRenderbuffer)
[LOG] Destroy called for monitor HDMI-A-1
[LOG] onDisconnect called for HDMI-A-1
[LOG] Callback 55ba8dd07068 -> 55ba8dd07060,  removed.
[LOG] Callback 55ba8dd071a0 -> 55ba8dd07198,  removed.
[LOG] Callback 55ba8dd07208 -> 55ba8dd07200,  removed.
[LOG] Callback 55ba8dd07270 -> 55ba8dd07268,  removed.
[LOG] Callback 55ba8dd072d8 -> 55ba8dd072d0,  removed.
[LOG] Removed monitor HDMI-A-1!
[LOG] moveWorkspaceToMonitor: Moving -98 to monitor 1
[LOG] [hookSystem] New hook event registered: moveWorkspace
[LOG] moveWorkspaceToMonitor: Moving 101 to monitor 1
[LOG] moveWorkspaceToMonitor: Plugging gap with new 13
[LOG] moveWorkspaceToMonitor: Plugging gap with existing 13
[LOG] moveWorkspaceToMonitor: SWITCHINGISACTIVE, active 3 -> 101
[LOG] Callback 55ba8dd2ab30 -> 55ba8dd2ab28, CRenderbuffer removed.
[LOG] Callback 55ba8e063a00 -> 55ba8e0639f8, CRenderbuffer removed.
[LOG] Removing monitor HDMI-A-1 from realMonitors
[LOG] Callback 55ba8dd070d0 -> 55ba8dd070c8,  removed.
[LOG] Callback 55ba8dd07138 -> 55ba8dd07130,  removed.
[LOG] Destroying workspace ID 13
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf7258 -> 55ba8dd07040 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf72e8 -> 55ba8dd070a8 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf72d8 -> 55ba8dd07110 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf7268 -> 55ba8dd07178 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf7278 -> 55ba8dd071e0 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf7298 -> 55ba8dd07248 (owner: )
[LOG] Registered signal for owner 55ba8dd06b20: 55ba8dcf72b8 -> 55ba8dd072b0 (owner: )
[LOG] Applying monitor rule for HDMI-A-1
[LOG] Monitor HDMI-A-1: requested 3840x2160@120.000000, found available mode: 3840x2160@119880mHz, applying.
[LOG] output HDMI-A-1 succeeded basic test on format DRM_FORMAT_XRGB8888
[LOG] Monitor HDMI-A-1 -> destroyed all render data
[LOG] arrangeMonitors: 3 to arrange
[LOG] arrangeMonitors: DP-2 explicit [0, 0]
[LOG] arrangeMonitors: DP-3 explicit [4800, 0]
[LOG] arrangeMonitors: HDMI-A-1 explicit [1728, 865]
[LOG] arrangeMonitors: DP-2 xwayland [0, 0]
[LOG] arrangeMonitors: DP-3 xwayland [2160, 0]
[LOG] arrangeMonitors: HDMI-A-1 xwayland [4320, 0]
[LOG] Monitor HDMI-A-1 data dump: res 3840x2160@119.88Hz, scale 1.25, transform 0, pos 1728x865, 10b 0
[LOG] Added new monitor with name HDMI-A-1 at [1728, 865] with size [3840, 2160], pointer 55ba8dcf71b0
[LOG] New monitor: WORKSPACEID 101, exists: 1
[LOG] moveWorkspaceToMonitor: Moving 101 to monitor 0
[LOG] moveWorkspaceToMonitor: Plugging gap with existing 5
[LOG] moveWorkspaceToMonitor: SWITCHINGISACTIVE, active 0 -> 101
[LOG] moveWorkspaceToMonitor: Moving -98 to monitor 0
[LOG] Applying monitor rule for DP-2
[LOG] Not applying a new rule to DP-2 because it's already applied!
[LOG] Applying monitor rule for DP-3
[LOG] Monitor DP-3: REJECTED available mode: 3840x2160@143.998993!
[ERR] Custom resolution FAILED, falling back to preferred
[ERR] Monitor DP-3 got an invalid requested mode: 3840x2160@144.000000, using the preferred one instead: 3840x2160@59.997002
[LOG] output DP-3 succeeded basic test on format DRM_FORMAT_XRGB8888
[LOG] arrangeMonitors: 3 to arrange
[LOG] arrangeMonitors: DP-2 explicit [0, 0]
[LOG] arrangeMonitors: DP-3 explicit [4800, 0]
[LOG] arrangeMonitors: HDMI-A-1 explicit [1728, 865]
[LOG] arrangeMonitors: DP-2 xwayland [0, 0]
[LOG] arrangeMonitors: DP-3 xwayland [2160, 0]
[LOG] arrangeMonitors: HDMI-A-1 xwayland [4320, 0]
[LOG] Monitor DP-3 data dump: res 3840x2160@60.00Hz, scale 1.25, transform 3, pos 4800x0, 10b 0
[LOG] Applying monitor rule for HDMI-A-1
[LOG] Not applying a new rule to HDMI-A-1 because it's already applied!

You can find my dotfiles at https://github.com/AndreasBackx/dotfiles/tree/main/private_dot_config/hypr

vaxerski commented 4 months ago

can you https://wiki.hyprland.org/Crashes-and-Bugs/#obtaining-a-debug-stacktrace please

apelloni commented 4 months ago

I have a similar problem. after removing the external monitor from my laptop, the first time I call hyprctl keyword monitor "eDP-1, enable" Hyprland shuts down and I'm back to the login screen

[LOG] Instance Signature: cba1ade848feac44b2eda677503900639581c3f4_1715843843_591556996
[LOG] Runtime directory: /run/user/1000/hypr/cba1ade848feac44b2eda677503900639581c3f4_1715843843_591556996
[LOG] Hyprland PID: 165344
[LOG] ===== SYSTEM INFO: =====
[LOG] System name: Linux
[LOG] Release: 6.8.9-arch1-2
[LOG] Version: #1 SMP PREEMPT_DYNAMIC Tue, 07 May 2024 21:35:54 +0000

[LOG] GPU information:
00:02.0 VGA compatible controller [0300]: Intel Corporation Raptor Lake-P [Iris Xe Graphics] [8086:a7a0] (rev 04) (prog-if 00 [VGA controller])

[LOG] 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
cjk commented 4 months ago

Same here, also happens on wake-up from suspend.

Crash-dump from systemd-journal, not sure it helps:

image

apelloni commented 4 months ago

Downgrading to 39.1-5 with pacman -U https://archive.archlinux.org/packages/h/hyprland/hyprland-0.39.1-5-x86_64.pkg.tar.zst Does remove the problem if someone needs a quick patch to be able to work on their machine.

AndreasBackx commented 4 months ago

@vaxerski I will do so, though it might take a while to reproduce as it doesn't happen consistently and this particular machine is used less frequently as well (2 days a week). Will post here when I have some debug log though.

apelloni commented 3 months ago

The problem seems to be fixed with the latest version 0.41.0

vaxerski commented 3 months ago

@AndreasBackx ?

ehula commented 2 months ago

Has this been solved. I have the same problem. When waking from suspend, if I have external monitors connected, hyprland crashes.

vaxerski commented 2 months ago

make sure you're on latest 0.41.2 and if it's still there post a debug stacktrace https://wiki.hyprland.org/Crashes-and-Bugs/#obtaining-a-debug-stacktrace

ehula commented 2 months ago

I'm afraid I don't know how to build hyprland in debug. I am running nixos and am using this flake input:

    hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";

so running hyprctl version doesn't give me a version number, but this:

Hyprland, built from branch  at commit e4d09aa3a9de9a9e71c10bf4b6800585b3db9a4c  ().
Date: 2024-06-25
Tag: , commits: e4d09aa3a9de9a9e71c10bf4b6800585b3db9a4c

The behaviour I get is that hyprland crashes when resuming from sleep with external monitors connected, or simply plugging in external monitors.

I am running hyprland on nixos on a Framework 13 11th Gen i5 with Intel graphics.

AndreasBackx commented 2 months ago

@vaxerski hey, sorry. I've been using Hyprland compiled with debug and have had some crashes with it. Though I hadn't reported any yet because I haven't been able to set the time aside to figure out coredumpctl. I'm using Fedora which should have it enabled by default. Will report back once I have, though it's been especially busy. My apologies.

fufexan commented 2 months ago

I'm afraid I don't know how to build hyprland in debug.

@ehula https://wiki.hyprland.org/Nix/Contributing-and-Debugging/#build-in-debug-mode