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 595602 - g_child_proxy_get_valist doesn't initialize GValue correctly
g_child_proxy_get_valist doesn't initialize GValue correctly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.22
Other Linux
: Normal normal
: 0.10.26
Assigned To: Stefan Sauer (gstreamer, gtkdoc dev)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-18 16:05 UTC by Frederik Sdun
Modified: 2009-10-07 08:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small test case (318 bytes, text/x-csrc)
2009-09-18 16:05 UTC, Frederik Sdun
  Details
initialize gvalue in _valist function (6.44 KB, patch)
2009-10-05 08:50 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Frederik Sdun 2009-09-18 16:05:46 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.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2009-09-18 21:16:52 UTC
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().
Comment 2 Sebastian Dröge (slomo) 2009-09-19 09:14:57 UTC
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.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-05 08:50:35 UTC
Created attachment 144769 [details] [review]
initialize gvalue in _valist function

I'll commit this after the code freeze.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-07 08:09:16 UTC
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.