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 640968 - seg fault when creating Applet via python
seg fault when creating Applet via python
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: libpanel-applet
git master
Other Linux
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks: 619818
 
 
Reported: 2011-01-30 20:15 UTC by Enrico Minack
Modified: 2011-02-24 12:46 UTC
See Also:
GNOME target: 3.0
GNOME version: ---



Description Enrico Minack 2011-01-30 20:15:25 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
Comment 1 Germán Poo-Caamaño 2011-01-30 21:00:51 UTC
Could you attach the test case?
Comment 2 Fabio Durán Verdugo 2011-01-31 02:54:51 UTC
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.
Comment 3 Germán Poo-Caamaño 2011-02-02 19:28:45 UTC
Reopening the bug.  I did not realize the test case
is already in the report.
Comment 4 Enrico Minack 2011-02-04 20:31:55 UTC
What is the status of this issue? It blocks porting the gnome-applets to gnome3.
Comment 5 Tomeu Vizoso 2011-02-24 11:29:01 UTC
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')
Comment 6 Vincent Untz 2011-02-24 11:39:15 UTC
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 :/
Comment 7 Vincent Untz 2011-02-24 12:46:54 UTC
Okay, I've made things work. I'll post instructions in the gnome-applets bug.