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 172892 - Gtk::Action::get_proxies should not free items.
Gtk::Action::get_proxies should not free items.
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-04-07 01:31 UTC by Philip Langdale
Modified: 2005-04-28 17:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the problem (1.66 KB, patch)
2005-04-27 17:49 UTC, Philip Langdale
committed Details | Review

Description Philip Langdale 2005-04-07 01:31:19 UTC
Version details: cvs
Distribution/Version: slackware + gsb

Gtk documents the semantics of gtk_action_get_proxies to be that a pointer to
the action's internal proxy list is returned. However, Gtk::Action::get_proxies
wraps this method with Glib::OWNERSHIP_SHALLOW meaning that the list is
incorrectly freed, so any attempt to call this method after the first time will
probably explode in a shower of sparks and flames.

The wrap call (if I'm reading my m4 right), should pass Glib::OWNERSHIP_NONE as
a third parameter.

I have also been told that there are other places where incorrect wrappings of
this type are taking place. This doesn't surprise me as the default ownership is
SHALLOW.
Comment 1 Murray Cumming 2005-04-07 13:32:52 UTC
Thanks. Could you try a patch for this, please? You are the best person to test
such a patch.

> I have also been told that there are other places where incorrect wrappings of
> this type are taking place.

Could you please tell them that they should also submit bugs?
Comment 2 Philip Langdale 2005-04-07 22:06:54 UTC
I've manually inspected the other uses of GSListHandle in gtkmm (not
gdk/pango/atk/glib) and the rest are correct.

The reason why this happened is because the signature for a list of widgets is
assumed to be SHALLOW but actions break this pattern.

I've confirmed that setting OWNERSHIP_NONE fixes the problem, but I can't
comment on the best way to fix the m4. Currently the SHALLOW assumption is made
in the master m4 script that ships with glibmm. I don't know if that can be
overridden locally or not.
Comment 3 Murray Cumming 2005-04-08 09:12:36 UTC
It can be overriden locally. Search for #m4 in the .hg files to find examples.
Comment 4 Murray Cumming 2005-04-21 11:29:18 UTC
How's this going? Do you need help?
Comment 5 Philip Langdale 2005-04-22 18:55:10 UTC
Well, I think I have a modification to action.hg to add the right m4 directives,
but how do I regenerate the files?
Comment 6 Murray Cumming 2005-04-23 08:18:12 UTC
If you are building from cvs then it should rebuild automatically when you run
make at the top level.

Here is some help on making patches, in case you need it:
http://www.gtkmm.org/bugs.shtml#CreatingPatches
Comment 7 Philip Langdale 2005-04-27 17:49:29 UTC
Created attachment 45746 [details] [review]
Patch to fix the problem

Ok, I was the code to regenerate and I was able to confirm that this change
causes the right ownership mode to be used. I can commit it if you're happy
with the change.
Comment 8 Murray Cumming 2005-04-28 08:49:44 UTC
Excellent. Please apply to both the HEAD and gtkmm-2-6 branches.
Comment 9 Philip Langdale 2005-04-28 17:10:31 UTC
Checked in on HEAD and gtkmm-2-6.