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.38k stars 898 forks source link

v0.41.0 fails DMABUF on FreeBSD #6408

Closed jbeich closed 4 months ago

jbeich commented 4 months ago

Bug or Regression?

Regression

System Info and Version

System/Version info ```sh $ hyprctl systeminfo -c Hyprland, built from branch main at commit ea2501d4556f84d3de86a4ae2f4b22a474555b9f portbld (?). Date: Mon Jun 10 14:23:06 UTC 2024 Tag: v0.41.0, commits: ? flags: (if any) System Information: System name: FreeBSD Node name: foo.bar Release: 15.0-CURRENT Version: FreeBSD 15.0-CURRENT #0 main-n270588-480ad4055314: Tue Jun 4 21:21:33 UTC 2024 test@foo.bar:/usr/obj/usr/src/amd64.amd64/sys/MYKERNEL GPU information: vgapci1@pci0:0:2:0: class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x1912 subvendor=0x1462 subdevice=0x7968 vendor = 'Intel Corporation' device = 'HD Graphics 530' class = display subclass = VGA os-release: NAME=FreeBSD VERSION="15.0-CURRENT" VERSION_ID="15.0" ID=freebsd ANSI_COLOR="0;31" PRETTY_NAME="FreeBSD 15.0-CURRENT" CPE_NAME="cpe:/o:freebsd:freebsd:15.0" HOME_URL="https://FreeBSD.org/" BUG_REPORT_URL="https://bugs.FreeBSD.org/" plugins: ======Config-Start====== Config File: /tmp/hyprland.conf: Read Succeeded bind = SUPER, BackSpace, exit bind = SUPER, Return, exec, vkcube-wayland debug { enable_stdout_logs = true disable_logs = false } ======Config-End======== ```

Description

Regressed by #6268

# Error out if GPU rendering fails instead of falling back
$ sudo rm /usr/lib/dri/{swrast,zink}_dri.so

$ mpv --no-config --vo=gpu-next --gpu-context=wayland /path/to/foo.mp4
[...]
libEGL warning: wayland-egl: we could not map the format table so we won't be able to use this batch of dma-buf feedback events.
libEGL warning: MESA-LOADER: failed to open swrast: Cannot open "/usr/lib/dri/swrast_dri.so" (search paths /usr/local/lib/dri, suffix _dri)

[vo/gpu-next] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.

$ vkcube-wayland
Selected GPU 0: Intel(R) HD Graphics 530 (SKL GT2), type: IntegratedGpu
Can't find our preferred formats... Falling back to first exposed format. Rendering may be incorrect.

$ Hyprland
[...]
[ERR] [LinuxDMABUF] FIXME: surface feedback stub
[LOG] [LinuxDMABUF] Creating a dmabuf, with id 20: size [Vector2D: x: 500, y: 500], fmt 0, planes 1
[LOG] [LinuxDMABUF]  | plane 0: mod 72057594037927935 fd 41 stride 512 offset 0
[EGL] command: eglCreateImageKHR, error: EGL_BAD_MATCH (0x3009), message: "unknown drm fourcc format"
[ERR] EGL: EGLCreateImageKHR failed: 12297
[ERR] [LinuxDMABUF] Possibly compositor bug: buffer failed to create
[...]

How to reproduce

Unknown. I can't test on Linux or with an AMD GPU.

Crash reports, logs, images, videos

hyprland.log

vaxerski commented 4 months ago

hm, looks like the format table got fucked.

vaxerski commented 4 months ago

https://github.com/hyprwm/Hyprland/blob/ea2501d4556f84d3de86a4ae2f4b22a474555b9f/src/protocols/LinuxDMABUF.hpp#L33-L39

Is there something wrong here? I remember wlroots having some comment complaining about BSD.

I'm guessing this is some bsd issue.

vaxerski commented 4 months ago

generally from the log hyprland seems to collect the dmabuf formats correctly, but the table in linux-dmabuf is malformed.

Most of the logic is here: https://github.com/hyprwm/Hyprland/blob/811429bfd4a46f33c7788580f72038b0c3c1c2b1/src/protocols/LinuxDMABUF.cpp

and it was tested under nvidia, amd and intel (albeit on linux) and was working.

iamtimmy commented 4 months ago

