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 650654 - gst-rtsp-server segmentation fault when stressed with PAUSE/UNPAUSE
gst-rtsp-server segmentation fault when stressed with PAUSE/UNPAUSE
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-20 10:48 UTC by Miguel Angel Cabrera Moya
Modified: 2012-11-20 10:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Miguel Angel Cabrera Moya 2011-05-20 10:48:40 UTC
From time to time the gst-rtsp-server segfaults when stressed with PAUSE/PLAY requests.

I am using Ubuntu 11.04 with GStreamer PPA, gst-rtsp-server is from git.

At the server side i run ./test-launch "( videotestsrc ! video/x-raw-yuv, width=640, height=480, framerate=50/1 ! x264enc ! rtph264pay name=pay0 pt=96 )"

Client used to reproduce the bug.

#include <gst/gst.h>

static void element_added_signal(GstBin * bin, GstElement * element, gpointer * user_data);

static GMainLoop *loop;

static gboolean
bus_call (GstBus * bus, GstMessage * msg, gpointer data)
{
  GMainLoop *loop = (GMainLoop *) data;

  switch (GST_MESSAGE_TYPE (msg)) {
    case GST_MESSAGE_EOS:{
      g_print ("End-of-stream\n");
      g_main_loop_quit (loop);
      break;
    }
    case GST_MESSAGE_ERROR:{
      gchar *debug;
      GError *err;

      gst_message_parse_error (msg, &err, &debug);
      g_free (debug);

      g_print ("Error: %s\n", err->message);
      g_error_free (err);

      g_main_loop_quit (loop);

      break;
    }
    default:
      break;
  }
  return TRUE;
}

static gboolean
free_pipeline(gpointer data)
{
	g_main_loop_quit (loop);
	
	return FALSE;
}

static gboolean
switch_state(gpointer data)
{
	GstElement *pipeline = (GstElement *) data;
	static gboolean paused = 0;

	if (paused) {
		gst_element_set_state (pipeline, GST_STATE_PLAYING);
	} else {
		gst_element_set_state (pipeline, GST_STATE_PAUSED);
	}

	paused = !paused;

	return TRUE;
}

static void
element_added_signal(GstBin * bin, GstElement * element, gpointer * user_data)
{
  char *name;

  name = gst_element_get_name(element);

  if (strcmp(name, "uridecodebin0") == 0) {
    g_signal_connect(element, "element-added", G_CALLBACK(element_added_signal), NULL);
  } else if (strcmp(name, "source") == 0) {
      g_object_set(element, "protocols", 0x00000004, NULL);
  } 
}

gint
main (gint argc, gchar * argv[])
{
  GstElement *pipeline;
  GstBus *bus;
  gchar *uri;

  gst_init (&argc, &argv);

  pipeline = gst_element_factory_make("playbin2", NULL);
  g_object_set(pipeline, "uri", "rtsp://192.168.2.27:8554/test/");
  g_signal_connect(pipeline, "element-added", G_CALLBACK(element_added_signal), NULL);
  
  /* create and event loop and feed gstreamer bus mesages to it */
  loop = g_main_loop_new (NULL, FALSE);

  bus = gst_element_get_bus (pipeline);
  gst_bus_add_watch (bus, bus_call, loop);
  g_object_unref (bus);

  g_timeout_add (30000, free_pipeline, NULL);
  g_timeout_add (500, switch_state, pipeline);
  
  /* start play back and listen to events */
  gst_element_set_state (pipeline, GST_STATE_PLAYING);
  g_main_loop_run (loop);

  /* cleanup */
  gst_element_set_state (pipeline, GST_STATE_NULL);
  g_object_unref (pipeline);
  g_main_loop_unref (loop);

  return 0;
}

