GNOME Bugzilla – Bug 750199
glimagesink: crashes in gst_gl_window_x11_set_window_handle()
Last modified: 2015-06-02 02:34:29 UTC
Since recent-ish master (since ~ 27th May) I get crashes at startup using any of the GL Gtk examples, trying to do X operations on a NULL Display. It looks like gst_gl_window_x11_set_window_handle() does X operations before gst_gl_window_x11_open() has happened. Program received signal SIGSEGV, Segmentation fault. XGetWindowAttributes (dpy=0x0, w=w@entry=33554445, attr=attr@entry=0x7fffffffa210) at GetWAttrs.c:148 148 LockDisplay(dpy); Missing separate debuginfos, use: dnf debuginfo-install at-spi2-atk-2.16.0-1.fc22.x86_64 at-spi2-core-2.16.0-1.fc22.x86_64 bzip2-libs-1.0.6-14.fc22.x86_64 dbus-libs-1.8.18-1.fc22.x86_64 elfutils-libelf-0.161-6.fc22.x86_64 elfutils-libs-0.161-6.fc22.x86_64 expat-2.1.0-10.fc22.x86_64 graphite2-1.2.4-3.fc22.x86_64 gtk3-3.16.3-1.fc22.x86_64 gvfs-1.24.1-1.fc22.x86_64 harfbuzz-0.9.40-1.fc22.x86_64 libattr-2.4.47-9.fc22.x86_64 libbluray-0.7.0-1.fc22.x86_64 libcanberra-0.30-7.fc22.x86_64 libcanberra-gtk3-0.30-7.fc22.x86_64 libcap-2.24-7.fc22.x86_64 libdrm-2.4.61-3.fc22.x86_64 libepoxy-1.2-1.fc22.x86_64 libffi-3.1-7.fc22.x86_64 libgcc-5.1.1-1.fc22.x86_64 libjpeg-turbo-1.4.0-1.fc22.x86_64 libogg-1.3.2-2.fc22.x86_64 libpng-1.6.16-3.fc22.x86_64 libselinux-2.3-10.fc22.x86_64 libstdc++-5.1.1-1.fc22.x86_64 libtdb-1.3.4-1.fc22.x86_64 libtool-ltdl-2.4.2-34.fc22.x86_64 libvorbis-1.3.4-3.fc22.x86_64 libwayland-client-1.7.0-1.fc22.x86_64 libwayland-cursor-1.7.0-1.fc22.x86_64 libwayland-server-1.7.0-1.fc22.x86_64 libXau-1.0.8-4.fc22.x86_64 libxcb-1.11-5.fc22.x86_64 libXcomposite-0.4.4-6.fc22.x86_64 libXcursor-1.1.14-4.fc22.x86_64 libXdamage-1.1.4-6.fc22.x86_64 libXfixes-5.0.1-4.fc22.x86_64 libXi-1.7.4-2.fc22.x86_64 libXinerama-1.1.3-4.fc22.x86_64 libxkbcommon-0.5.0-1.fc22.x86_64 libxml2-2.9.2-3.fc22.x86_64 libXrandr-1.4.2-2.fc22.x86_64 libXrender-0.9.9-1.fc22.x86_64 libxshmfence-1.2-1.fc22.x86_64 libXxf86vm-1.1.4-1.fc22.x86_64 nss-softokn-freebl-3.19.0-1.0.fc22.x86_64 PackageKit-gtk3-module-1.0.6-4.fc22.x86_64 pcre-8.37-1.fc22.x86_64 pixman-0.32.6-4.fc22.x86_64 systemd-libs-219-15.fc22.x86_64 xz-libs-5.2.0-2.fc22.x86_64 (gdb) bt
+ Trace 235110
diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index 4317d48..78b3fdc 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -316,6 +316,9 @@ gst_gl_window_x11_set_window_handle (GstGLWindow * window, guintptr id) window_x11->parent_win = (Window) id; + if (window_x11->device == NULL) + window_x11->device = XOpenDisplay (NULL); + XGetWindowAttributes (window_x11->device, window_x11->parent_win, &attr); XResizeWindow (window_x11->device, window_x11->internal_win_id, Is enough to make things run, without being anything like a correct fix.
Yea, so the problem is that commit c5f8c789a3b87c01529b9298c1940e2b08fe4c66 Author: Julien Isorce <j.isorce@samsung.com> Date: Wed May 27 14:10:16 2015 +0100 glwindow_x11: use parent default implementation broke commit bc7a7259f357b0065dd94e0668b5a895d83fa53a Author: Matthew Waters <matthew@centricular.com> Date: Fri Mar 6 15:31:18 2015 +1100 gl/window: create the main loop/context on init/finalize Avoids races setting the window handle from the main thread. https://bugzilla.gnome.org/show_bug.cgi?id=745633
Hi, sorry about that, I'll move loop/context to gstglwindow.c::init/finalize to preserve previous behavior. Unless you started to do it so let me know.
Go ahead :)
*** Bug 750209 has been marked as a duplicate of this bug. ***
commit d843b9e8c3119fe92a6a583860aa6f771cdc217c Author: Julien Isorce <j.isorce@samsung.com> Date: Mon Jun 1 12:58:11 2015 +0100 glwindow: move main loop/context creation back to init/finalize Fixes https://bugzilla.gnome.org/show_bug.cgi?id=750199 Please try with current master and let me know if something is still broken.
> Please try with current master and let me know if something is still broken. Looks good here :)