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 780202 - introspection: Don't expose GValueArray.free
introspection: Don't expose GValueArray.free
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-03-17 14:27 UTC by Nicolas Dufresne (ndufresne)
Modified: 2017-09-11 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valuearray: Skip g_value_array_free() in bindings (798 bytes, patch)
2017-03-17 14:52 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2017-03-17 14:27:54 UTC
I know this is all deprecated, but I think we should keep it safe. Right now, we expose GObject.ValueArray.free in bindings, which can lead to crash. In Python:

from gi.repository import GObject
v = GObject.ValueArray()
v.append(1234)
v.free()
v.get_nth(1)

I think that this function should be skipped. Correct me if I'm wrong. In anycase the interpretor should never crash.
Comment 1 Nicolas Dufresne (ndufresne) 2017-03-17 14:52:02 UTC
Created attachment 348184 [details] [review]
valuearray: Skip g_value_array_free() in bindings

Calling this function can easily lead to an interpreter crash.
Comment 2 Emmanuele Bassi (:ebassi) 2017-03-17 15:04:03 UTC
Review of attachment 348184 [details] [review]:

Yes, this should definitely be skipped, but the gobject-introspection data for GLib is generated inside gobject-introspection itself, so it'll need to be re-generated there.
Comment 4 Nicolas Dufresne (ndufresne) 2017-03-17 16:03:11 UTC
Oh, ok, didn't know, I guess we need both this patch and a GI updated.
Comment 5 Philip Withnall 2017-09-11 20:12:35 UTC
Pushing this now; will regenerate the gobject-introspection data for GLib later.

Attachment 348184 [details] pushed as 0d9c512 - valuearray: Skip g_value_array_free() in bindings
Comment 6 Philip Withnall 2017-09-11 20:52:34 UTC
(In reply to Philip Withnall from comment #5)
> Pushing this now; will regenerate the gobject-introspection data for GLib
> later.

In fact, it looks like the general approach the gobject-introspection maintainers are taking is to update the annotations once for each GLib release; so let’s go with that.