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 749604 - gst vaapi swap buffers in gl_destroy_context crash cogl (eg. totem that use both)
gst vaapi swap buffers in gl_destroy_context crash cogl (eg. totem that use b...
Status: RESOLVED OBSOLETE
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-05-19 22:16 UTC by Alban Browaeys
Modified: 2015-06-17 11:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Full sequence of events - gstreamer-vaapi gl_destroy_context use of gl swap breaks cogl (18.60 KB, text/plain)
2015-05-19 22:16 UTC, Alban Browaeys
Details

Description Alban Browaeys 2015-05-19 22:16:03 UTC
Created attachment 303627 [details]
Full sequence of events - gstreamer-vaapi gl_destroy_context use of gl swap breaks cogl

The hack to swpa buffers in gst-libs/gst/vaapi/gstvaapiutils_glx.c to swap the buffers as an nvidia bug workaround :
/* XXX: if buffers were never swapped, the application
 will crash later with the NVIDIA driver */
  if (!cs->swapped_buffers)
		**gl_swap_buffers (cs);**

confuse cogl internal state. cogl segfault in a dereference of info->presentation_time.
My current workaround is to comment this nvidia workaround (I am on intel graphics).


That is notify_swap_buffers  called via glx_event_filter_cb in ./winsys/cogl-winsys-glx.c peek the head of its onscreen->pending_frame_infos but it is left empty.


The gst vaapi gl swap add a GLX_BufferSwapComplete in dri2GetSwapEvent called by DRI2WireToEvent as shown in this backtrace:

  • #0 dri2GetSwapEventType
    at ../../../../src/glx/dri2_glx.c line 749
  • #1 DRI2WireToEvent
    at ../../../../src/glx/dri2.c line 108
  • #2 _XEnq
    at ../../src/XlibInt.c line 754
  • #3 handle_response
    at ../../src/xcb_io.c line 339
  • #4 _XReply
    at ../../src/xcb_io.c line 627
  • #5 XSync
    at ../../src/Sync.c line 44
  • #6 dri2SwapBuffers
    at ../../../../src/glx/dri2_glx.c line 815
  • #7 dri2SwapBuffers
    at ../../../../src/glx/dri2_glx.c line 853
  • #8 gl_destroy_context
    at gstvaapiutils_glx.c line 464
  • #9 gl_destroy_context
    at gstvaapiutils_glx.c line 394
  • #10 gst_vaapi_texture_glx_destroy
    at gstvaapitexture_glx.c line 101
  • #11 gst_vaapi_texture_glx_destroy
    at gstvaapitexture_glx.c line 111
  • #12 gst_vaapi_texture_glx_destroy
    at gstvaapitexture_glx.c line 124
  • #13 gst_vaapi_object_finalize
    at gstvaapiobject.c line 50
  • #14 gst_vaapi_mini_object_free
    at gstvaapiminiobject.c line 39
  • #15 gst_vaapi_mini_object_replace
    at gstvaapiminiobject.h line 203
  • #16 gst_vaapi_mini_object_replace
    at gstvaapiminiobject.c line 173
  • #17 gst_vaapi_texture_replace
    at gstvaapitexture.c line 200
  • #18 meta_texture_free
    at gstvaapivideometa_texture.c line 126
  • #19 _gst_buffer_free
    at gstbuffer.c line 595
  • #20 gst_buffer_pool_release_buffer
    at gstbufferpool.c line 1298
  • #21 _gst_buffer_dispose
    at gstbuffer.c line 572
  • #22 gst_mini_object_unref
    at gstminiobject.c line 446
  • #23 gst_base_sink_set_last_buffer_unlocked
    at ../../../gst/gstbuffer.h line 360
  • #24 gst_base_sink_set_last_buffer_unlocked
    at gstbasesink.c line 952
  • #25 gst_base_sink_set_last_buffer
    at gstbasesink.c line 964
  • #26 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3437
  • #27 gst_base_sink_chain_main
    at gstbasesink.c line 3557
  • #28 gst_pad_push_data
    at gstpad.c line 4038
  • #29 gst_pad_push_data
    at gstpad.c line 4271
  • #30 gst_pad_push
    at gstpad.c line 4383
  • #31 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #32 gst_pad_push_data
    at gstpad.c line 4038
  • #33 gst_pad_push_data
    at gstpad.c line 4271
  • #34 gst_base_transform_chain
    at gstbasetransform.c line 2281
  • #35 gst_pad_push_data
    at gstpad.c line 4038
  • #36 gst_pad_push_data
    at gstpad.c line 4271
  • #37 gst_base_transform_chain
    at gstbasetransform.c line 2281
  • #38 gst_pad_push_data
    at gstpad.c line 4038
  • #39 gst_pad_push_data
    at gstpad.c line 4271
  • #40 gst_base_transform_chain
    at gstbasetransform.c line 2281
  • #41 gst_pad_push_data
    at gstpad.c line 4038
  • #42 gst_pad_push_data
    at gstpad.c line 4271
  • #43 gst_base_transform_chain
    at gstbasetransform.c line 2281
  • #44 gst_pad_push_data
    at gstpad.c line 4038
  • #45 gst_pad_push_data
    at gstpad.c line 4271
  • #46 gst_pad_push
    at gstpad.c line 4383
  • #47 gst_proxy_pad_chain_default
    at gstghostpad.c line 126
  • #48 gst_pad_push_data
    at gstpad.c line 4038
  • #49 gst_pad_push_data
    at gstpad.c line 4271
  • #50 gst_queue_loop
    at gstqueue.c line 1337
  • #51 gst_queue_loop
    at gstqueue.c line 1484
  • #52 gst_task_func
    at gsttask.c line 331
  • #53 g_thread_pool_thread_proxy
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gthreadpool.c line 307
  • #54 g_thread_proxy
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gthread.c line 764
  • #55 start_thread
    at pthread_create.c line 309
  • #56 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 111
  • #0 glx_event_filter_cb
    at ./winsys/cogl-winsys-glx.c line 441
  • #1 glx_event_filter_cb
    at ./winsys/cogl-winsys-glx.c line 563
  • #2 _cogl_renderer_handle_native_event
    at ./cogl-renderer.c line 732
  • #3 cogl_xlib_renderer_handle_event
    at ./cogl-xlib-renderer.c line 589
  • #4 cogl_xlib_filter
    at ./x11/clutter-backend-x11.c line 132
  • #5 clutter_backend_x11_translate_event
    at ./x11/clutter-backend-x11.c line 640
  • #6 clutter_x11_handle_event
    at ./x11/clutter-event-x11.c line 200
  • #7 gtk_clutter_filter_func
    at ./gtk-clutter-embed.c line 252
  • #8 gdk_event_apply_filters
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/x11/gdkeventsource.c line 81
  • #9 _gdk_x11_display_queue_events
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/x11/gdkeventsource.c line 195
  • #10 _gdk_x11_display_queue_events
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/x11/gdkeventsource.c line 338
  • #11 gdk_display_get_event
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/gdkdisplay.c line 321
  • #12 gdk_event_source_dispatch
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/x11/gdkeventsource.c line 360
  • #13 g_main_context_dispatch
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3122
  • #14 g_main_context_dispatch
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3737
  • #15 g_main_context_iterate
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3808
  • #16 g_main_loop_run
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 4002
  • #17 gtk_dialog_run
    at /tmp/buildd/gtk+3.0-3.14.5/./gtk/gtkdialog.c line 1391
  • #18 totem_add_files
  • #19 totem_object_open
  • #20 0x00007ffff7b9011e in
  • #25 <emit signal ??? on instance 0x5555576de2a0 [GtkApplicationWindow]>
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./gobject/gsignal.c line 3363
  • #21 _gtk_marshal_BOOLEAN__BOXED
    at /tmp/buildd/gtk+3.0-3.14.5/./gtk/gtkmarshalers.c line 85
  • #22 g_closure_invoke
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./gobject/gclosure.c line 801
  • #23 signal_emit_unlocked_R
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./gobject/gsignal.c line 3551
  • #24 g_signal_emit_valist
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./gobject/gsignal.c line 3317
  • #26 gtk_widget_event_internal
    at /tmp/buildd/gtk+3.0-3.14.5/./gtk/gtkwidget.c line 7773
  • #27 propagate_event
    at /tmp/buildd/gtk+3.0-3.14.5/./gtk/gtkmain.c line 2517
  • #28 gtk_main_do_event
    at /tmp/buildd/gtk+3.0-3.14.5/./gtk/gtkmain.c line 1748
  • #29 gdk_event_source_dispatch
    at /tmp/buildd/gtk+3.0-3.14.5/./gdk/x11/gdkeventsource.c line 364
  • #30 g_main_context_dispatch
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3122
  • #31 g_main_context_dispatch
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3737
  • #32 g_main_context_iterate
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3808
  • #33 g_main_context_iteration
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./glib/gmain.c line 3869
  • #34 g_application_run
    at /build/glib2.0-YnEOls/glib2.0-2.45.1/./gio/gapplication.c line 2308
  • #35 main




Full sequence with "push" the CoglFrameInfo, "pop" it, attached.
Comment 1 Víctor Manuel Jáquez Leal 2015-05-21 11:12:23 UTC
How I can reproduce the crash?

I have compiled totem, played some videos, but was unable to reproduce the crash.
Comment 2 Alban Browaeys 2015-05-21 15:23:16 UTC
I should have told first my setup :
 totem 3.14.0.-2 debian
cogl  1.18.2-3 debian
gstreamer-vaapi git master
gstreamer and its plugins 1.5.0.1+git20150513-1 debian


may I ask if you compiled totem latest (and if any of the other items differ too).

All I have to do is totem <my file> (I tried mpeg2 and mp4 files)
Comment 3 Víctor Manuel Jáquez Leal 2015-05-22 10:50:54 UTC
which version of libva and libva-intel-driver are you using?
Comment 4 Alban Browaeys 2015-05-22 12:33:45 UTC
liva and i965-va-driver are both 1.5.1-2 (debian sid)
Comment 5 Víctor Manuel Jáquez Leal 2015-05-26 15:18:36 UTC
Which commit id do you have as master in gstreamer-vaapi?
Comment 6 Alban Browaeys 2015-05-27 08:58:25 UTC
latest from gitorious . Sorry will switch to github .
Comment 7 Alban Browaeys 2015-05-27 09:57:56 UTC
indeed unreproducible with github code.
Comment 8 Alban Browaeys 2015-05-27 10:22:54 UTC
sorry my bad... the crash is still there. 
the new repo has issues with HEVC which broke gstreamer registration . I was back on software decoding.

I fixed those locally (gst/vaapi/Makefile.am h265 encoder.c/. in the encoders list only if USE flag is set) .
Also added va_dec_hevc.h and av.h to gst-libs/gst/vaapi/gstvaapidecoder_h265.c to fix build.

I plan to send those two fixes in a few hours. Feel free to beat me at that.
Comment 9 sreerenj 2015-05-27 10:31:32 UTC
(In reply to Alban Browaeys from comment #8)
> sorry my bad... the crash is still there. 
> the new repo has issues with HEVC which broke gstreamer registration . I was
> back on software decoding.
> 
> I fixed those locally (gst/vaapi/Makefile.am h265 encoder.c/. in the
> encoders list only if USE flag is set) .

Aha, that was a stupid mistake from me.Sorry..
Waiting for the patches :)

> Also added va_dec_hevc.h and av.h to
> gst-libs/gst/vaapi/gstvaapidecoder_h265.c to fix build.
> 
> I plan to send those two fixes in a few hours. Feel free to beat me at that.
Comment 10 Víctor Manuel Jáquez Leal 2015-06-08 16:25:50 UTC
(In reply to Alban Browaeys from comment #8)
> sorry my bad... the crash is still there. 

What chipset/GPU are you using?

The backtrace of the crash is the same?
Comment 11 Alban Browaeys 2015-06-16 23:53:38 UTC
Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)

The issue I cannot reproduce anymore as setup has evolved (debian unstable switched to gnome 3.16 and ll its dependencies) and is now at :
totem 3.16.1-2
cogl 1.20.0-2.1
gstreamer1.0 and its plugins at 1.5.1-1
gstreamer-vaapi github cbc2d15becc33718085c6663f300e5a4cd2b1b18 "vaapipostproc: add color balance interface"


Should I close this report ? Closing as obsolete  seems far stretched but  still the closest.


PS: only issue left is  totem-video-thumbnailer fails as it does not discard "vaapidecodebin" and "vaapidecode" only the latter (issue already reported to totem as https://bugzilla.gnome.org/show_bug.cgi?id=749605 ) .
Comment 12 Víctor Manuel Jáquez Leal 2015-06-17 11:16:03 UTC
(In reply to Alban Browaeys from comment #11)
> Should I close this report ? Closing as obsolete  seems far stretched but 
> still the closest.

Yes, let's do it.

By upgrading to a newer version of GNOME you could receive bug fixes and new functionality. You may need to upgrade your Linux distribution to obtain a newer version of GNOME.

Please feel free to reopen this bug report if the problem still occurs with a recent version of GNOME, or feel free to report this bug in the bug tracking system of your Linux distribution if your distribution still supports the version that you are using.