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 142514 - GStreamer segfaults when linking elements from the tail to the head of a pipeline
GStreamer segfaults when linking elements from the tail to the head of a pipe...
Status: RESOLVED DUPLICATE of bug 138012
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.1
Other Linux
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-14 04:23 UTC by Patrick Guimond
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Source of the sample code that works as expected (942 bytes, text/plain)
2004-05-14 04:24 UTC, Patrick Guimond
Details
Source of the sample code that causes a segmentation fault (946 bytes, text/x-csrc)
2004-05-14 04:25 UTC, Patrick Guimond
Details

Description Patrick Guimond 2004-05-14 04:23:03 UTC
When using a tee element, linking an element to its sink pad AFTER a source has
already been linked to it makes it segfault when setting the pipeline to state
PLAYING.

When the sink pad is linked to an element BEFORE the source has been linked, the
tee works as expected.


Example of a tee that works (sink pad linked BEFORE the source):
tee_works.c:


#include <gst/gst.h>

int main (int argc, char *argv[])
{
  GstElement *pipeline, *sine, *tee, *audiosink;
  GstPad *src, *sink;
  gst_init (&argc, &argv);

  pipeline = gst_pipeline_new ("main");
  sine = gst_element_factory_make ("sinesrc", "source");
  tee = gst_element_factory_make ("tee", "splitter");
  audiosink = gst_element_factory_make ("alsasink", "ouput");

  gst_bin_add_many (GST_BIN(pipeline), sine, tee, audiosink, NULL);

  /* Linking the elements */
  /* Linking the sink of the tee BEFORE requesting and linking a source pad */
  gst_element_link_many (sine, tee, NULL);

  sink = gst_element_get_pad (audiosink, "sink");
  src = gst_element_get_request_pad (tee, "src%d");
  gst_pad_link (src, sink);



  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  while (gst_bin_iterate (GST_BIN (pipeline)));

  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (GST_OBJECT (pipeline));

  return 0;
}




Example of a tee that causes a segmentation fault (sink pad linked AFTER a
source pad has been linked):
tee_segfaults.c:


#include <gst/gst.h>

int main (int argc, char *argv[])
{
  GstElement *pipeline, *sine, *tee, *audiosink;
  GstPad *src, *sink;
  gst_init (&argc, &argv);

  pipeline = gst_pipeline_new ("main");
  sine = gst_element_factory_make ("sinesrc", "source");
  tee = gst_element_factory_make ("tee", "splitter");
  audiosink = gst_element_factory_make ("alsasink", "ouput");

  gst_bin_add_many (GST_BIN(pipeline), sine, tee, audiosink, NULL);

  /* Linking the elements */
  sink = gst_element_get_pad (audiosink, "sink");
  src = gst_element_get_request_pad (tee, "src%d");
  gst_pad_link (src, sink);

  /* Linking the sink of the tee AFTER a source pad has been requested and linked */
  gst_element_link_many (sine, tee, NULL);


  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  while (gst_bin_iterate (GST_BIN (pipeline)));

  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (GST_OBJECT (pipeline));

  return 0;
}


The sample code above has been attached to the bug.

The code was compiled using gstreamer 0.8.1, compiled with gcc 3.3.3
Command line used to compile:
gcc -o works -Wall -g  `pkg-config --cflags --libs  gstreamer-0.8` tee_works.c
gcc -o works -Wall -g  `pkg-config --cflags --libs  gstreamer-0.8` tee_segfaults.c
Comment 1 Patrick Guimond 2004-05-14 04:24:16 UTC
Created attachment 27683 [details]
Source of the sample code that works as expected
Comment 2 Patrick Guimond 2004-05-14 04:25:06 UTC
Created attachment 27684 [details]
Source of the sample code that causes a segmentation fault
Comment 3 Benjamin Otte (Company) 2004-05-17 00:45:21 UTC
This is a bug with the opt scheduler, --gst-scheduler=entrygthread makes it work.

*** This bug has been marked as a duplicate of 138012 ***