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 583255 - [playbin2] deadlock when disabling visualisations
[playbin2] deadlock when disabling visualisations
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal critical
: 0.10.25
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 591595 595285 600459 (view as bug list)
Depends on:
Blocks: 581249
 
 
Reported: 2009-05-19 20:02 UTC by Jan Schmidt
Modified: 2009-11-02 18:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdb trace made per Ubuntu's guidelines (26.41 KB, text/plain)
2009-09-15 18:43 UTC, Louis Simard
  Details
possible patch (1.86 KB, patch)
2009-09-28 20:07 UTC, Wim Taymans
accepted-commit_now Details | Review

Description Jan Schmidt 2009-05-19 20:02:09 UTC
Observed this deadlock with totem and playbin2 earlier, while it was resetting at the end of a file:

Thread 1 (Thread 0xb8034770 (LWP 30539))

  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S line 142
  • #2 _L_lock_752
    from /lib/libpthread.so.0
  • #3 __pthread_mutex_lock
    at pthread_mutex_lock.c line 61
  • #4 gst_play_sink_get_sink
    at gstplaysink.c line 379
  • #5 gst_play_bin_get_property
    at gstplaybin2.c line 1609
  • #6 object_get_property
    at gobject.c line 904
  • #7 IA__g_object_get_valist
    at gobject.c line 1498
  • #8 IA__g_object_get
    at gobject.c line 1588
  • #9 bvw_update_interface_implementations
    at bacon-video-widget-gst-0.10.c line 5703
  • #10 got_new_video_sink_bin_element
    at bacon-video-widget-gst-0.10.c line 5828
  • #11 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #12 IA__g_closure_invoke
    at gclosure.c line 767
  • #13 signal_emit_unlocked_R
  • #14 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #15 IA__g_signal_emit
    at gsignal.c line 3037
  • #16 gst_bin_add_func
    at gstbin.c line 1049
  • #17 gst_bin_add
    at gstbin.c line 1112
  • #18 do_toggle_element
    at gstgconfvideosink.c line 208
  • #19 gst_gconf_video_sink_change_state
    at gstgconfvideosink.c line 236
  • #20 gst_element_change_state
    at gstelement.c line 2458
  • #21 gst_element_set_state_func
    at gstelement.c line 2414
  • #22 gst_element_set_state
    at gstelement.c line 2317
  • #23 setup_video_chain
    at gstplaysink.c line 990
  • #24 gst_play_sink_reconfigure
    at gstplaysink.c line 1746
  • #25 gst_play_bin_set_property
    at gstplaybin2.c line 1435
  • #26 object_set_property
    at gobject.c line 942
  • #27 IA__g_object_set_valist
    at gobject.c line 1431
  • #28 IA__g_object_set
    at gobject.c line 1537
  • #29 parse_stream_info
    at bacon-video-widget-gst-0.10.c line 1989
  • #30 bvw_update_stream_info
    at bacon-video-widget-gst-0.10.c line 1232
  • #31 bvw_handle_application_message
    at bacon-video-widget-gst-0.10.c line 1255
  • #32 bvw_bus_message_cb
    at bacon-video-widget-gst-0.10.c line 1672
  • #33 marshal_VOID__MINIOBJECT
    at gstbus.c line 134
  • #34 IA__g_closure_invoke
    at gclosure.c line 767
  • #35 signal_emit_unlocked_R
    at gsignal.c line 3247
  • #36 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #37 IA__g_signal_emit
    at gsignal.c line 3037
  • #38 gst_bus_async_signal_func
    at gstbus.c line 1098
  • #39 gst_bus_source_dispatch
    at gstbus.c line 761
  • #40 g_main_dispatch
    at gmain.c line 1814
  • #41 IA__g_main_context_dispatch
    at gmain.c line 2367
  • #42 g_main_context_iterate
    at gmain.c line 2448
  • #43 IA__g_main_loop_run
    at gmain.c line 2656
  • #44 IA__gtk_main
    at gtkmain.c line 1205
  • #45 main
    at totem.c line 277

