(gdb) t 32
(gdb) bt
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffff5b044ef in _L_lock_1081 () from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff5b04468 in __GI___pthread_mutex_lock (mutex=0x99da70) at ../nptl/pthread_mutex_lock.c:134
#3  0x00007ffff70f3355 in g_mutex_lock () from /data/builds/IPC-WIP/pc/zinc-install-root/debug/debian-8-x86_64/oss/lib/libglib-2.0.so.0
#4  0x00007ffff7622cbb in update_degree (element=0x99c030, bit=0x7fffb8012490) at gstbin.c:2006
#5  0x00007ffff709737e in g_list_foreach () from /data/builds/IPC-WIP/pc/zinc-install-root/debug/debian-8-x86_64/oss/lib/libglib-2.0.so.0
#6  0x00007ffff7623310 in gst_bin_sort_iterator_resync (bit=0x7fffb8012490) at gstbin.c:2129
#7  0x00007ffff76234c2 in gst_bin_sort_iterator_new (bin=0x9712c0) at gstbin.c:2168
#8  0x00007ffff76235a1 in gst_bin_iterate_sorted (bin=0x9712c0) at gstbin.c:2197
#9  0x00007ffff76252a1 in gst_bin_change_state_func (element=0x9712c0, transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstbin.c:2669
#10 0x00007ffff7686fe9 in gst_pipeline_change_state (element=0x9712c0, transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstpipeline.c:499
#11 0x00007ffff765873c in gst_element_change_state (element=0x9712c0, transition=GST_STATE_CHANGE_PAUSED_TO_PLAYING) at gstelement.c:2604
#12 0x00007ffff762638f in gst_bin_continue_func (data=0x7fffb8003050) at gstbin.c:3001
#13 0x00007ffff70caca0 in g_thread_pool_thread_proxy () from /data/builds/IPC-WIP/pc/zinc-install-root/debug/debian-8-x86_64/oss/lib/libglib-2.0.so.0
#14 0x00007ffff70ca5ab in g_thread_proxy () from /data/builds/IPC-WIP/pc/zinc-install-root/debug/debian-8-x86_64/oss/lib/libglib-2.0.so.0
#15 0x00007ffff5b020a4 in start_thread (arg=0x7fffaaffd700) at pthread_create.c:309
#16 0x00007ffff466e04d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) l 1972
1967	 * added to the queue of elements to schedule next.
1968	 *
1969	 * We have to make sure not to cross the bin boundary this element
1970	 * belongs to.
1971	 */
1972	static void
1973	update_degree (GstElement * element, GstBinSortIterator * bit)
1974	{
1975	  gboolean linked = FALSE;
1976	
(gdb) 
1977	  GST_OBJECT_LOCK (element);
1978	  /* don't touch degree if element has no sinkpads */
1979	  if (element->numsinkpads != 0) {
1980	    /* loop over all sinkpads, decrement degree for all connected
1981	     * elements in this bin */
1982	    GList *pads;
1983	
1984	    for (pads = element->sinkpads; pads; pads = g_list_next (pads)) {
1985	      GstPad *pad, *peer;
1986	
(gdb) 
1987	      pad = GST_PAD_CAST (pads->data);
1988	
1989	      /* we're iterating over the sinkpads, check if it's busy in a link/unlink */
1990	      if (G_UNLIKELY (find_message (bit->bin, GST_OBJECT_CAST (pad),
1991	                  GST_MESSAGE_STRUCTURE_CHANGE))) {
1992	        /* mark the iterator as dirty because we won't be updating the degree
1993	         * of the peer parent now. This would result in the 'loop detected'
1994	         * later on because the peer parent element could become the best next
1995	         * element with a degree > 0. We will simply continue our state
1996	         * changes and we'll eventually resync when the unlink completed and
(gdb) 
1997	         * the iterator cookie is updated. */
1998	        bit->dirty = TRUE;
1999	        continue;
2000	      }
2001	
2002	      if ((peer = gst_pad_get_peer (pad))) {
2003	        GstElement *peer_element;
2004	
2005	        if ((peer_element = gst_pad_get_parent_element (peer))) {
2006	          GST_OBJECT_LOCK (peer_element);
(gdb) 
2007	          /* check that we don't go outside of this bin */
2008	          if (GST_OBJECT_CAST (peer_element)->parent ==
2009	              GST_OBJECT_CAST (bit->bin)) {
2010	            gint old_deg, new_deg;
2011	
2012	            old_deg = HASH_GET_DEGREE (bit, peer_element);
2013	
2014	            /* check to see if we added an element as sink that was not really a
2015	             * sink because it was connected to some other element. */
2016	            if (old_deg == -1) {
(gdb) p element
$12 = (GstElement *) 0x99c030
(gdb) p peer_element
$13 = (GstElement *) 0x99c030

