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 589253 - null-ok parameter annotation not correctly handled for virtual methods
null-ok parameter annotation not correctly handled for virtual methods
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: codegen
Git master
Other All
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-21 14:25 UTC by Ludovic L'Hours
Modified: 2010-06-21 15:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
patch to correct the bug (3.25 KB, patch)
2009-07-21 14:31 UTC, Ludovic L'Hours
committed Details | Review
Test case which show up the bug (704 bytes, text/plain)
2009-08-10 08:58 UTC, Ludovic L'Hours
  Details
GDB trace of the bug (2.77 KB, text/plain)
2009-08-10 08:59 UTC, Ludovic L'Hours
  Details

Description Ludovic L'Hours 2009-07-21 14:25:11 UTC
Steps to reproduce:
1. Create a Python class which implement an interface which contains a method with null-ok string parameter (gtk.Buildable.add_child)
2. Call this method from C with a null parameter (or use gtk.Builder in our case)
3. application crashes with a segfault in the corresponding proxy method.

Stack trace:


Other information:
Find a patch to codegen in attachement.
Comment 1 Ludovic L'Hours 2009-07-21 14:31:44 UTC
Created attachment 138912 [details] [review]
patch to correct the bug
Comment 2 Paul Pogonyshev 2009-08-08 20:25:00 UTC
(In reply to comment #0)
> Create a Python class...

I assume you created such a class.  Can you attach so that we all see what you mean?
Comment 3 Ludovic L'Hours 2009-08-10 08:58:06 UTC
Created attachment 140308 [details]
Test case which show up the bug
Comment 4 Ludovic L'Hours 2009-08-10 08:59:19 UTC
Created attachment 140309 [details]
GDB trace of the bug
Comment 5 Ludovic L'Hours 2009-08-10 09:08:57 UTC
Segfault happens on call to the proxy of GtkBuildable.add_child, whose 'type' 
parameter could be null (because of no "type" attribute in XML UI definition).

The proposed patch always checked for null string parameter and either throw an 
exception when null string is not permitted or use None otherwise.

Of course, in order to get the proper behavior of this testcase, null-ok 
parameter has to be added to the interface description of GtkBuildable.add_child 
virtual method.
Comment 6 Jonathan Matthew 2010-03-27 03:26:32 UTC
We also have this problem in Rhythmbox (see bug 613658).  Is there anything I can do to help resolve this?
Comment 7 Ludovic L'Hours 2010-04-02 07:42:10 UTC
(In reply to comment #6)
> We also have this problem in Rhythmbox (see bug 613658).  Is there anything I
> can do to help resolve this?

It seems that gobject/codegen didn't evolve much since I posted this bug.
My patch was not even reviewed, I guess the project is in lack of man-power.
Comment 8 Gian Mario Tagliaretti 2010-04-03 19:14:51 UTC
(In reply to comment #7)

> It seems that gobject/codegen didn't evolve much since I posted this bug.
> My patch was not even reviewed, I guess the project is in lack of man-power.

you are right Ludovic, the project desperately lacks man-power.

(In reply to comment #6)

> We also have this problem in Rhythmbox (see bug 613658).  Is there anything I
> can do to help resolve this?

Jonathan if you could test Ludovic's patch that would help a lot.
Comment 9 Jonathan Matthew 2010-04-03 22:21:14 UTC
The patch works perfectly for me.
Comment 10 Gian Mario Tagliaretti 2010-04-04 07:44:45 UTC
I will release a 2.17.1 which will include this patch among other things, please everyone give a shoot to the new release before it becomes 2.18.0
Comment 11 Jonathan Matthew 2010-05-26 08:38:00 UTC
Am I supposed to be committing the patch?  Or is someone else going to do it?