[Bug 742954] New: Crash when two treads are in handle_new_sample at the same time.

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jan 14 22:04:37 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=742954
  GStreamer | gst-rtsp-server | unspecified

           Summary: Crash when two treads are in handle_new_sample at the
                    same time.
    Classification: Platform
           Product: GStreamer
           Version: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-rtsp-server
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: goran.jonsson at axis.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=294571)
 View: https://bugzilla.gnome.org/attachment.cgi?id=294571
 Review: https://bugzilla.gnome.org/review?bug=742954&attachment=294571

patch in gst-rtsp-server

There is a possibility to crash if two threads are in function
handle_new_sample in file rtsp-stream.c at the same time. One thread for rtp
and one thread for rtcp. 

One thread is manipulating the list tr_cache and even free it. The other one is
iterating the list.

We have only seen this crash once. But if insert 1s sleeps like this.

static void
clear_tr_cache (GstRTSPStreamPrivate * priv)
{
  g_list_foreach (priv->tr_cache, (GFunc) g_object_unref, NULL);
  g_list_free (priv->tr_cache);
  g_usleep(1000000);
  priv->tr_cache = NULL;
}

static GstFlowReturn
handle_new_sample (GstAppSink * sink, gpointer user_data)
,
,
,

  g_mutex_unlock (&priv->lock);

  g_usleep(1000000);
  for (walk = priv->tr_cache; walk; walk = g_list_next (walk)) {
    GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data;

    if (is_rtp) {
      gst_rtsp_stream_transport_send_rtp (tr, buffer);
    } else {
      gst_rtsp_stream_transport_send_rtcp (tr, buffer);
    }
  }

And repeatedly open and close a rtsp tunneled sessions it's easy to reproduce.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list