I'm seeing this issue once every couple hours of Unreal Engine 5.3.2 Editor usage on NixOS Linux with the latest flake from this repo. I'm afraid I can't share an entire log file because it contains too much personal info.

The crash always happens right after [ERR] [LinuxDMABUF] FIXME: surface feedback stub There's no crash log, the window manager just closes and takes me back to sddm.

Here's a snippet:

[LOG] CWLSurface 2a26fca0 called init()
[LOG] xwayland window 29f9b140 -> association to 29ae72f0
[LOG] [LinuxDMABUF] Creating a dmabuf, with id 936: size [Vector2D: x: 471, y: 36], fmt 875713112, planes 1
[LOG] [LinuxDMABUF]  | plane 0: mod 216172782128496658 fd 1021 stride 1920 offset 0
[LOG] XWayland surface 29f9b140 mapping
[LOG] New window contains HL_INITIAL_WORKSPACE_TOKEN: 9b38ec2c-1614-4f01-a0d6-1673293ef7b6
[LOG] Searching for matching rules for UnrealEditor (title: )
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7bbf50: title: ""]
[LOG] Map request dispatched, monitor DP-2, window pos: [3178.00000, 698.00000], window size: [471.00000, 36.00000]
[LOG] Searching for matching rules for UnrealEditor (title: REDACTED - Unreal Editor)
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7a7060: title: "REDACTED - Unreal Editor"]
[LOG] Searching for matching rules for UnrealEditor (title: REDACTED - Unreal Editor)
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7dfb10: title: "REDACTED - Unreal Editor"]
[LOG] Searching for matching rules for UnrealEditor (title: )
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7bbf50: title: ""]
[LOG] XWayland surface 29f9b140 unmapping
[LOG] [Window 2a7bbf50: title: "", class: UnrealEditor] unmapped
[LOG] Unmapped was not focused, ignoring a refocus.
[LOG] Searching for matching rules for UnrealEditor (title: REDACTED - Unreal Editor)
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7a7060: title: "REDACTED - Unreal Editor"]
[LOG] Searching for matching rules for UnrealEditor (title: REDACTED - Unreal Editor)
[LOG] Window rule suppressevent maximize ->  class:.* matched [Window 2a7dfb10: title: "REDACTED - Unreal Editor"]
[LOG] CWLSurface 2a26fca0 called destroy()
[LOG] xwayland window 29f9b140 -> association to 0
[LOG] Dissociate for 29f9b140
[WARN] [xwm] Re-assignment of WL_SURFACE_SERIAL
[LOG] [xwm] surface 29f9b140 requests serial 33d
[LOG] [xwm] Handled message prop 244 -> WL_SURFACE_SERIAL
[LOG] [WLCompositor] New wl_surface with id 914 at 29ae72f0
[LOG] [xwm] New XWayland surface at 1
[WARN] [xwm] CXWM::onNewSurface: no matching xwaylandSurface
[ERR] [LinuxDMABUF] FIXME: surface feedback stub
config and specs ``` Hyprland, built from branch at commit 811429bfd4a46f33c7788580f72038b0c3c1c2b1 (). Date: 2024-06-10 Tag: , commits: flags: (if any) System Information: System name: Linux Node name: desktop Release: 6.9.3-cachyos Version: #1-NixOS SMP PREEMPT_DYNAMIC Thu May 30 07:45:04 UTC 2024 GPU information: 2d:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU104 [GeForce RTX 2070 SUPER] [10de:1e84] (rev a1) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20240607.051f920" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuña)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuña)" VERSION_CODENAME="vicuña" VERSION_ID="24.11" plugins: ======Config-Start====== Config File: /home/user/.config/hypr/hyprland.conf: Read Succeeded debug:disable_logs = false ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ # monitor=,preferred,auto,auto # left monitor = DP-1, 1920x1080@75, 0x0, 1 # centre monitor = DP-2, 1920x1080@180, 1920x0, 1 # right monitor = DP-3, 1920x1080@75, 3840x0, 1 ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # Set programs that you use $terminal = kitty $fileManager = dolphin $menu = rofi -show drun -show-colors ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: exec-once = swww-daemon & swww img ~/Pictures/wallpapers/one.png & exec-once = waybar & exec-once = mako & exec-once = wl-paste --paste text --watch cliphist store #Stores only text data exec-once = wl-paste --paste image --watch cliphist store #Stores only image data exec-once = easyeffects --gapplication-service exec-once = /nix/store/$(ls -la /nix/store | grep polkit-kde-agent | grep '^d' | awk '{print $9}')/libexec/polkit-kde-authentication-agent-1 & ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 env = QT_QPA_PLATFORMTHEME,qt5ct xwayland { force_zero_scaling = true } ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 0 gaps_out = 2 border_size = 1 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors col.active_border = rgba(FFFFFFFF) col.inactive_border = rgba(FF000000) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 0 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = false size = 3 passes = 1 vibrancy = 0.1696 } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.2, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_is_master = true } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. accel_profile = flat force_no_accel = 1 touchpad { natural_scroll = false } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod, R, exec, $menu # bind = $mainMod, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy bind = $mainMod, V, togglefloating, bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. bind = , PRINT, exec, hyprshot -m window --clipboard-only # Screenshot a window bind = $mainMod, PRINT, exec, hyprshot -m output --clipboard-only # Screenshot a monitor bind = $mainMod $shiftMod, PRINT, exec, hyprshot -m region --clipboard-only # Screenshot a region ======Config-End======== ```
vaxerski commented 4 months ago

