GNOME Bugzilla – Bug 640968
seg fault when creating Applet via python
Last modified: 2011-02-24 12:46:54 UTC
This python code creates a segmentation fault (Speicherzugriffsfehler): #!/usr/bin/env python import pygtk pygtk.require('2.0') from gi.repository import PanelApplet applet = PanelApplet.Applet() The error is: ./applet.py:7: Warning: g_closure_set_marshal: assertion `closure != NULL' failed applet = PanelApplet.Applet() (applet.py:9899): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion `G_IS_DBUS_CONNECTION (connection)' failed Speicherzugriffsfehler I have built a gnome3 environment using jhbuild and added libwnck and gnome-panel from the gtk-3 branch. Using PanelApplet.Applet.new() instead causes: /home/enrico/gnome/lib/python2.6/site-packages/gi/types.py:68: Warning: g_closure_set_marshal: assertion `closure != NULL' failed return info.invoke(cls, *args) (test.py:10408): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion `G_IS_DBUS_CONNECTION (connection)' failed Speicherzugriffsfehler
Could you attach the test case?
Thanks for taking the time to report this bug. This bug report isn't very useful because it doesn't describe the bug well. If you have time and can still reproduce the bug, please read http://bugzilla.gnome.org/bug-HOWTO.html and add a more useful description to this bug.
Reopening the bug. I did not realize the test case is already in the report.
What is the status of this issue? It blocks porting the gnome-applets to gnome3.
Seems to me that the problem is that PanelApplet doesn't support being instantiated with g_object_new. This seems to work: from gi.repository import Gio, PanelApplet bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) applet = PanelApplet.Applet(connection=bus, id='test')
I was looking at this already. The issue is that the API is not used correctly. I've added an error message in case other people fall in this trap. The short story is that you should never create an instance of PanelApplet yourself, but you should call panel_applet_factory_main(). However, the introspection data we have doesn't allow this :/
Okay, I've made things work. I'll post instructions in the gnome-applets bug.