GNOME Bugzilla – Bug 583999
[basetransform] caps refcounting problem causing GST_IS_CAPS assertion failures
Last modified: 2010-04-13 20:15:47 UTC
Look at the test code attached and try to run it, it'll segfault after a a couple of seconds. What the test-code does is: - define a new bin subclass - a single sink pad and multiple src request pads - there is a tee element inside it - whenever someone request a bin pad the bin request a tee pad, add some elements and return the ghost pad - test client will request a new pad from the bin every N seconds and attach queue ! fakesink and check if buffers arrive at the fakesink element If you run it you'll see this output: (filtersbin2.py:6297): GStreamer-CRITICAL **: gst_caps_is_fixed: assertion `GST_IS_CAPS (caps)' failed (filtersbin2.py:6297): GStreamer-CRITICAL **: gst_caps_is_any: assertion `GST_IS_CAPS (caps)' failed (filtersbin2.py:6297): GStreamer-CRITICAL **: gst_caps_is_empty: assertion `GST_IS_CAPS (caps)' failed (filtersbin2.py:6297): GStreamer-CRITICAL **: gst_caps_is_any: assertion `GST_IS_CAPS (caps)' failed (filtersbin2.py:6297): GStreamer-CRITICAL **: gst_caps_is_empty: assertion `GST_IS_CAPS (caps)' failed Segmentation fault Looking at the GST_DEBUG output it seems a GstCaps is freed while still being used by a buffer. I don't know if i'm doing something wrong or if there's really a bug in gstreamer but i've already asked on the gst-ml and no-one was able to help me.. i did a lot of tests and always found this problem.
Created attachment 135436 [details] test program run with python filtersbin2.py
Looks like a caps refcount bug somewhere. Hard to say where though. Would be nice if you could try to reduce the complexity of the test case a bit. Moving to core for now. Stacktrace (interesting threads only):
+ Trace 215784
Thread 6 (Thread 0x7fc750f26950 (LWP 14260))
Thread 3 (Thread 0x7fc751f28950 (LWP 14257))
ANy chance you can make a C version of that to rule out something wrong with the python bindings?
I'll try to do a C version later this week. Thank you for looking at this problem!
Created attachment 137739 [details] C test case I've finally found time to do it.. i'm attaching a C version with the same segfault. Please tell me if i'm doing something wrong or there is a buf somewhere in gst.
of course you can compile with gcc -o filtersbin2 filtersbin2.c `pkg-config --cflags --libs gstreamer-0.10` -Wall -Werror
Some caps ref problems somewhere... very hard to track down.
Ok.. should i set this as a blocker now that pre-releases are out?
I found the problem. Basetransform was setting caps on non-metadata-writable buffers, which caused caps to disappear in elements. Too bad it did not make the release but it was not really a regression. You get this problem after a tee with multiple branches, then a queue and a basetransform based element after the queue. The tee to make the buffers non-writable in each of the transforms and the queue to cause enough threading to cause races. Will commit a patch after the freeze.
commit 6cf64beb79f18d3956e18d59860fe4b0eb7bfe35 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Aug 5 13:44:51 2009 +0200 basetransform: fix refcounting problem Add some more debug info. Make sure that the output buffer has writable metadata before we attempt to set caps on it. fixes #583999
Thank you so much!! It's working now! I have 'only' some hangs now.. will try to look better!
*** Bug 593488 has been marked as a duplicate of this bug. ***
*** Bug 575349 has been marked as a duplicate of this bug. ***
*** Bug 599215 has been marked as a duplicate of this bug. ***
*** Bug 584742 has been marked as a duplicate of this bug. ***
*** Bug 615622 has been marked as a duplicate of this bug. ***
*** Bug 601358 has been marked as a duplicate of this bug. ***