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.23k stars 895 forks source link

Xwayland rootful crashes when receiving mouse input #3139

Open burein-ita opened 1 year ago

burein-ita commented 1 year ago

Hyprland Version

Hyprland, built from branch main at commit f69c5469d79f31f77f4662731ac6255e285febed dirty (readme: refactor and update a bit). Tag: v0.29.0-21-gf69c5469 flags: (if any)

Bug or Regression?

Bug

Description

Running Xwayland rootful crashes with the following logs when the mouse moves within the window.

Xwayland:

XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool
(EE) failed to dispatch Wayland events: Invalid argument
X connection to :3 broken (explicit kill or server shutdown).

Hyprland:

New XDG Surface created. (class: org.freedesktop.Xwayland)
Registered signal for owner 5595769bd3a0: 559576962c20 -> 5595769bd420 (owner: XDG Window)
Registered signal for owner 5595769bd3a0: 559576962d90 -> 00:12:04.672 [INFO] [wayland] file descriptor expected, object (4), message create_pool(nhi)
00:12:04.672 [INFO] [wayland] error in client communication (pid 5964)
00:12:04.674 [ERROR] [render/allocator/gbm.c:50] gbm_bo_get_fd_for_plane failed
00:12:04.674 [ERROR] [render/swapchain.c:110] Failed to allocate buffer

Any GTK app that i tested triggers the crash. Xterm for some reason doesn't.

How to reproduce

> Run Xwayland -decorate -noreset :3 > Run a X11 window manager. Tested i3 and openbox. > Run any GTK app inside Xwayland > Crash > why

Crash reports, logs, images, videos

No response

burein-ita commented 1 year ago

With some more testing:

Xwayland only crashes immediately if I start a window manager inside of it, without one, GTK apps don't make it crash.

However, opening an LSP plugin window inside of reaper still makes Xwayland crash with the same error messages.

Taking this into account, running reaper rootless doesn't crash, unless, I open and LSP plugin window.

burein-ita commented 1 year ago

This Xwayland setup works on sway-git and labwc. I blame hypr-chan.

vaxerski commented 1 year ago

I blame hypr-chan.

go fuck yourself.

victornor commented 1 year ago

xwayland crashes only happens in hyprland, not in wayland plasma or wayfire.

vaxerski commented 1 year ago

have you tested sway-git?

victornor commented 1 year ago

I'll test sway-git, have not tested it yet.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Vaxry @.> Sent: Monday, September 4, 2023 1:43:50 PM To: hyprwm/Hyprland @.> Cc: victornor @.>; Comment @.> Subject: Re: [hyprwm/Hyprland] Xwayland rootful crashes when receiving mouse input (Issue #3139)

have you tested sway-git?

— Reply to this email directly, view it on GitHubhttps://github.com/hyprwm/Hyprland/issues/3139#issuecomment-1705123895, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6HMB4VO6AOBZAWONJBE7DXYW5HNANCNFSM6AAAAAA4IGSBTA. You are receiving this because you commented.Message ID: @.***>

burein-ita commented 1 year ago

sway-git works

burein-ita commented 11 months ago

Yo @vaxerski . I think i narrowed down the problem. I was using an animated cursor theme which possibly triggered an old Wayland bug:

retro_glitch.tar.gz (attached just in case you are curious)

The bug:

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

This is how Sway and Guhnome "fixed it":

https://github.com/swaywm/sway/pull/6629 https://gitlab.gnome.org/GNOME/mutter/-/merge_rvequests/2235

Changing the cursor theme to a non animated one prevents the bug from ruining my day.

vaxerski commented 11 months ago

patch.txt

try this then

burein-ita commented 11 months ago

Works, however now hyprland as a whole crashes only if waybar is running and a window event happens i.e. changing workspaces, floating.

vaxerski commented 11 months ago

crash report where????

burein-ita commented 11 months ago

in ass:

hyprlandCrashReport21540.txt

burein-ita commented 11 months ago

I've found 2 side effects of this patch:

The startup zoom-in animation it's broken. Dolphin starts as a small window surrounded by transparent borders and then it fills the entire tile.

vaxerski commented 11 months ago

the patch... is not related to this I believe

0x42697262 commented 10 months ago
XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool
(EE) failed to dispatch Wayland events: Invalid argument

(process:43278): X11Helper-WARNING **: 02:59:27.917: Connection has error

Steps to reproduce is quite a hassle. However, one thing I have noticed is when Godot or Obsidian is open. But the crash is not random. So far, my feeling of what triggers the crash is when I switch to TTY2 (SDDM) and back to TTY1 (where Hyprland is running). But it's not a guaranteed crash. I have to keep switching and clicking inside sddm to crash xwayland.

I am also using an animated cursor btw.

The current crash log doesn't help somehow but hopefully someone's insights might help.

Update:

It crashed on its own without doing the steps above. Here's the SDDM log since journalctl is xorg's logs are useless and doesn't provide any logs. (unless maybe compiled on debug)

[341 03:28:47.133084] Ignoring unknown config key: open_url_modifiers
[341 03:28:47.133187] Ignoring unknown config key: rectangle_select_modifiers
[341 03:28:47.133209] Ignoring unknown config key: terminal_select_modifiers
[341 03:28:47.133499] Ignoring unknown config key: resize_draw_strategy
[341 03:28:47.269428] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.UnknownMethod] No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
[45914:1207/032847.582346:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
XWAYLAND: wl_display@1: error 1: invalid arguments for wl_shm@4.create_pool
(EE) failed to dispatch Wayland events: Invalid argument
X connection to :1 broken (explicit kill or server shutdown).
ERROR: BUG: Unreferenced static string to 0: _update_scrollbars
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: thread_end
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: @export_enum
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @export_flags
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @export_placeholder
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @export
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @export_multiline
   at: unref (core/string/string_name.cpp:131)

(process:51722): X11Helper-WARNING **: 04:37:11.045: Connection has error
ERROR: BUG: Unreferenced static string to 0: @export_range
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @warning_ignore
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @export_category
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: @icon
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: _update_script_names
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: PrevScene
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: GuiToggleOnDisabledMirrored
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: raise
   at: unref (core/string/string_name.cpp:129)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketLargeE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools12BucketMediumE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: Pages in use exist at exit in PagedAllocator: N7Variant5Pools11BucketSmallE
   at: ~PagedAllocator (./core/templates/paged_allocator.h:170)
ERROR: BUG: Unreferenced static string to 0: picker_created
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: process_frame
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: physics_frame
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: interface_added
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: property_can_revert_changed
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: joy_connection_changed
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: fallback_changed
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: frame_pre_draw
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: frame_post_draw
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: editor_script_changed
   at: unref (core/string/string_name.cpp:131)
ERROR: BUG: Unreferenced static string to 0: settings_changed
   at: unref (core/string/string_name.cpp:131)
Terminated

This just happened suddenly when I ran rofi (x11 version). As for my GPU, everything runs on amd igpu while only sddm is running at nvidia dgpu.

izmyname commented 1 month ago

Is this still a thing after xwayland rewrite?