GNOME Bugzilla – Bug 595602
g_child_proxy_get_valist doesn't initialize GValue correctly
Last modified: 2009-10-07 08:09:25 UTC
Created attachment 143450 [details] small test case g_child_proxy_get_valist initializes the value with {0,} which is an invalid id and causes g_child_proxy_get_property and g_object_get_property to fail with this messages: (gsttest:29578): GStreamer-CRITICAL **: gst_child_proxy_get_property: assertion `G_IS_VALUE (value)' failed (gsttest:29578): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.20.1/gobject/gtype.c:3940: type id `0' is invalid (gsttest:29578): GLib-GObject-WARNING **: can't peek value table for type `<invalid>' which is not currently referenced Program received signal SIGSEGV, Segmentation fault.
Hmm, maybe gst_child_proxy_get_property() should do g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); before calling g_object_get_property().
Yes, it should probably do the same magic that g_object_get_property() is doing. Everything else would be inconsistent... That said, the G_IS_VALUE() assertion would still happen ;) For convenience use we should have a gst_child_proxy_get() that does the same as g_object_get() and works without GValues.
Created attachment 144769 [details] [review] initialize gvalue in _valist function I'll commit this after the code freeze.
commit 940fdf25cfd717b7c8e6daf8c164fd5972e56092 Author: Stefan Kost <ensonic@users.sf.net> Date: Mon Oct 5 11:46:34 2009 +0300 childproxy: initialize gvalue in _valist function. Fixes #595602 Reflow the code to move error handling to the end of the functions. Initialize gvalue like we do in the setter. Add a unit-test module with two simple tests the catche this bug.