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
20.71k stars 874 forks source link

Hang in `xwayland_surface_handle_addon_destroy` #4592

Open russelltg opened 8 months ago

russelltg commented 8 months ago

Hyprland Version

System/Version info ```sh git 7447be822080fac5b8515a177773ec74b4d6c925 ```

Bug or Regression?

Bug

Description

Hyprland froze

How to reproduce

Run https://github.com/dnut/clipboard-sync and spam copy a bunch of stuff. Don't have exact instructions....

Crash reports, logs, images, videos

It gets stuck in

(gdb) bt
#0  0x00007aa0edaa74ae in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x52a00007f358) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x52a00007f358, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true)
    at futex-internal.c:87
#2  0x00007aa0edaa752f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x52a00007f358, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0)
    at futex-internal.c:139
#3  0x00007aa0edaa9d40 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x52a00007e218, cond=0x52a00007f330) at pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x52a00007f330, mutex=mutex@entry=0x52a00007e218) at pthread_cond_wait.c:618
#5  0x00007aa0ee9d743c in prepare_socket_request (c=0x52a00007e200) at /usr/src/debug/libxcb/libxcb-1.16/src/xcb_out.c:133
#6  send_fds (num_fds=0, fds=0x0, c=0x52a00007e200) at /usr/src/debug/libxcb/libxcb-1.16/src/xcb_out.c:200
#7  xcb_send_request_with_fds64 (c=0x52a00007e200, flags=flags@entry=0, vector=vector@entry=0x7ffdf257f9e0, req=req@entry=0x7aa0ee9e4340 <xcb_req>, num_fds=num_fds@entry=0, fds=fds@entry=0x0)
    at /usr/src/debug/libxcb/libxcb-1.16/src/xcb_out.c:320
#8  0x00007aa0ee9d7a80 in xcb_send_request64 (c=<optimized out>, flags=flags@entry=0, vector=vector@entry=0x7ffdf257f9e0, req=req@entry=0x7aa0ee9e4340 <xcb_req>) at /usr/src/debug/libxcb/libxcb-1.16/src/xcb_out.c:353
#9  0x00007aa0ee9d7a8e in xcb_send_request (c=<optimized out>, flags=flags@entry=0, vector=vector@entry=0x7ffdf257f9e0, req=req@entry=0x7aa0ee9e4340 <xcb_req>) at /usr/src/debug/libxcb/libxcb-1.16/src/xcb_out.c:359
#10 0x00007aa0ee9d94d7 in xcb_change_property (c=<optimized out>, mode=<optimized out>, window=<optimized out>, property=<optimized out>, type=<optimized out>, format=<optimized out>, data_len=1, data=0x502000623f50)
    at /usr/src/debug/libxcb/libxcb-1.16/src/xproto.c:3499
#11 0x00007aa0ee80ddd3 in xwm_set_net_client_list_stacking (xwm=0x5190000f5f80) at ../xwayland/xwm.c:327
#12 0x00007aa0ee80ef65 in xwayland_surface_dissociate (xsurface=0x51700005ef80) at ../xwayland/xwm.c:459
#13 0x00007aa0ee811d34 in xwayland_surface_handle_addon_destroy (addon=0x51700005efd8) at ../xwayland/xwm.c:891
#14 0x00007aa0ee7eacf9 in wlr_addon_set_finish (set=0x519000120ad0) at ../util/addon.c:18
#15 0x00007aa0ee78ab73 in surface_handle_resource_destroy (resource=0x50c00045a300) at ../types/wlr_compositor.c:730
#16 0x00007aa0ee9b89ba in destroy_resource (element=0x50c00045a300, data=data@entry=0x7ffdf257fba4, flags=0) at ../wayland-1.22.0/src/wayland-server.c:732
#17 0x00007aa0ee9b90db in for_each_helper (entries=0x5110001204f0, data=0x7ffdf257fba4, func=0x7aa0ee9b8900 <destroy_resource>) at ../wayland-1.22.0/src/wayland-util.c:416
#18 wl_map_for_each (data=0x7ffdf257fba4, func=0x7aa0ee9b8900 <destroy_resource>, map=0x5110001204f0) at ../wayland-1.22.0/src/wayland-util.c:430
#19 wl_client_destroy (client=0x5110001204c0) at ../wayland-1.22.0/src/wayland-server.c:928
#20 0x00007aa0ee9b960e in destroy_client_with_error (reason=<optimized out>, client=<optimized out>) at ../wayland-1.22.0/src/wayland-server.c:325
#21 wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../wayland-1.22.0/src/wayland-server.c:454
#22 0x00007aa0ee9b8ae2 in wl_event_loop_dispatch (loop=0x50d000000450, timeout=timeout@entry=-1) at ../wayland-1.22.0/src/event-loop.c:1027
#23 0x00007aa0ee9b92d7 in wl_display_run (display=0x511000001440) at ../wayland-1.22.0/src/wayland-server.c:1493
#24 0x00005db39d92d8f5 in CCompositor::startCompositor (this=0x518000000480) at /home/russell/Hyprland/src/Compositor.cpp:611
#25 0x00005db39dd979dc in main (argc=3, argv=0x7ffdf25809d8) at /home/russell/Hyprland/src/main.cpp:111
(gdb) f 10
#10 0x00007aa0ee9d94d7 in xcb_change_property (c=<optimized out>, mode=<optimized out>, window=<optimized out>, property=<optimized out>, type=<optimized out>, format=<optimized out>, data_len=1, data=0x502000623f50)
    at /usr/src/debug/libxcb/libxcb-1.16/src/xproto.c:3499
Downloading source file /usr/src/debug/libxcb/libxcb-1.16/src/xproto.c
3499        xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);                                                                                                                                                    
(gdb) l
3494        xcb_parts[4].iov_base = (char *) data;
3495        xcb_parts[4].iov_len = ((data_len * format) / 8) * sizeof(char);
3496        xcb_parts[5].iov_base = 0;
3497        xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3;
3498
3499        xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
3500        return xcb_ret;
3501    }
3502
3503    void *
(gdb) b 3500
Breakpoint 1 at 0x7aa0ee9d94d7: file /usr/src/debug/libxcb/libxcb-1.16/src/xproto.c, line 3500.                                                                                                                                    
(gdb) c
* continues to hang forever*

It's not making any progress, shown by setting that breakpoint above.

vaxerski commented 8 months ago

Could be https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2502

edit: also apparently it's a hang we can't do much about as it's a thing with xcb and xwayland. Likely your xwayland died.

russelltg commented 8 months ago

Thanks for the info--if this happens again I'll see what XWayland is stuck at and report it there--I don't have any XWayland crashes on my system.