GNOME Bugzilla – Bug 680202
Segfault in Xkl.Engine constructor
Last modified: 2012-07-19 14:00:05 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
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 ***
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.
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.