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.65k stars 903 forks source link

When attempting to share a window via getUserMedia, Hyprland crashes #4062

Closed freddiehaddad closed 11 months ago

freddiehaddad commented 11 months ago

Hyprland Version

Hyprland, built from branch HEAD at commit 3bb9c7c5cf4f2ee30bf821501499f2308d616f94 (props: bump ver to 0.33.0).

Bug or Regression?

Bug

Description

Hyprland crashed when attempting to share a single window via: https://mozilla.github.io/webrtc-landing/gum_test.html. Full screen share works.

How to reproduce

  1. Go to https://mozilla.github.io/webrtc-landing/gum_test.html
  2. Click Screen capture
  3. Click Allow
  4. In the popup select the Window tab
  5. Pick any open window (in my case it was the terminal (alacritty))

Hyprland crashes.

I followed the guide: https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/

extra/qt5-wayland 5.15.11+kde+r60-1 (qt5) [installed]
extra/qt6-wayland 6.6.1-1 (qt6) [installed]
extra/xdg-desktop-portal 1.18.2-1 [installed]
extra/xdg-desktop-portal-hyprland 1.2.5-1 [installed]
extra/xdg-desktop-portal-gtk 1.15.1-1 [installed]

extra/xdg-desktop-portal-dde 1.0.5-5 (deepin)
extra/xdg-desktop-portal-gnome 45.1-1 (gnome)
extra/xdg-desktop-portal-kde 5.27.9-1 (plasma)
extra/xdg-desktop-portal-lxqt 0.5.0-1 (lxqt)
extra/xdg-desktop-portal-wlr 0.7.0-2
extra/xdg-desktop-portal-xapp 1.0.4-1

Crash reports, logs, images, videos

