GNOME Bugzilla – Bug 566903
gst.Pad.iterate_internal_links may raise critical warning or segfault
Last modified: 2009-01-08 12:25:51 UTC
Core gst_pad_iterate_internal_links() might return NULL rather than an actual iterator, e.g. if the pad has no parent or not an Element as parent (e.g. in ghostpad/proxypad setting), which pygst_iterator_new and friends do not seem to appreciate. An interactive session can reproduce as exampled below (if debug GST_PADS >= 4 segfault occurs). As to a fix; maybe core should not return NULL, but an empty list/iterator, or pygst should come up with an "empty" one, or throw exception, or ... ? Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gst >>> p = gst.Pad('p', gst.PAD_SRC) >>> it = p.iterate_internal_links() >>> it.next() (.:20394): GStreamer-CRITICAL **: gst_iterator_next: assertion `it != NULL' failed Traceback (most recent call last):
+ Trace 211358
>>> quit() (.:20394): GStreamer-CRITICAL **: gst_iterator_free: assertion `it != NULL' failed
Created attachment 125932 [details] [review] Patch if it was to be fixed in gst-python If this issue was to be fixed, here's a proposal patch to make gst-python's GstIterator constructors raise an exception if the GstIterator is NULL. Minimalistic unit test along with it.
Do we want this in for the upcoming release ?
Seems like a sensible thing to have to me. I'm also for the idea that the core should be consistent in what it returns (an empty iterator when needed), rather than NULL.
Marking as blocker, and waiting for blessing from the Archbishop of the church of All That Starts In V.
2009-01-08 Edward Hervey <edward.hervey@collabora.co.uk> * gst/pygstiterator.c: (pygst_iterator_new): * testsuite/test_iterator.py: Raise an Exception when wrapping a NULL GstIterator. Fixes #566903