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 635436 - Crash insert actiongroups in a UIManager
Crash insert actiongroups in a UIManager
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-21 14:28 UTC by Paolo Borelli
Modified: 2010-11-22 23:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (161 bytes, text/plain)
2010-11-21 14:29 UTC, Paolo Borelli
  Details
patch (1.44 KB, patch)
2010-11-22 23:32 UTC, Paolo Borelli
none Details | Review

Description Paolo Borelli 2010-11-21 14:28:59 UTC
the attached simple program crashes:

Starting program: /usr/bin/python testag.py
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x000000311bf31896 in __strcmp_ssse3 () from /lib64/libc.so.6
(gdb) bt
  • #0 __strcmp_ssse3
    from /lib64/libc.so.6
  • #1 gtk_ui_manager_insert_action_group
    at gtkuimanager.c line 722
  • #2 ffi_call_unix64
    from /usr/lib64/libffi.so.5
  • #3 ffi_call
    from /usr/lib64/libffi.so.5
  • #4 g_function_info_invoke
    at girepository/gifunctioninfo.c line 417
  • #5 ??
    from /usr/lib64/python2.7/site-packages/gtk-2.0/gi/_gi.so
  • #6 PyEval_EvalFrameEx
    from /usr/lib64/libpython2.7.so.1.0
  • #7 PyEval_EvalCodeEx
    from /usr/lib64/libpython2.7.so.1.0
  • #8 PyEval_EvalFrameEx
    from /usr/lib64/libpython2.7.so.1.0
  • #9 PyEval_EvalCodeEx
    from /usr/lib64/libpython2.7.so.1.0
  • #10 PyEval_EvalCode
    from /usr/lib64/libpython2.7.so.1.0
  • #11 ??
    from /usr/lib64/libpython2.7.so.1.0
  • #12 PyRun_FileExFlags

Comment 1 Paolo Borelli 2010-11-21 14:29:26 UTC
Created attachment 174957 [details]
test program
Comment 2 Paolo Borelli 2010-11-21 14:46:27 UTC
actually here the bug is that pygi allows anonymous actiongroups. The crash is due to the fact that gtk requires actiongroups to have names:

...
      if (strcmp (gtk_action_group_get_name (group), group_name) == 0)
        {
...


PyGtk does indeed error out for anon action groups:

>>> import gtk
>>> ag = gtk.ActionGroup()
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
TypeError: Required argument 'name' (pos 1) not found

Comment 3 johnp 2010-11-22 23:09:32 UTC
Ah, yes.  Easy fix.  Make sure there is an override which requires the name parameter.  This is due to the fact that we don't use constructors but instead call g_object_new.  Perhaps this should be fixed in GTK to require the name property be set when constructing the object.  I bet this will be a common issue and I would like to not have to write overrides for all of them.
Comment 4 Paolo Borelli 2010-11-22 23:11:48 UTC
Yeah, the main reason why I did not make a patch was because I was hoping there was a generic way to fix this scenario...
Comment 5 Paolo Borelli 2010-11-22 23:32:57 UTC
Created attachment 175072 [details] [review]
patch
Comment 6 johnp 2010-11-22 23:34:16 UTC
Comment on attachment 175072 [details] [review]
patch

Ha, I just fixed this.  Should have said I was going to do that :)
Comment 7 Paolo Borelli 2010-11-22 23:48:46 UTC
No worries, it wasn't an hour of work :-)