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 749284 - glimagesink crash on windows
glimagesink crash on windows
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: High critical
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-12 21:37 UTC by Nicola
Modified: 2015-05-22 07:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
trace (13.85 KB, text/plain)
2015-05-13 07:44 UTC, Nicola
Details
debug logs (34.48 KB, text/plain)
2015-05-13 10:20 UTC, Nicola
Details
debug logs on real hardware (11.83 KB, text/plain)
2015-05-14 09:32 UTC, Nicola
Details

Description Nicola 2015-05-12 21:37:14 UTC
gst-launch-1.0 videotestsrc ! glimagesink 

crash on windows, tested with both 1.4 and git master daily build downloaded from here:

http://gstreamer.zeranoe.com/builds/win32/2015.05.12/
Comment 1 Sebastian Dröge (slomo) 2015-05-13 07:21:42 UTC
Thanks for taking the time to report this.
This bug report isn't very useful because it doesn't describe the bug well. If you have time and can still reproduce the bug, please read https://bugzilla.gnome.org/page.cgi?id=bug-writing.html and add a description of how to reproduce this bug.

You'll also need to add a stack trace; please see https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces for more information about how to do so. When providing a better description and pasting a stack trace, please reset the status of this bug report from NEEDINFO to its previous status. Thanks in advance!
Comment 2 Nicola 2015-05-13 07:44:16 UTC
Created attachment 303290 [details]
trace

Sorry for not posting the trace, however is simple to reproduce as launch the test pipeline on windows, tested in a virtualbox vm and on a real hardware (intel graphics).

The attached trace is from virtualbox and gstreamer daily build
Comment 3 Matthew Waters (ystreet00) 2015-05-13 10:08:24 UTC
Right, so gstglmemory.c:401 is a gl->GenTextures call which presumably is set to NULL which means that the GL function table was not set up correctly on context creation.  Could you please attach the output of:

GST_DEBUG=gl*:7,default:7,3 gst-launch-1.0 videotestsrc ! glimagesink

(You can also pipe the output to a file with GST_DEBUG_FILE)
Comment 4 Nicola 2015-05-13 10:20:29 UTC
Created attachment 303299 [details]
debug logs

the last log is

Generating texture format:6408 type:5121 dimensions:320x240
Comment 5 Matthew Waters (ystreet00) 2015-05-13 10:37:02 UTC
0:00:00.616892386  2792   07D29298 INFO               glcontext gstglcontext.c:1111:_create_context_info:<glcontextwgl0> GL_VERSION: 1.1.0
0:00:00.617546806  2792   07D29298 INFO               glcontext gstglcontext.c:1114:_create_context_info:<glcontextwgl0> GL_SHADING_LANGUAGE_VERSION: (NULL)
0:00:00.617917956  2792   07D29298 INFO               glcontext gstglcontext.c:1116:_create_context_info:<glcontextwgl0> GL_VENDOR: Microsoft Corporation
0:00:00.618225969  2792   07D29298 INFO               glcontext gstglcontext.c:1118:_create_context_info:<glcontextwgl0> GL_RENDERER: GDI Generic

You're going to need a proper GL implementation rather than the default Microsoft's software GL implementation.

Although the GL version check (>= 1.4) should have caused a failure :/
Comment 6 Nicolas Dufresne (ndufresne) 2015-05-13 13:03:24 UTC
I confirm VirtualBox GL stack is not supported, we should fix our version check though. It extremely slow, but SW Mesa can let you run it at least (and is very easy to build).

Would it be possible to provides logs from the native installation ?
Comment 7 Nicola 2015-05-13 13:11:04 UTC
native installation has a different issue

D:\gstreamer\1.0\x86_64\bin>f:/gdb_64.exe --args gst-launch-1.0.exe videotestsrc ! glimagesink
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
This binary was built by Equation Solution <http://www.Equation.com>...
Reading symbols from gst-launch-1.0.exe...done.
(gdb) run
Starting program: D:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe videotestsrc "!" glimagesink
[New Thread 2892.0xdcc]
[New Thread 2892.0x1168]
[New Thread 2892.0xbc4]
[New Thread 2892.0xc64]
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'glimagesink0': gst.gl.GLDisplay=con[New Thread 2892.0xb94]
text, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplay\)\ gldisplay0";
[New Thread 2892.0x12c4]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2892.0xb94]
0x0000000062091ef1 in gst_gl_upload_perform_with_buffer (upload=0x2e113f0, buffer=0x2e29070, tex_id=0x2d60638) at gstglupload.c:275
275     gstglupload.c: No such file or directory.
(gdb) bt
  • #0 gst_gl_upload_perform_with_buffer
    at gstglupload.c line 275
  • #1 gst_glimage_sink_prepare
    at gstglimagesink.c line 759
  • #2 __fu912_GST_CAT_QOS
    at gstbasesink.c line 3375
  • #3 gst_base_sink_chain_main
    at gstbasesink.c line 3538
  • #4 gst_pad_chain_data_unchecked
    at gstpad.c line 3836
  • #5 gst_pad_push_data
    at gstpad.c line 4069
  • #6 gst_pad_push
    at gstpad.c line 4180
  • #7 gst_base_src_loop
    at gstbasesrc.c line 2835
  • #8 gst_task_func
    at gsttask.c line 317
  • #9 g_thread_pool_thread_proxy
    at gthreadpool.c line 307
  • #10 g_thread_proxy
    at gthread.c line 764
  • #11 g_thread_win32_proxy
    at gthread-win32.c line 450
  • #12 srand
    from C:\Windows\system32\msvcrt.dll
  • #13 msvcrt!_ftime64_s
    from C:\Windows\system32\msvcrt.dll
  • #14 KERNEL32!BaseThreadInitThunk
    from C:\Windows\system32\kernel32.dll
  • #15 ntdll!RtlUserThreadStart
    from C:\Windows\SYSTEM32\ntdll.dll
  • #16 ??


