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 599970 - totem freezes when loading video with subtitles file
totem freezes when loading video with subtitles file
Status: RESOLVED DUPLICATE of bug 600479
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-28 23:35 UTC by Ethan Cohen
Modified: 2009-11-06 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ethan Cohen 2009-10-28 23:35:38 UTC
Totem 2.28.1 freezes everytime I try to open a video (at least avi files) that have .srt files associated. If I remove the .srt file, the video opens normally.
Comment 1 Geert Jan Alsem 2009-11-03 08:40:19 UTC
Note that to reproduce this bug you have to activate automatic loading of subtitles in the preferences screen.

With that option enabled the bug occurs for every video with srt subtitles, on both Totem 2.28.1 and 2.28.2.

I'm using Ubuntu 9.10.
Comment 2 Geert Jan Alsem 2009-11-03 20:59:21 UTC
I've been trying to pinpoint the bug myself. Not so easy. :)

Here's all I have found out so far:

The bug only happens when you open a video from the command line (or by double clicking). If you open Totem and then open a video file with matching subtitles, it works fine.

So the bug only occurs when it's both a command line load _and_ auto subtitle loading is enabled.

I've been debugging a bit, but I just can't find out where in the source code the program does something different when opening from the command line. The correct video and subtitle uri's are opened, just as when you open from within Totem. The only difference I see is in the debugging information. If the bug occurs, it seems as if Totem opened an "empty" video. Every call to "get_metadata"-like functions results in 0's and NULL values. Also movie size and framerate are 0, which might be the reason Totem freezes.

So I'm not sure what's going on. Perhaps when you open a video from command line, it tries to read the metadata too early, before the file is properly opened? Resulting in an unplayable video at 0 fps? But then why does it only happen when it's also loading subtitles?

I guess I should wait for someone more knowledgeable about the subject to take a look at it. :)
Comment 3 Balazs Scheidler 2009-11-06 06:50:39 UTC
This seems to be a deadlock to me, the main thread deadlocks on gst_object_get_parent() in reaction to a "subtitle-encoding" changed signal. Probably some kind of lock ordering problem (like one thread takes locks 1 and 2, the other taking locks 2 and 1 in this order).

