GNOME Bugzilla – Bug 589253
null-ok parameter annotation not correctly handled for virtual methods
Last modified: 2010-06-21 15:51:56 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.
Created attachment 138912 [details] [review] patch to correct the bug
(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?
Created attachment 140308 [details] Test case which show up the bug
Created attachment 140309 [details] GDB trace of the bug
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.
We also have this problem in Rhythmbox (see bug 613658). Is there anything I can do to help resolve this?
(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.
(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.
The patch works perfectly for me.
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
Am I supposed to be committing the patch? Or is someone else going to do it?