however it does not crash if I enable debug logs, it fail this way

D:\gstreamer\1.0\x86_64\bin>gst-launch-1.0.exe videotestsrc ! glimagesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'glimagesink0': gst.gl.GLDisplay=context, gst.gl.GLDisp
ERROR: from element /GstPipeline:pipeline0/GstGLImageSink:glimagesink0: glGetStr
Additional debug info:
gstglimagesink.c(458): _ensure_gl_setup (): /GstPipeline:pipeline0/GstGLImageSin
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

with log disabled it crash
Comment 8 Matthew Waters (ystreet00) 2015-05-13 14:00:55 UTC
Could you try again with the latest code.  The first crash should fail properly now.  Maybe the others as well.

commit 07dffe9e5b08e97fb4f2421f14cf05eab383c116
Author: Matthew Waters <matthew@centricular.com>
Date:   Wed May 13 23:55:28 2015 +1000

    glcontext: propagate the version/extension failure upwards
    
    Otherwise the calling code has no idea that the context failed to
    be created fully.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749284

commit 1853e455accb4fac1c5a2d5c8d9315615fcb5804
Author: Matthew Waters <matthew@centricular.com>
Date:   Wed May 13 23:54:52 2015 +1000

    gl: don't deadlock on context creation failure
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749284
Comment 9 Nicola 2015-05-14 09:19:35 UTC
thanks, in virtualbox I found the right settings and now it works (even the old version), on real hardware some progress but still crash, now popup a window before segfault, here is the trace


D:\gstreamer\1.0\x86_64\bin>F:\gdb_64.exe --args gst-launch-1.0.exe videotestsrc ! glimagesink
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
This binary was built by Equation Solution <http://www.Equation.com>...
Reading symbols from gst-launch-1.0.exe...done.
(gdb) run
Starting program: D:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe videotestsrc "!" glimagesink
[New Thread 2540.0x13d4]
[New Thread 2540.0xea8]
[New Thread 2540.0x1320]
Setting pipeline to PAUSED ...
[New Thread 2540.0x980]
[New Thread 2540.0x1360]
[New Thread 2540.0xfb4]
Pipeline is PREROLLING ...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplay\)\ gldisplay0";

** (gst-launch-1.0:2540): CRITICAL **: gst_gl_shader_get_attribute_location: assertion 'priv->program_handle != 0' failed

** (gst-launch-1.0:2540): CRITICAL **: gst_gl_shader_get_attribute_location: assertion 'priv->program_handle != 0' failed
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

** (gst-launch-1.0:2540): CRITICAL **: gst_gl_shader_use: assertion 'priv->program_handle' failed

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2540.0x1360]
0x0000000000000000 in ?? ()
(gdb) bt

Comment 10 Nicola 2015-05-14 09:29:07 UTC
if I enable debug log it not crash but the pipeline fails

D:\gstreamer\1.0\x86_64\bin>gst-launch-1.0.exe videotestsrc ! glimagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplay\)\ gldisplay0";
ERROR: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: glGetString error: 0x500
Additional debug info:
gstglimagesink.c(770): _ensure_gl_setup (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 11 Nicola 2015-05-14 09:32:59 UTC
Created attachment 303355 [details]
debug logs on real hardware

so on this hardware glimagesink will not work?
Comment 12 Matthew Waters (ystreet00) 2015-05-14 10:44:01 UTC
Ah, no. We require at least shaders which your hardware/driver does not seem to have (GL_SHADING_LANGUAGE_VERSION).  The current minimum target is GLES2 hardware with which shaders are available.
Comment 13 Nicola 2015-05-14 10:51:28 UTC
ok, the hardware has opengl 1.4, however if you want to fix the crash I can test
Comment 14 Matthew Waters (ystreet00) 2015-05-14 11:25:27 UTC
It's hard to tell from that backtrace but that crash might be fixed by

http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c6abd1632f430d0c3873be0ef5a82e4739d1e003
Comment 15 Nicola 2015-05-15 07:47:08 UTC
a bit better, now give the assertion

** (gst-launch-1.0:2540): CRITICAL **: gst_gl_shader_get_attribute_location: assertion 'priv->program_handle != 0' failed

open a window with nothing inside and crash when I try to close it, maybe it should exit earlier with a message such as "no compatible opengl version found" or something similar
Comment 16 Matthew Waters (ystreet00) 2015-05-21 05:08:36 UTC
Maybe this will fail properly for you :)

commit e9f0d0fb51e8d92b566868f8fa5db10c2eccc22f
Author: Matthew Waters <matthew@centricular.com>
Date:   Thu May 21 15:05:33 2015 +1000

    glcontext: require a shader version to initialize.
    
    It's very near pointless to try our GL implementation without shaders.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749284
Comment 17 Jan Schmidt 2015-05-21 05:59:27 UTC
This is the same crash I get if I run GstGL stuff in an RDP session, btw.
Comment 18 Nicola 2015-05-22 07:17:55 UTC
fixed on my hw, now fails with no crash, thanks