Core was generated by `Hyprland'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /usr/src/debug/glibc/glibc/nptl/pthread_kill.c
44        return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
[Current thread is 1 (Thread 0x7f55fc3489c0 (LWP 684))]
(gdb) bt -full
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {0}}
        ret = <optimized out>
#1  0x00007f55fd1bf8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f55fd16f668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007f55fd1574b8 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {0, 0, 0, 0, 8, 140724723245656, 140007300369696, 0, 0, 140724723245352, 140007300368192, 140007300368080, 140007300368096, 0, 14346015534153496320, 0}}, sa_flags = 11, sa_restorer = 0x0}
#4  0x00005607d9a01e5d in handleUnrecoverableSignal(int) (sig=11) at /usr/src/debug/hyprland/Hyprland-0.33.0/src/Compositor.cpp:34
#5  0x00007f55fd16f710 in <signal handler called> () at /usr/lib/libc.so.6
#6  drmFormatToGL(unsigned int) (drm=Python Exception <class 'gdb.MemoryError'>: Cannot access memory at address 0x2bc
#7  CHyprOpenGLImpl::getPreferredReadFormat(CMonitor*) (this=0x5607dc68b590, pMonitor=0x0) at /usr/src/debug/hyprland/Hyprland-0.33.0/src/render/OpenGL.cpp:2177
        glf = 0
        glt = 0
        as = 0
#8  0x00005607d9b1efd8 in CToplevelExportProtocolManager::captureToplevel(wl_client*, wl_resource*, unsigned int, int, CWindow*) (this=0x5607dc63e6a0, client=<optimized out>, resource=0x5607dccaa660, frame=3, overlay_cursor=1, pWindow=0x5607dcc84d60) at /usr/src/debug/hyprland/Hyprland-0.33.0/src/protocols/ToplevelExport.cpp:181
        PCLIENT = <optimized out>
        PFRAME = 0x5607dcd2a6d0
        PMONITOR = 0x5607dca07060
        PSHMINFO = <optimized out>
        ow = 0
        oh = -594328560
#9  0x00007f55fccf24f6 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#10 0x00007f55fcceef5e in ffi_call_int (cif=cif@entry=0x7ffd0723f2d0, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
        classes = {X86_64_INTEGER_CLASS, 32765, 4241413820, 32597}
        stack = <optimized out>
        argp = 0x7ffd0723f120 ""
        arg_types = <optimized out>
        gprcount = 5
        ssecount = <optimized out>
        ngpr = 1
        nsse = 0
        i = <optimized out>
        avn = <optimized out>
        flags = <optimized out>
        reg_args = <optimized out>
#11 0x00007f55fccf1b73 in ffi_call (cif=cif@entry=0x7ffd0723f2d0, fn=<optimized out>, rvalue=rvalue@entry=0x0, avalue=avalue@entry=0x7ffd0723f3a0) at ../src/x86/ffi64.c:710
        arg_types = 0x7ffd0723f2f0
        i = <optimized out>
        nargs = 5
        max_reg_struct_size = <optimized out>
#12 0x00007f55fda92ada in wl_closure_invoke (closure=closure@entry=0x5607dcca7240, target=<optimized out>, target@entry=0x5607dccaa660, opcode=opcode@entry=2, data=<optimized out>, data@entry=0x5607dccaa100, flags=2) at ../wayland-1.22.0/src/connection.c:1025
        count = <optimized out>
        cif = {abi = FFI_UNIX64, nargs = 5, arg_types = 0x7ffd0723f2f0, rtype = 0x7f55fccf31a0 <ffi_type_void>, bytes = 0, flags = 0}
        ffi_types = {0x7f55fccf32a0 <ffi_type_pointer>, 0x7f55fccf32a0 <ffi_type_pointer>, 0x7f55fccf3240 <ffi_type_uint32>, 0x7f55fccf3330 <ffi_type_sint32>, 0x7f55fccf32a0 <ffi_type_pointer>, 0x401c000000000000, 0x401c000000000000, 0x5607d9a703c4 <std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SConfigValue>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, SConfigValue> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+180>, 0x14, 0x5607dbc7fda0, 0xfffffffffffffd18, 0xb, 0x5607dccb2a90, 0x7f55fd1ce353 <__GI___libc_free+115>, 0x5607dbc7fca0, 0x5607dccb2a90, 0x1, 0x5607dcc9b5b0, 0x7ffd0723f5e0, 0x7ffd0723f5df, 0x5607d9ca6030 <g_pHookSystem>, 0x7f55fd2066dd <__GI___clock_gettime+29>}
        ffi_args = {0x7ffd0723f2b0, 0x7ffd0723f2b8, 0x5607dcca7258, 0x5607dcca7260, 0x5607dcca7268, 0xc717491eaf747700, 0x5607dccf6178, 0x5607d9b17d21 <CScreencopyClient::onTick()+49>, 0x5607d9ca5fc8 <g_pHyprRenderer>, 0x7f55fda94531 <log_closure+81>, 0x5607dcd6acc0, 0x5607dbc7c060, 0x7f55fd309ac0 <main_arena>, 0x3, 0x0, 0x7f55fd1ced08 <__libc_calloc+216>, 0x7ffd3cea0ea1, 0x1, 0x5607d9b738bb, 0x5607d9bd1e50 <hyprland_toplevel_export_manager_v1_requests+48>, 0x0, 0x14}
        implementation = <optimized out>
#13 0x00007f55fda97180 in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=<optimized out>) at ../wayland-1.22.0/src/wayland-server.c:438
        client = <optimized out>
        connection = <optimized out>
        resource = 0x5607dccaa660
        object = 0x5607dccaa660
        closure = <optimized out>
        message = 0x5607d9bd1e50 <hyprland_toplevel_export_manager_v1_requests+48>
        p = {8, 1310722}
        resource_flags = 0
        opcode = 2
        size = <optimized out>
        since = <optimized out>
        len = <optimized out>
#14 0x00007f55fda95ae2 in wl_event_loop_dispatch (loop=0x5607dbc7c150, timeout=timeout@entry=-1) at ../wayland-1.22.0/src/event-loop.c:1027
        ep = {{events = 1, data = {ptr = 0x5607dccb4530, fd = -590658256, u32 = 3704309040, u64 = 94591769068848}}, {events = 1, data = {ptr = 0x5607dbc7c198, fd = -607665768, u32 = 3687301528, u64 = 94591752061336}}, {events = 2943645440, data = {ptr = 0x5607c717491e, fd = -954775266, u32 = 3340192030, u64 = 94591404951838}}, {events = 1, data = {ptr = 0x18, fd = 24, u32 = 24, u64 = 24}}, {events = 3704078976, data = {ptr = 0x723f72000005607, fd = 22023, u32 = 22023, u64 = 5--Type <RET> for more, q to quit, c to continue without paging--c
14526499261404679}}, {events = 32765, data = {ptr = 0x5607dcc7f298, fd = -590876008, u32 = 3704091288, u64 = 94591768851096}}, {events = 3704083080, data = {ptr = 0x723f76000005607, fd = 22023, u32 = 22023, u64 = 514526774139311623}}, {events = 32765, data = {ptr = 0x7f55fda92500 <wl_connection_flush+304>, fd = -39246592, u32 = 4255720704, u64 = 140007304668416}}, {events = 4251420336, data = {ptr = 0x1800007f55, fd = 32597, u32 = 32597, u64 = 103079247701}}, {events = 0, data = {ptr = 0x7ffd0723f780, fd = 119797632, u32 = 119797632, u64 = 140724723251072}}, {events = 0, data = {ptr = 0x4e910, fd = 321808, u32 = 321808, u64 = 321808}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 3704085400, data = {ptr = 0x1800005607, fd = 22023, u32 = 22023, u64 = 103079237127}}, {events = 0, data = {ptr = 0x5607dcc7d288, fd = -590884216, u32 = 3704083080, u64 = 94591768842888}}, {events = 20, data = {ptr = 0x1400000000, fd = 0, u32 = 0, u64 = 85899345920}}, {events = 0, data = {ptr = 0x100000001, fd = 1, u32 = 1, u64 = 4294967297}}, {events = 117, data = {ptr = 0x7a, fd = 122, u32 = 122, u64 = 122}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 0, data = {ptr = 0x8, fd = 8, u32 = 8, u64 = 8}}, {events = 119797608, data = {ptr = 0xfd678d2000007ffd, fd = 32765, u32 = 32765, u64 = 18259718382775468029}}, {events = 32597, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}, {events = 2943645440, data = {ptr = 0x723f638c717491e, fd = -954775266, u32 = 3340192030, u64 = 514525506169162014}}, {events = 32765, data = {ptr = 0x5607dccb7590, fd = -590645872, u32 = 3704321424, u64 = 94591769081232}}}
        source = <optimized out>
        i = 0
        count = <optimized out>
        has_timers = <optimized out>
#15 0x00007f55fda962d7 in wl_display_run (display=0x5607dbc7c060) at ../wayland-1.22.0/src/wayland-server.c:1493
#16 0x00005607d9a03f9c in CCompositor::startCompositor() (this=<optimized out>) at /usr/src/debug/hyprland/Hyprland-0.33.0/src/Compositor.cpp:553
#17 0x00005607d99eb067 in main(int, char**) (argc=<optimized out>, argv=0x7ffd0723fe58) at /usr/include/c++/13.2.1/bits/unique_ptr.h:199
        cmd = "Hyprland"
        configPath = ""
        ignoreSudo = <optimized out>
        args = std::vector of length 0, capacity 0
freddiehaddad commented 11 months ago

Looks like the error is here:

#6  drmFormatToGL(unsigned int) (drm=Python Exception <class 'gdb.MemoryError'>: Cannot access memory at address 0x2bc
Ghosthree3 commented 11 months ago

Probably this, https://github.com/hyprwm/Hyprland/issues/4043 Which was fixed one commit after the 0.33.0 release, https://github.com/hyprwm/Hyprland/commit/83248b6936c00ddef6a39fa31a37949ca1a34ffe

freddiehaddad commented 11 months ago

I'll try to build/install from AUR and grab latest git.. TY!

freddiehaddad commented 11 months ago

Confirmed. That commit fixed it!