[gstreamer-bugs] [Bug 566796] New: Deadlock using nested compositions

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Jan 6 10:04:33 PST 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=566796

  GStreamer | gnonlin | Ver: HEAD CVS
           Summary: Deadlock using nested compositions
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gnonlin
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: alessandro.d at gmail.com
         QAContact: bilboed at gmail.com
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Using nested compositions leads to a deadlock.
Here's helgrind output:

==18146== Thread #5: Attempt to re-lock a non-recursive lock I already hold
==18146==    at 0x4C26D35: pthread_mutex_lock (hg_intercepts.c:397)
==18146==    by 0xA2291C9: gnl_composition_event_handler (gnlcomposition.c:919)
==18146==    by 0x913A903: gst_pad_send_event (gstpad.c:4634)
==18146==    by 0xA230635: no_more_pads_object_cb (gnlcomposition.c:1583)
==18146==    by 0x626B25C: g_closure_invoke (in
/usr/lib/libgobject-2.0.so.0.1800.2)
==18146==    by 0x6280F5C: (within /usr/lib/libgobject-2.0.so.0.1800.2)
==18146==    by 0x6282607: g_signal_emit_valist (in
/usr/lib/libgobject-2.0.so.0.1800.2)
==18146==    by 0x6282B32: g_signal_emit (in
/usr/lib/libgobject-2.0.so.0.1800.2)
==18146==    by 0x9114E81: gst_element_no_more_pads (gstelement.c:835)
==18146==    by 0xA229BBC: gnl_composition_ghost_pad_set_target
(gnlcomposition.c:1004)
==18146==    by 0xA23044D: no_more_pads_object_cb (gnlcomposition.c:1574)
==18146==    by 0x626B25C: g_closure_invoke (in
/usr/lib/libgobject-2.0.so.0.1800.2)

The deadlock is on COMP_OBJECTS_LOCK. After some debugging i came up with
this patch:

Index: gnl/gnlcomposition.c
===================================================================
RCS file: /cvs/gstreamer/gnonlin/gnl/gnlcomposition.c,v
retrieving revision 1.80
diff -u -r1.80 gnlcomposition.c
--- gnl/gnlcomposition.c        28 Dec 2008 15:28:40 -0000      1.80
+++ gnl/gnlcomposition.c        6 Jan 2009 17:57:49 -0000
@@ -1000,8 +1000,11 @@
     gst_pad_set_active (comp->private->ghostpad, TRUE);
     if (!(gst_element_add_pad (GST_ELEMENT (comp), comp->private->ghostpad)))
       GST_WARNING ("Couldn't add the ghostpad");
-    else
+    else {
+      COMP_OBJECTS_UNLOCK (comp);
       gst_element_no_more_pads (GST_ELEMENT (comp));
+      COMP_OBJECTS_LOCK (comp);
+    }
   }
   GST_DEBUG_OBJECT (comp, "END");
 }

I _think_ it's safe to release the lock, but i'm not 100% sure.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=566796.




More information about the Gstreamer-bugs mailing list