Backtrace


  • #0 handle_new_buffer
    at rtsp-media.c line 1163
  • #1 gst_app_sink_render_common
    at gstappsink.c line 807
  • #2 gst_base_sink_render_object
    at gstbasesink.c line 3005
  • #3 gst_base_sink_queue_object_unlocked
    at gstbasesink.c line 3286
  • #4 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3665
  • #5 gst_base_sink_chain_main
    at gstbasesink.c line 3703
  • #6 gst_pad_push
    at gstpad.c line 4684
  • #7 gst_tee_do_push
    at gsttee.c line 674
  • #8 gst_tee_handle_data
    at gsttee.c line 753
  • #9 gst_tee_chain
    at gsttee.c line 827
  • #10 gst_pad_push
    at gstpad.c line 4684
  • #11 gst_proxy_pad_do_chain
    at gstghostpad.c line 171
  • #12 gst_pad_push
    at gstpad.c line 4684
  • #13 gst_rtp_session_send_rtp
    at gstrtpsession.c line 1068
  • #14 source_push_rtp
    at rtpsession.c line 1191
  • #15 rtp_source_send_rtp
    at rtpsource.c line 1288
  • #16 rtp_session_send_rtp
    at rtpsession.c line 2403
  • #17 gst_rtp_session_chain_send_rtp_common
    at gstrtpsession.c line 1829
  • #18 gst_pad_push
    at gstpad.c line 4684
  • #19 gst_proxy_pad_do_chain
    at gstghostpad.c line 171
  • #20 gst_pad_push
  • #21 gst_proxy_pad_do_chain
    at gstghostpad.c line 171
  • #22 gst_pad_push
    at gstpad.c line 4684
  • #23 gst_basertppayload_push
    at gstbasertppayload.c line 897
  • #24 gst_rtp_h264_pay_payload_nal
    at gstrtph264pay.c line 890
  • #25 gst_rtp_h264_pay_handle_buffer
    at gstrtph264pay.c line 974
  • #26 gst_basertppayload_chain
    at gstbasertppayload.c line 455
  • #27 gst_pad_push
    at gstpad.c line 4684
  • #28 ??
    from /usr/lib/gstreamer-0.10/libgstx264.so
  • #29 ??
    from /usr/lib/gstreamer-0.10/libgstx264.so
  • #30 gst_pad_push
    at gstpad.c line 4684
  • #31 gst_base_transform_chain
    at gstbasetransform.c line 2458
  • #32 gst_pad_push
    at gstpad.c line 4684
  • #33 gst_base_src_loop
    at gstbasesrc.c line 2516
  • #34 gst_task_func
    at gsttask.c line 318
  • #35 default_func
    at gsttaskpool.c line 70
  • #36 ??
    from /lib/i386-linux-gnu/libglib-2.0.so.0
  • #37 ??
    from /lib/i386-linux-gnu/libglib-2.0.so.0
  • #38 start_thread
    from /lib/i386-linux-gnu/libpthread.so.0
  • #39 clone
    from /lib/i386-linux-gnu/libc.so.6

Comment 1 Sebastian Dröge (slomo) 2011-05-24 08:07:00 UTC
Could you attach a testcase application for the server and client side? Also, could you check in gdb why exactly it crashes there, e.g. which of the variables in the function has obviously invalid values, etc?
Comment 2 Miguel Angel Cabrera Moya 2011-05-25 09:23:07 UTC
I have already attached the testcase for server and client side.

The server side is run from a shell, while the client side is a c program.

About gdb, currently I am quite busy and I don't have time to debug this error.
Comment 3 Sebastian Dröge (slomo) 2011-05-27 07:28:54 UTC
The sample doesn't work for me, even after changing the IP in the client code to the correct one:

0:00:00.538873898  5200       0x636270 ERROR                rtspsrc gstrtspsrc.c:5511:gst_rtspsrc_open_from_sdp:<source> setup failed
Comment 4 Miguel Angel Cabrera Moya 2011-05-27 10:58:58 UTC
Maybe you don't have x264enc in server side or ffdec_h264 in client side. Could you check that?

When you run the client it needs to be run several times until the SEGV appears.

Also i have found that line

g_object_set(pipeline, "uri", "rtsp://192.168.2.1:8554/test/");

should be

g_object_set(pipeline, "uri", "rtsp://192.168.2.1:8554/test/", NULL);
Comment 5 Wim Taymans 2012-11-20 10:44:54 UTC
I can't seem to reproduce this anymore, might have been fixed with recent changes.