This is the main thread:


  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_lock_752
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #4 gst_object_get_parent
    at gstobject.c line 830
  • #5 gst_object_dispatch_properties_changed
    at gstobject.c line 527
  • #6 g_object_notify_dispatcher
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 326
  • #7 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.22.2/gobject/gobjectnotifyqueue.c line 120
  • #8 IA__g_object_set_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1482
  • #9 IA__g_object_set
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1582
  • #10 gst_decode_bin_set_subs_encoding
    at gstdecodebin2.c line 865
  • #11 gst_decode_bin_set_property
  • #12 object_set_property
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 968
  • #13 IA__g_object_set_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1476
  • #14 IA__g_object_set
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1582
  • #15 gst_uri_decode_bin_set_encoding
    at gsturidecodebin.c line 491
  • #16 gst_uri_decode_bin_set_property
    at gsturidecodebin.c line 522
  • #17 object_set_property
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 968
  • #18 IA__g_object_set_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1476
  • #19 IA__g_object_set
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1582
  • #20 gst_play_bin_set_encoding
    at gstplaybin2.c line 1519
  • #21 gst_play_bin_set_property
    at gstplaybin2.c line 1574
  • #22 object_set_property
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 968
  • #23 IA__g_object_set_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1476
  • #24 IA__g_object_set
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 1582
  • #25 bacon_video_widget_set_subtitle_encoding
    at bacon-video-widget-gst-0.10.c line 3841
  • #26 encoding_changed_cb
    at totem-preferences.c line 489
  • #27 ??
    from /usr/lib/libgconf-2.so.4
  • #28 gconf_listeners_notify
    from /usr/lib/libgconf-2.so.4
  • #29 ??
    from /usr/lib/libgconf-2.so.4
  • #30 ??
    from /usr/lib/libgconf-2.so.4
  • #31 g_idle_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 4065
  • #32 g_main_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 1960
  • #33 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2513
  • #34 g_main_context_iterate
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2591
  • #35 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2799
  • #36 IA__gtk_main
    at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c line 1218
  • #37 main
    at totem.c line 278
  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_lock_752
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #4 gst_object_get_parent
    at gstobject.c line 830
  • #5 gst_object_dispatch_properties_changed
    at gstobject.c line 527
  • #6 g_object_notify_dispatcher
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 326
  • #7 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.22.2/gobject/gobjectnotifyqueue.c line 120
  • #8 IA__g_object_notify
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 883
  • #9 on_src_target_notify
    at gstghostpad.c line 748
  • #10 IA__g_cclosure_marshal_VOID__PARAM
    at /build/buildd/glib2.0-2.22.2/gobject/gmarshal.c line 531
  • #11 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #12 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3247
  • #13 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2980
  • #14 IA__g_signal_emit
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3037
  • #15 g_object_dispatch_properties_changed
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 796
  • #16 gst_object_dispatch_properties_changed
    at gstobject.c line 509
  • #17 g_object_notify_dispatcher
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 326
  • #18 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.22.2/gobject/gobjectnotifyqueue.c line 120
  • #19 IA__g_object_notify
    at /build/buildd/glib2.0-2.22.2/gobject/gobject.c line 883
  • #20 gst_pad_set_caps
    at gstpad.c line 2540
  • #21 handle_buffer
    at gstsubparse.c line 1334
  • #22 gst_sub_parse_chain
    at gstsubparse.c line 1432
  • #23 gst_pad_chain_data_unchecked
    at gstpad.c line 4042
  • #24 gst_pad_push_data
    at gstpad.c line 4271
  • #25 gst_type_find_element_chain
    at gsttypefindelement.c line 698
  • #26 gst_pad_chain_data_unchecked
    at gstpad.c line 4042
  • #27 gst_pad_push_data
    at gstpad.c line 4271
  • #28 gst_proxy_pad_do_chain
    at gstghostpad.c line 179
  • #29 gst_pad_chain_data_unchecked
    at gstpad.c line 4042
  • #30 gst_pad_push_data
    at gstpad.c line 4271
  • #31 gst_base_src_loop
    at gstbasesrc.c line 2323
  • #32 gst_task_func
    at gsttask.c line 234
  • #33 default_func
    at gsttaskpool.c line 70
  • #34 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.22.2/glib/gthreadpool.c line 265
  • #35 g_thread_create_proxy
    at /build/buildd/glib2.0-2.22.2/glib/gthread.c line 635
  • #36 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #37 clone
    from /lib/tls/i686/cmov/libc.so.6

As it seems the "caps" property is being set in one thread, which invokes the property changed notification and at the same time and at the same time the mainthread is trying to load the subtitles and sets the subtitle-encoding property, probably on the same object.

I guess a well positioned sleep would solve the race, but the real problem is th cross locking.
Comment 4 Balazs Scheidler 2009-11-06 07:37:57 UTC
Commenting out these lines in totem-preferences.c works around the problem for me:

encoding_changed_cb (GConfClient *client, guint cnxn_id,
                 GConfEntry *entry, Totem *totem)
{
        const gchar *encoding;
        GtkComboBox *item;

        item = GTK_COMBO_BOX (gtk_builder_get_object (totem->xml, "subtitle_encoding_combo"));
        encoding = gconf_value_get_string (entry->value);
-       totem_subtitle_encoding_set (item, encoding);
-       bacon_video_widget_set_subtitle_encoding (totem->bvw, encoding); */
+       /* totem_subtitle_encoding_set (item, encoding);
+       bacon_video_widget_set_subtitle_encoding (totem->bvw, encoding); */
}

of course this may not work if you have non-utf8 subtitles.
Comment 5 Sebastian Dröge (slomo) 2009-11-06 14:19:09 UTC
Thanks for taking the time to report this bug.
This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade.

*** This bug has been marked as a duplicate of bug 600479 ***