check coredumpctl, sometimes the crash report fails generating.

[ERR] [LinuxDMABUF] FIXME: surface feedback stub isn't a big deal.

iamtimmy commented 4 months ago

Thank you! Checking coredumpctl tells me that on all occasions today, the exit signal was SIGABRT. I'm new to Linux so I'll have to quickly learn how to extract additional information from this tool. (Wish windows had something similar to this now)

vaxerski commented 4 months ago

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

iamtimmy commented 4 months ago

@vaxerski Thank you for your help.

This is from a release build:

#0  0x000073c2ca2a2efc in __pthread_kill_implementation () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#1  0x000073c2ca252e86 in raise () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#2  0x000073c2ca23b935 in abort () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#3  0x000000000063296a in exit_with_error(char const*) ()
No symbol table info available.
#4  0x0000000000632871 in CrashReporter::createAndSaveCrash(int) ()
No symbol table info available.
#5  0x00000000005b2c1f in handleUnrecoverableSignal(int) ()
No symbol table info available.
#6  <signal handler called>
No symbol table info available.
#7  0x000073c2ca2a2efc in __pthread_kill_implementation () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#8  0x000073c2ca252e86 in raise () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#9  0x000073c2ca23b935 in abort () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#10 0x000073c2ca23c7e6 in __libc_message_impl.cold () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#11 0x000073c2ca328979 in __fortify_fail () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#12 0x000073c2ca328472 in __fdelt_warn () from /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/libc.so.6
No symbol table info available.
#13 0x0000000000647670 in hyprCtlFDTick(int, unsigned int, void*) ()
No symbol table info available.
#14 0x000073c2caf5b8f2 in wl_event_loop_dispatch () from /nix/store/7rnc20sb0h5zxqm5vims6mvi6gr3iy27-wayland-1.22.0/lib/libwayland-server.so.0
No symbol table info available.
#15 0x000073c2caf59455 in wl_display_run () from /nix/store/7rnc20sb0h5zxqm5vims6mvi6gr3iy27-wayland-1.22.0/lib/libwayland-server.so.0
No symbol table info available.
#16 0x0000000000759251 in CEventLoopManager::enterLoop(wl_display*, wl_event_loop*) ()
No symbol table info available.
#17 0x000000000057633d in main ()
No symbol table info available.
vaxerski commented 4 months ago

that looks unrelated and odd.

iamtimmy commented 4 months ago

I see. I apologize for crashing the Issue then, how should I proceed? I'm editing my config so it builds a debug version of Hyprland. Should I create a new issue?

vaxerski commented 4 months ago

I've seen this issue somewhere else, but nobody's ever been able to reproduce it. Maybe a make asan would shed some light: https://wiki.hyprland.org/Crashes-and-Bugs/#building-the-wayland-stack-with-asan

At any rate, yes, it's a different issue so a separate ticket should be opened

jbeich commented 4 months ago

After creating a separate issue maybe also hide your own comments here as "offtopic" per https://docs.github.com/en/communities/moderating-comments-and-conversations/managing-disruptive-comments