[gst-devel] A hang inside gst_task_join()

Loc Nguyen loc.x.nguyen at oracle.com
Sat Jun 5 04:33:11 CEST 2010


Hi,

We've found a rare hang that occurs on unreferencing a pipeline.  We set 
the pipeline to GST_STATE_NULL then unref it.  The hang occurs inside of 
gst_task_join().  I'm happy to debug and fix it, but I am trying to 
understand the intent of some code here.  Inside of gst_task_join(), 
there is the following code:

  task->state = GST_TASK_STOPPED;
  /* signal the state change for when it was blocked in PAUSED. */
  GST_TASK_SIGNAL (task);
  /* we set the running flag when pushing the task on the thread pool.
   * This means that the task function might not be called when we try
   * to join it here. */
  while (G_LIKELY (task->running))
    GST_TASK_WAIT (task);

It so happens the task is already running so the join function waits on 
the task to finish.  However, the task is running gst_queue_loop() and 
waiting for queue->item_add cond variable.  There must be some intent on 
signaling the queue so it can break out of this wait.  I just cannot 
figure out how gstreamer intended to do this.  Any ideas?  Btw, this 
hang does not always occur.  It's rare, but on my specific machine, it 
occurs frequent enough for me to trace it down to this.

Thanks,
-Loc




More information about the gstreamer-devel mailing list