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 680202 - Segfault in Xkl.Engine constructor
Segfault in Xkl.Engine constructor
Status: RESOLVED DUPLICATE of bug 647731
Product: pygobject
Classification: Bindings
Component: introspection
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-18 20:36 UTC by Manuel Quiñones
Modified: 2012-07-19 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Manuel Quiñones 2012-07-18 20:36:40 UTC
This gives a segmentation fault:

  from gi.repository import Xkl
  Xkl.Engine()

Now I know that the proper usage is to call Xkl.Engine.get_instance(display) to get an engine, thanks to the testecase here [1].  However, no constructor should provoke a segfault.

[1] http://cgit.freedesktop.org/libxklavier/tree/tests/test_gi.py
Comment 1 Martin Pitt 2012-07-19 04:12:03 UTC
The segfault is coming from libxklavier.

This is not actually a public constructor, as with Xkl.Engine() you call the GObject constructor to allocate a new XklEngine object. Obviously we cannot forbid using the GObject constructor since one needs it for many other places.

It would be nice to somehow say "do not call the GObject constructor for this class", but there is no real way to do that.

So for now, "just don't do that".

*** This bug has been marked as a duplicate of bug 647731 ***
Comment 2 Tomeu Vizoso 2012-07-19 06:19:10 UTC
Manuel, I thought you were going to file a bug against libxklavier about segfaulting without giving an appropriate error message.

Unfortunately, we cannot avoid all segfaults when using GObject-based libraries through PyGObject, but these libraries could do much better in giving hints about what happened.
Comment 3 Manuel Quiñones 2012-07-19 14:00:05 UTC
Martin, Tomeu, thanks for the explanation, now I know a bit more about the insides of pygi.

Tomeu, sorry I misunderstood you.  I could file a bug against libxklavier, but I was trying to debug this with gdb and I got no stack, and doesn't ask me to install debuginfo packages.