[gst-devel] segmentation fault creating a cap

Tim Müller t.i.m at zen.co.uk
Wed Jan 3 10:45:29 CET 2007

On Tue, 2007-01-02 at 23:36 +0100, 25fps 48kHz wrote:


> (...) So, i put my hands on punching some keys and modify the app
> to apply those properties to the cap. That led me to the segmentation
> fault I mentioned in the subject. I have attached below the code of
> the app (I can trace the segfault with gdb if desired). I can override
> the segmentation fault if, instead of using gst_caps_new_simple(), i
> create the cap with gst_caps_new_full().
>  ...
> (..), and i get this error in stdout:
> GStreamer-CRITICAL **: gst_pad_set_caps: assertion `caps == NULL ||
> gst_caps_is_fixed (caps)' failed ) . 
>  ...
> So, the execution of the following piece of code printed in stdout
> GLib-GObject-WARNING **: can't peek value table for type `(null)'
> which is not currently referenced
> GLib-GObject-WARNING **: gvalue.c:96: cannot initialize GValue with
> type `(null)', this type has no GTypeValueTable implementation
> GLib-GObject-WARNING **: gtype.c:3337: type id `0' is invalid
> GLib-GObject-WARNING **: can't peek value table for type `<invalid>'
> which is not currently referenced
> Segmentation fault

The easiest thing to track this down is to make GLib abort on warnings,

  $ export G_DEBUG=fatal_warnings

then it will break automatically in gdb and you can see exactly where
the warning comes from.

Some quick notes on your code:

 - the "framerate" field should be a GST_TYPE_FRACTION in 0.10
   (used to be a double in 0.8), 

 - that link_with_filter() function doesn't really look right - you
   just set caps on a pad from an application. You should insert a
   element and set your filtercaps on that to force a particular format.
   The GStreamer function gst_element_link_filtered () will do this for
   Also, return values are always good to check, especially when linking

  - a GMainLoop is not a GObject or a GstObject, you need to unref
    it with g_main_loop_unref().


More information about the gstreamer-devel mailing list