glimagesink: segfault on WSL2 if rendering into QWidget
Describe your issue
glimagesink causes a segfault if rendering into a QWidget window on Ubuntu 22.04.2 LTS in WSL2 on Win 11 host. ximagesink works without any issue.
To reproduce the issue it is sufficient to run the example code from GstVideoOverlay docu page, but exchange xvimagesink by glimagesink: https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c#gstvideooverlay-and-qt
If i run the following test pipeline on the commandline i do NOT run into a segfault, but i do not have window decorations (not part of this ticket)
gst-launch-1.0 -v videotestsrc ! video/x-raw ! glimagesink
Expected Behavior
glimagesink renders into QWidget without segfault on WSL2
Setup
- Win 11 host
- Ubuntu 22.04.2 LTS on WSL2
- GStreamer Version: 1.22.4 (build from source)
- Qt 5.15
WSL setup:
- WSL version: 1.2.5.0
- Kernel version: 5.15.90.1
- WSLg version: 1.0.51
- MSRDC version: 1.2.3770
- Direct3D version: 1.608.2-61064218
- DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
- Windows version: 10.0.22621.1848
GDB back trace
Thread 9 "gstglcontext" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffda7f9640 (LWP 2684)]
0x00007ffff1f55571 in wl_proxy_marshal_array_flags () from /lib/x86_64-linux-gnu/libwayland-client.so.0
(gdb) bt full
#0 0x00007ffff1f55571 in wl_proxy_marshal_array_flags () at /lib/x86_64-linux-gnu/libwayland-client.so.0
#1 0x00007ffff1f55c7f in wl_proxy_marshal_flags () at /lib/x86_64-linux-gnu/libwayland-client.so.0
#2 0x00007ffff207cb48 in wl_subcompositor_get_subsurface
(parent=0x600006, surface=0x7fffc40a30c0, wl_subcompositor=0x7fffc4002500)
at /usr/include/wayland-client-protocol.h:5849
id = <optimized out>
width = <optimized out>
height = <optimized out>
__func__ = "create_surfaces"
#3 create_surfaces (window_egl=0x555555b10310)
at ../subprojects/gst-plugins-base/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c:358
width = <optimized out>
height = <optimized out>
__func__ = "create_surfaces"
#4 0x00007ffff2074c98 in _set_window_handle_cb (data=0x5555558e9d00)
at ../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglwindow.c:399
context = 0x555555c9d0b0
window_class = 0x555555656380
thread = 0x555555aff000
__func__ = "_set_window_handle_cb"
#5 0x00007ffff2073ac6 in _run_message_async (message=0x5555558d66c0)
at ../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglwindow.c:702
#6 0x00007ffff5edec44 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff5f34258 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff5ede2b3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff20540d0 in gst_gl_context_create_thread (context=0x555555c9d0b0)
at ../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c:1401
context_class = 0x5555558d4f40
window_class = 0x555555656380
Steps to reproduce the bug
Compile and run the demo code, segfault will happen immediately.
How reproducible is the bug?
Issue is reproducible, happens each run
Log file
- glimagesinkCrashFull.log.xz -> full gstreamer log GST_DEBUG=6
- glimagesinkCrash_lvl4.log.xz -> gstreamer log GST_DEBUG=4 (level 3 and below results in an empty log file)
Files: glimagesinkCrashFull.log.xz glimagesinkCrash_lvl4.log.xz