After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725819 - Segfault when using opengl elements in multiple pipelines
Segfault when using opengl elements in multiple pipelines
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
1.2.4
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-06 13:02 UTC by Adrien SCH.
Modified: 2015-02-12 12:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Adrien SCH. 2014-03-06 13:02:11 UTC
I'm trying to use some OpenGL element in multiple pipelines (differents GMainContext) in a process. In this case, I observed multiple segfault in XOpenDisplay, XCloseDisplay, gst_gl_shader_compile probably due to concurrent access (see the backtrace log). With my knowledge, Xlib isn't well know for this robustness in multiple threaded context, and it isn't possible to share the same display object between the pipelines (instanced by GstGLWindow_X11). 

As Matthew Waters said in the mailing, it should work.

Reproduction rate : 
Corruption with gst_gl_shader_compile, almost all the first time
Segmentation, 1/10 approx

Mailing reference : 
http://gstreamer-devel.966125.n4.nabble.com/OpenGL-Segfault-when-using-opengl-elements-in-multiple-pipelines-td4665772.html#a4665783

Environment : 
Arch linux with lastest version of gstreamer, mesa (10.1),  xf86-video-intel. 

Test application : 
http://pastebin.com/1RWud2Ns

Video sample used : 
http://www.auby.no/files/video_tests/h264_1080p_hp_4.1_10mbps_dts_unstyled_subs_monsters.mkv

Complete threads backtrace : 
http://pastebin.com/YbHNDJtj

Thread 1 : 
  • #0 raise
    from /usr/lib/libc.so.6
  • #1 abort
    from /usr/lib/libc.so.6
  • #2 __libc_message
    from /usr/lib/libc.so.6
  • #3 malloc_printerr
    from /usr/lib/libc.so.6
  • #4 _int_free
    from /usr/lib/libc.so.6
  • #5 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #6 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #7 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #8 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #9 ??
    from /usr/lib/libGL.so.1
  • #10 ??
    from /usr/lib/libGL.so.1
  • #11 ??
    from /usr/lib/libGL.so.1
  • #12 ??
    from /usr/lib/libGL.so.1
  • #13 XCloseDisplay
    from /usr/lib/libX11.so.6
  • #14 gst_gl_window_x11_close
    at gstglwindow_x11.c line 295
  • #15 gst_gl_context_create_thread
    at gstglcontext.c line 805
  • #16 ??
    from /usr/lib/libglib-2.0.so.0
  • #17 start_thread
    from /usr/lib/libpthread.so.0
  • #18 clone
    from /usr/lib/libc.so.6
  • #0 mmap64
    from /usr/lib/libc.so.6
  • #1 __assert_fail_base
    from /usr/lib/libc.so.6
  • #2 __assert_fail
    from /usr/lib/libc.so.6
  • #3 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #4 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #5 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #6 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #7 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #8 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #9 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #10 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #11 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #12 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #13 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #14 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #15 gst_gl_shader_compile
    at gstglshader.c line 429
  • #16 _create_shader
  • #17 _init_upload
    at gstglupload.c line 1102
  • #18 _run_message_sync
    at gstglwindow.c line 317
  • #19 _run_message
    at gstglwindow_x11.c line 620
  • #20 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #21 ??
    from /usr/lib/libglib-2.0.so.0
  • #22 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #23 gst_gl_context_create_thread
    at gstglcontext.c line 787
  • #24 ??
    from /usr/lib/libglib-2.0.so.0
  • #25 start_thread
    from /usr/lib/libpthread.so.0
  • #26 clone
    from /usr/lib/libc.so.6
  • #0 ioctl
    from /usr/lib/libc.so.6
  • #1 drmIoctl
    from /usr/lib/libdrm.so.2
  • #2 ??
    from /usr/lib/libdrm_intel.so.1
  • #3 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #4 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #5 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #6 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #7 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #8 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #9 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #10 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #11 _do_download_draw_yuv_opengl
    at gstgldownload.c line 1222
  • #12 _do_download
    at gstgldownload.c line 897
  • #13 _run_message_sync
    at gstglwindow.c line 317
  • #14 _run_message
    at gstglwindow_x11.c line 620
  • #15 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #16 ??
    from /usr/lib/libglib-2.0.so.0
  • #17 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #18 gst_gl_context_create_thread
    at gstglcontext.c line 787
  • #19 ??
    from /usr/lib/libglib-2.0.so.0
  • #20 start_thread
    from /usr/lib/libpthread.so.0
  • #21 clone
    from /usr/lib/libc.so.6
  • #0 ioctl
    from /usr/lib/libc.so.6
  • #1 drmIoctl
    from /usr/lib/libdrm.so.2
  • #2 ??
    from /usr/lib/libdrm_intel.so.1
  • #3 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #4 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #5 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #6 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #7 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #8 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #9 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #10 ??
    from /usr/lib/xorg/modules/dri/i965_dri.so
  • #11 _do_download_draw_yuv_opengl
    at gstgldownload.c line 1217
  • #12 _do_download
    at gstgldownload.c line 897
  • #13 _run_message_sync
    at gstglwindow.c line 317
  • #14 _run_message
    at gstglwindow_x11.c line 620
  • #15 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #16 ??
    from /usr/lib/libglib-2.0.so.0
  • #17 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #18 gst_gl_context_create_thread
    at gstglcontext.c line 787
  • #19 ??
    from /usr/lib/libglib-2.0.so.0
  • #20 start_thread
    from /usr/lib/libpthread.so.0
  • #21 clone
    from /usr/lib/libc.so.6

Valgrind log : 
Vaapi : http://pastebin.com/cwFnACcc significant ? 

OpenGL : http://pastebin.com/bWPLHqzS

I will try to add more informations about this bug in the following week.
Comment 1 Nicolas Dufresne (ndufresne) 2014-03-06 15:00:29 UTC
Is this a duplicate of ?

https://bugzilla.gnome.org/show_bug.cgi?id=725048
Comment 2 Adrien SCH. 2014-03-06 15:08:55 UTC
Nope, https://bugzilla.gnome.org/show_bug.cgi?id=725048 is about the reference to the display (which is fix now). This bug is completely independent.
Comment 3 Julien Isorce 2014-10-30 21:05:13 UTC
Is this duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=731525 ?