GNOME Bugzilla – Bug 555384
MRO error crash when accessing the 'focus_widget' property of a file selection dialog
Last modified: 2010-10-20 23:45:31 UTC
Steps to reproduce: 1. Run the test_pygtk_crash.py test file with filechooser.glade in the same directory. Stack trace: TypeError: Cannot create a consistent method resolution order (MRO) for bases ImplementorIface, CellEditable, Editable, Buildable ** ERROR:/build/buildd/pygobject-2.15.3/gobject/pygobject.c:920:pygobject_new_full: assertion failed: (tp != NULL) Aborted (core dumped) Other information: As a developer of LottaNZB (a PyGTK app), I recently gave our application a try on Ubuntu Intrepid, with the latest updates applied (python-gtk2 2.13, python-gobject 2.15.3). The application unexpectedly crashed when opening the file selection dialog with the following error message: TypeError: Cannot create a consistent method resolution order (MRO) for bases ImplementorIface, CellEditable, Editable, Buildable ** ERROR:/build/buildd/pygobject-2.15.3/gobject/pygobject.c:920:pygobject_new_full: assertion failed: (tp != NULL) Aborted (core dumped) Trying to locate the problem, I dove into the code of Kiwi, the PyGTK framework we use in our application. I finally found the line of code which caused this issue. To my surprise it wasn't a Kiwi-specific problem, as I was able to reproduce it with pure PyGTK code. This crash happens whenever the developer tries to access the property 'focus_widget' of a gtk.FileChooserDialog or a dialog that contains a gtk.FileChooserWidget after the dialog's show() method was invoked. This issue can only be reproduced using Intrepid, but not using Hardy, that's why I assume that the bug is caused by certain changes recently made in python-gtk or python-gobject The only way to prevent the application from crashing is to ensure that this property isn't accessed (when using Kiwi by overwriting the check_focus method). Test case is attached.
Created attachment 120111 [details] Python file to reproduce the crash
Created attachment 120112 [details] Glade file to reproduce the crash
Potentially duplicate of bug 538401.
This bug might might be related to bug 538401, but I'm not sure if it's really a duplicate. The test script works flawlessly on Ubuntu Hardy (python-gtk2 2.12.1 and python-gobject 2.14.2) while it crashes with the above error message on Ubuntu Intrepid (python-gtk2 2.13 and python-gobject 2.15.3). That's why the bug must have been introduced recently, since bug 538401 was filed against python-gobject 2.14 (Ubuntu Hardy).
No, but bug 538401 is triggered by accessing certain objects which contain certain interfaces. A libgtk+ change (a widget gaining a new GInterface, under the hood) could also trigger the same bug. It is not unconceivable that pygobject 2.14.x with a new libgtk2 could exhibit the same bug being reported here. But, hey, maybe it really isn't duplicate, I'm just adding clues if anyone wants to investigate.
My comment might have been a little harsh. Sorry for that. I don't know much about the internals of pygobject and pygtk, that's why it will be difficult for me to help solving this issue.
Hey, I am usually the one who is harsh; I am not very sensitive to that sort of thing :-) I think the results of your experiments are very useful facts; it's just that the conclusion from those facts may not be as straightforward, and we should not rule out a bug already present in pygobject 2.14.
BTW, I cannot reproduce this problem. What GTK+, PyGObject and PyGTK versions do you have?
Severin ping to Paul question?
I can reproduce this with the current debian sid gtk 2.16.2, pygobject 2.16.1, and pygtk 2.14.1 packages.
Works for me...