glimagesink: various refcount issues / segfaults when run with validate
gst-validate-1.0 videotestsrc num-buffers=100 ! glimagesink --set-scenario change_state_intensive
on my machine, I often see crashes and / or critical errors such as:
0:00:00.141768222 6227 0x975540 ERROR validate gst-validate-reporter.c:195:gst_validate_report_valist: <pipeline0> 2080 (critical) : g-log: We got a g_log critical issue : g_object_ref: assertion 'G_IS_OBJECT (object)' failed
0:00:00.142093128 6227 0x975540 ERROR validate gst-validate-reporter.c:195:gst_validate_report_valist: <pipeline0> 2080 (critical) : g-log: We got a g_log critical issue : gst_gl_window_resize: assertion 'GST_IS_GL_WINDOW (window)' failed
0:00:00.142355370 6227 0x975540 ERROR validate gst-validate-reporter.c:195:gst_validate_report_valist: <pipeline0> 2080 (critical) : g-log: We got a g_log critical issue : gst_gl_window_draw: assertion 'GST_IS_GL_WINDOW (window)' failed
0:00:00.142611845 6227 0x975540 ERROR validate gst-validate-reporter.c:195:gst_validate_report_valist: <pipeline0> 2080 (critical) : g-log: We got a g_log critical issue : gst_object_unref: assertion '((GObject *) object)->ref_count > 0' failed
stacktrace on SIGSEGV:
<Caught SIGNAL: SIGSEGV>
#0 0x00007fa5acbb0df9 in syscall () at /lib64/libc.so.6
#1 0x00007fa5ad723333 in g_cond_wait () at /lib64/libglib-2.0.so.0
#2 0x00007fa59a5a08b4 in gst_gl_window_default_send_message (window=0x988a20, callback=<optimized out>, data=<optimized out>)
#3 0x00007fa59a58270d in gst_gl_context_thread_add (context=<optimized out>, func=func@entry=0x7fa59a578f40 <gst_gl_base_filter_gl_stop>, data=data@entry=0x9801a0) at ../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcontext.c:1579
#4 0x00007fa59a578f1f in gst_gl_base_filter_reset (filter=0x9801a0)
#5 0x00007fa59a578f1f in gst_gl_base_filter_stop (bt=<optimized out>)
#6 0x00007fa5aaab3d94 in gst_base_transform_activate (trans=trans@entry=0x9801a0, active=active@entry=0)
#7 0x00007fa5aaab3e85 in gst_base_transform_sink_activate_mode (pad=<optimized out>, parent=0x9801a0, mode=<optimized out>, active=0)
#8 0x00007fa5adcf9cdb in gst_validate_pad_monitor_activatemode_func (pad=0x9522a0, parent=0x9801a0, mode=GST_PAD_MODE_PUSH, active=0)
#9 0x00007fa5ada2aab6 in activate_mode_internal (pad=pad@entry=0x9522a0, parent=parent@entry=0x9801a0, mode=mode@entry=GST_PAD_MODE_PUSH, active=active@entry=0) at ../subprojects/gstreamer/gst/gstpad.c:1220
#10 0x00007fa5ada2b515 in gst_pad_set_active (pad=pad@entry=0x9522a0, active=0)
#11 0x00007fa5ada0787d in activate_pads (vpad=<optimized out>, ret=0x7ffd54c73d90, active=0x7ffd54c73dec) at ../subprojects/gstreamer/gst/gstelement.c:3036
#12 0x00007fa5ada1b36c in gst_iterator_fold (it=it@entry=0x91c5c0, func=func@entry=0x7fa5ada07860 <activate_pads>, ret=ret@entry=0x7ffd54c73d90, user_data=user_data@entry=0x7ffd54c73dec) at ../subprojects/gstreamer/gst/gstiterator.c:617
#13 0x00007fa5ada08216 in iterator_activate_fold_with_resync (iter=iter@entry=0x91c5c0, user_data=user_data@entry=0x7ffd54c73dec, func=0x7fa5ada07860 <activate_pads>) at ../subprojects/gstreamer/gst/gstelement.c:3060
#14 0x00007fa5ada0a22e in gst_element_pads_activate (element=element@entry=0x9801a0, active=<optimized out>, active@entry=0)
#15 0x00007fa5ada0a481 in gst_element_change_state_func (element=0x9801a0, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#16 0x00007fa59a578d6b in gst_gl_base_filter_change_state (element=0x9801a0, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#17 0x00007fa5ada0c5de in gst_element_change_state (element=element@entry=0x9801a0, transition=transition@entry=GST_STATE_CHANGE_PAUSED_TO_READY)
#18 0x00007fa5ada0ccfe in gst_element_set_state_func (element=0x9801a0, state=GST_STATE_READY) at ../subprojects/gstreamer/gst/gstelement.c:2902
#19 0x00007fa5ad9eb817 in gst_bin_element_set_state (next=GST_STATE_READY, current=GST_STATE_PAUSED, start_time=0, base_time=8034553076535, element=0x9801a0, bin=0x978020) at ../subprojects/gstreamer/gst/gstbin.c:2601
#20 0x00007fa5ad9eb817 in gst_bin_change_state_func (element=0x978020, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#21 0x00007fa5ada0c5de in gst_element_change_state (element=element@entry=0x978020, transition=transition@entry=GST_STATE_CHANGE_PAUSED_TO_READY)
#22 0x00007fa5ada0ccfe in gst_element_set_state_func (element=0x978020, state=GST_STATE_READY) at ../subprojects/gstreamer/gst/gstelement.c:2902
#23 0x00007fa5ad9eb817 in gst_bin_element_set_state (next=GST_STATE_READY, current=GST_STATE_PAUSED, start_time=0, base_time=8034553076535, element=0x978020, bin=0x988400) at ../subprojects/gstreamer/gst/gstbin.c:2601
#24 0x00007fa5ad9eb817 in gst_bin_change_state_func (element=0x988400, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#25 0x00007fa5ada0c5de in gst_element_change_state (element=element@entry=0x988400, transition=GST_STATE_CHANGE_PAUSED_TO_READY)
#26 0x00007fa5ada0cfde in gst_element_continue_state (element=element@entry=0x988400, ret=ret@entry=GST_STATE_CHANGE_SUCCESS)
#27 0x00007fa5ada0c7c5 in gst_element_change_state (element=element@entry=0x988400, transition=transition@entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED)
#28 0x00007fa5ada0ccfe in gst_element_set_state_func (element=0x988400, state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:2902
#29 0x00007fa5add06006 in _execute_set_state (scenario=0x9aa100, action=<optimized out>)
#30 0x00007fa5add09c89 in gst_validate_execute_action (action_type=0x94eb70, action=action@entry=0x9a71b0)
#31 0x00007fa5add0a8df in _execute_sub_action_action (action=action@entry=0x9a71b0)
#32 0x00007fa5add0e036 in _action_set_done (action=0x9a71b0)
#33 0x00007fa5ad6dd8e5 in g_main_context_invoke_full ()
#34 0x00007fa5add0a936 in gst_validate_action_set_done (action=<optimized out>)
#35 0x00007fa5add0b4d2 in message_cb (bus=<optimized out>, message=0x9d2ea0, scenario=0x9aa100)
#36 0x00007fa5aba4c03e in ffi_call_unix64 () at /lib64/libffi.so.6
#37 0x00007fa5aba4b9ff in ffi_call () at /lib64/libffi.so.6
#38 0x00007fa5ad44e5a5 in g_cclosure_marshal_generic ()
#39 0x00007fa5ad44dadd in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#40 0x00007fa5ad460eb3 in signal_emit_unlocked_R ()
#41 0x00007fa5ad469fda in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#42 0x00007fa5ad46a5d3 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#43 0x00007fa5ad9f3e94 in gst_bus_async_signal_func (bus=0x891bf0, message=0x9d2ea0, data=<optimized out>) at ../subprojects/gstreamer/gst/gstbus.c:1251
#44 0x00007fa5ad9f4cad in gst_bus_source_dispatch (source=0x9bdfd0, callback=0x7fa5ad9f3e40 <gst_bus_async_signal_func>, user_data=0x0)
#45 0x00007fa5ad6dc7cd in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#46 0x00007fa5ad6dcb98 in g_main_context_iterate.isra ()
#47 0x00007fa5ad6dcec2 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#48 0x0000000000402cc0 in main (argc=<optimized out>, argv=<optimized out>)
Please run 'gdb <process-name> 6227' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.