Comment 1 Tim-Philipp Müller 2009-05-29 00:42:42 UTC
Very similar looking deadlock from today (not sure what triggered it, was in the middle of a sing; possible I clicked on the 'enable visualisation' checkbox while it was playing without vis enabled, or changing vis, don't remember exactly:

Thread 1 (Thread 0x7fcf5a4a9810 (LWP 6892))

  • #0 __lll_lock_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S line 130
  • #1 _L_lock_102
    from /lib/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 86
  • #3 gst_play_sink_get_sink
    at gstplaysink.c line 382
  • #4 gst_play_bin_get_current_sink
    at gstplaybin2.c line 1538
  • #5 gst_play_bin_get_property
    at gstplaybin2.c line 1646
  • #6 g_object_get_valist
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_object_get
    from /usr/lib/libgobject-2.0.so.0
  • #8 bvw_update_interface_implementations
    at bacon-video-widget-gst-0.10.c line 5712
  • #9 got_new_video_sink_bin_element
    at bacon-video-widget-gst-0.10.c line 5837
  • #10 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #11 ??
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #14 gst_bin_add_func
    at gstbin.c line 1049
  • #15 gst_gconf_video_sink_reset
    at gstgconfvideosink.c line 101
  • #16 gst_gconf_video_sink_change_state
    at gstgconfvideosink.c line 248
  • #17 gst_element_change_state
    at gstelement.c line 2458
  • #18 gst_element_set_state_func
    at gstelement.c line 2414
  • #19 gst_bin_change_state_func
    at gstbin.c line 2039
  • #20 gst_element_change_state
    at gstelement.c line 2458
  • #21 gst_element_change_state
    at gstelement.c line 2495
  • #22 gst_element_change_state
    at gstelement.c line 2495
  • #23 gst_element_set_state_func
    at gstelement.c line 2414
  • #24 activate_chain
    at gstplaysink.c line 675
  • #25 gst_play_sink_reconfigure
    at gstplaysink.c line 1820
  • #26 g_object_set_valist
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_object_set
    from /usr/lib/libgobject-2.0.so.0
  • #28 setup_vis
    at bacon-video-widget-gst-0.10.c line 3972
  • #29 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #30 ??
    from /usr/lib/libgobject-2.0.so.0

Comment 2 Philip Withnall 2009-08-08 17:39:33 UTC
Just got exactly the same deadlock when disabling visualisations while playing a file (file attached to bug #591165).

(gdb) t a a bt

Thread 1 (Thread 0x7fdfafba97d0 (LWP 8851))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_102
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 gst_play_sink_get_sink
    at gstplaysink.c line 382
  • #4 gst_play_bin_get_current_sink
    at gstplaybin2.c line 1615
  • #5 gst_play_bin_get_property
    at gstplaybin2.c line 1723
  • #6 IA__g_object_get_valist
    at gobject.c line 904
  • #7 IA__g_object_get
    at gobject.c line 1588
  • #8 bvw_update_interface_implementations
    at bacon-video-widget-gst-0.10.c line 5937
  • #9 got_new_video_sink_bin_element
    at bacon-video-widget-gst-0.10.c line 6062
  • #10 IA__g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 636
  • #11 IA__g_closure_invoke
    at gclosure.c line 767
  • #12 signal_emit_unlocked_R
    at gsignal.c line 3247
  • #13 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #14 IA__g_signal_emit
    at gsignal.c line 3037
  • #15 gst_bin_add_func
    at gstbin.c line 1049
  • #16 gst_bin_add
    at gstbin.c line 1112
  • #17 gst_gconf_video_sink_reset
    at gstgconfvideosink.c line 101
  • #18 gst_gconf_video_sink_change_state
    at gstgconfvideosink.c line 248
  • #19 gst_element_change_state
    at gstelement.c line 2547
  • #20 gst_element_set_state_func
    at gstelement.c line 2503
  • #21 gst_element_set_state
    at gstelement.c line 2404
  • #22 gst_bin_change_state_func
    at gstbin.c line 2046
  • #23 gst_element_change_state
    at gstelement.c line 2547
  • #24 gst_element_continue_state
    at gstelement.c line 2221
  • #25 gst_element_change_state
    at gstelement.c line 2584
  • #26 gst_element_continue_state
    at gstelement.c line 2221
  • #27 gst_element_change_state
    at gstelement.c line 2584
  • #28 gst_element_set_state_func
    at gstelement.c line 2503
  • #29 gst_element_set_state
    at gstelement.c line 2404
  • #30 activate_chain
    at gstplaysink.c line 675
  • #31 gst_play_sink_reconfigure
    at gstplaysink.c line 1854
  • #32 gst_play_bin_set_property
    at gstplaybin2.c line 1181
  • #33 IA__g_object_set_valist
    at gobject.c line 942
  • #34 IA__g_object_set
    at gobject.c line 1537
  • #35 setup_vis
    at bacon-video-widget-gst-0.10.c line 4199
  • #36 bacon_video_widget_set_show_visuals
    at bacon-video-widget-gst-0.10.c line 4233
  • #37 totem_prefs_set_show_visuals
    at totem-preferences.c line 151
  • #38 checkbutton2_toggled_cb
    at totem-preferences.c line 173
  • #39 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #40 IA__g_closure_invoke
    at gclosure.c line 767
  • #41 signal_emit_unlocked_R
    at gsignal.c line 3247
  • #42 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #43 IA__g_signal_emit
    at gsignal.c line 3037
  • #44 IA__gtk_toggle_button_toggled
    at gtktogglebutton.c line 365
  • #45 gtk_toggle_button_clicked
    at gtktogglebutton.c line 498
  • #46 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #47 g_type_class_meta_marshal
  • #48 IA__g_closure_invoke
    at gclosure.c line 767
  • #49 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #50 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #51 IA__g_signal_emit
    at gsignal.c line 3037
  • #52 IA__gtk_button_clicked
    at gtkbutton.c line 1111
  • #53 gtk_toggle_button_released
    at gtktogglebutton.c line 485
  • #54 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #55 g_type_class_meta_marshal
    at gclosure.c line 878
  • #56 IA__g_closure_invoke
    at gclosure.c line 767
  • #57 signal_emit_unlocked_R
    at gsignal.c line 3177
  • #58 IA__g_signal_emit_valist
    at gsignal.c line 2980
  • #59 IA__g_signal_emit
    at gsignal.c line 3037
  • #60 IA__gtk_button_released
    at gtkbutton.c line 1103
  • #61 gtk_button_button_release
    at gtkbutton.c line 1599
  • #62 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 84
  • #63 g_type_class_meta_marshal
    at gclosure.c line 878
  • #64 IA__g_closure_invoke
    at gclosure.c line 767
  • #65 signal_emit_unlocked_R
    at gsignal.c line 3285
  • #66 IA__g_signal_emit_valist
    at gsignal.c line 2990
  • #67 IA__g_signal_emit
    at gsignal.c line 3037
  • #68 gtk_widget_event_internal
    at gtkwidget.c line 4786
  • #69 IA__gtk_widget_event
    at gtkwidget.c line 4583
  • #70 IA__gtk_propagate_event
    at gtkmain.c line 2396
  • #71 IA__gtk_main_do_event
    at gtkmain.c line 1601
  • #72 gdk_event_dispatch
    at gdkevents-x11.c line 2379
  • #73 IA__g_main_context_dispatch
    at gmain.c line 1960
  • #74 g_main_context_iterate
    at gmain.c line 2591
  • #75 IA__g_main_loop_run
    at gmain.c line 2799
  • #76 IA__gtk_main
    at gtkmain.c line 1205
  • #77 main
    at totem.c line 278
  • #0 __lll_lock_wait
    from /lib/libpthread.so.0

Comment 3 Bastien Nocera 2009-08-12 20:57:49 UTC
*** Bug 591595 has been marked as a duplicate of this bug. ***
Comment 4 Louis Simard 2009-09-15 18:43:19 UTC
Created attachment 143243 [details]
gdb trace made per Ubuntu's guidelines

Here's another stack trace for the disabling-visualization while playing audio crash.

[ Filed here from https://bugs.launchpad.net/ubuntu/+source/gstreamer0.10/+bug/428987 where a user said this would be an upstream issue ]
Comment 5 Tim-Philipp Müller 2009-09-16 09:24:44 UTC
This also happens regularly when changing tracks, not only when enabling/disabling visualisations (there might be another report about that, but I can't find it right now).

Marking as blocker, since I think we should really fix this before the release if possible at all.
Comment 6 Philip Withnall 2009-09-18 13:08:14 UTC
*** Bug 595285 has been marked as a duplicate of this bug. ***
Comment 7 Philip Withnall 2009-09-18 13:09:04 UTC
(In reply to comment #5)
> This also happens regularly when changing tracks, not only when
> enabling/disabling visualisations (there might be another report about that,
> but I can't find it right now).

Bug #595285 is such a bug, though it doesn't have such a useful trace.
Comment 8 Jan Schmidt 2009-09-23 09:34:44 UTC
ping? It's been a week - is anyone looking at this bug?
Comment 9 Jan Schmidt 2009-09-28 16:45:10 UTC
I don't know how to fix this bug. Basically, we need playsink not to hold the PLAY_SINK_LOCK while doing operations on the video/audio chains, such as change their state or adding/removing them from the bin.

One way would be to protect those 'sensitive' operations with a different lock.
Comment 10 Wim Taymans 2009-09-28 20:07:49 UTC
Created attachment 144196 [details] [review]
possible patch

Make the lock recursive for now.
Comment 11 Jan Schmidt 2009-09-29 10:10:50 UTC
Making the lock recursive doesn't actually help in the larger scheme - it just exposes a different deadlock in Totem:

Thread 4 (Thread 0xb35ffb90 (LWP 8280))

  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_lock_89
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #4 got_new_video_sink_bin_element
    at bacon-video-widget-gst-0.10.c line 6096
  • #5 g_cclosure_marshal_VOID__OBJECT
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #7 ??
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #10 gst_bin_add_func
    at gstbin.c line 1099
  • #11 gst_bin_add
    at gstbin.c line 1162
  • #12 do_toggle_element
    at gstgconfvideosink.c line 208
  • #13 gst_gconf_video_sink_change_state
    at gstgconfvideosink.c line 236
  • #14 gst_element_change_state
    at gstelement.c line 2548
  • #15 gst_element_set_state_func
    at gstelement.c line 2504
  • #16 gst_element_set_state
    at gstelement.c line 2405
  • #17 gst_play_sink_reconfigure
    at gstplaysink.c line 1121
  • #18 no_more_pads_cb
    at gstplaybin2.c line 2279
  • #19 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #21 ??
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #24 gst_element_no_more_pads
    at gstelement.c line 923
  • #25 no_more_pads_full
    at gsturidecodebin.c line 679
  • #26 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #28 ??
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #31 gst_element_no_more_pads
    at gstelement.c line 923
  • #32 gst_decode_group_expose
    at gstdecodebin2.c line 2246
  • #33 source_pad_blocked_cb
    at gstdecodebin2.c line 2509
  • #34 handle_pad_block
    at gstpad.c line 3852
  • #35 gst_pad_push_event
    at gstpad.c line 4795
  • #36 gst_proxy_pad_do_event
    at gstghostpad.c line 128
  • #37 gst_pad_send_event
    at gstpad.c line 4962
  • #38 gst_pad_push_event
    at gstpad.c line 4818
  • #39 theora_dec_decode_buffer
    at theoradec.c line 967
  • #40 theora_dec_chain
    at theoradec.c line 1664
  • #41 gst_pad_chain_data_unchecked
    at gstpad.c line 4042
  • #42 gst_pad_push_data
    at gstpad.c line 4271
  • #43 gst_multi_queue_loop
    at gstmultiqueue.c line 806
  • #44 gst_task_func
    at gsttask.c line 234
  • #45 default_func
    at gsttaskpool.c line 70
  • #46 ??
    from /usr/lib/libglib-2.0.so.0
  • #47 ??
    from /usr/lib/libglib-2.0.so.0
  • #48 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #49 clone
    from /lib/tls/i686/cmov/libc.so.6

Comment 12 Jan Schmidt 2009-09-30 18:36:48 UTC
Alright, punting this in favour of making the releases. It is annoying, but it isn't a regression, and we clearly need more time to figure out how to fix it.
Comment 13 Bastien Nocera 2009-09-30 18:41:31 UTC
(In reply to comment #12)
> Alright, punting this in favour of making the releases. It is annoying, but it
> isn't a regression, and we clearly need more time to figure out how to fix it.

But it causes a regression in Totem...
Comment 14 Jan Schmidt 2009-09-30 19:19:50 UTC
Switching to playbin2 prematurely causes a regression in Totem :-P

OK - let's apply the hacky fix. The secondary lockup can be worked around in Totem:

diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 5500d99..e963d46 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -5950,6 +5950,7 @@ bvw_update_interface_implementations (BaconVideoWidget *bvw)
   GstElement *video_sink = NULL;
   GstElement *element = NULL;
   GstIterator *iter;
+  GstElement *play;
 
   if (g_thread_self() != gui_thread) {
     if (bvw->priv->balance)
@@ -5969,8 +5970,14 @@ bvw_update_interface_implementations (BaconVideoWidget *bvw)
     return;
   }
 
+  play = gst_object_ref(bvw->priv->play);
+
+  g_mutex_unlock (bvw->priv->lock);
   g_object_get (bvw->priv->play, "video-sink", &video_sink, NULL);
   g_assert (video_sink != NULL);
+  g_mutex_lock (bvw->priv->lock);
+
+  gst_object_unref(play);
 
   /* We try to get an element supporting XOverlay interface */
   if (GST_IS_BIN (video_sink)) {
Comment 15 Wim Taymans 2009-10-01 07:38:30 UTC
commit a8d7e6a4901a21ebb4d1e0937e6be7309e8146ac
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Mon Sep 28 22:06:11 2009 +0200

    playsink: make the lock recursive for now
    
    Fixes #583255
Comment 16 Tim-Philipp Müller 2009-11-02 18:29:06 UTC
*** Bug 600459 has been marked as a duplicate of this bug. ***