Calls Xkl.Engine() gobject constructor which is invalid; needs to use Xkl.Engine.get_instance

Bug #950087 reported by Stéphane Graber
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
High
Stéphane Graber
Precise
Fix Released
High
Stéphane Graber

Bug Description

stgraber@castiana:~/data/code/ubiquity/ubiquity$ python
Python 2.7.2+ (default, Feb 16 2012, 18:47:58)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Xkl
>>> test = Xkl.Engine()
Segmentation fault (core dumped)

Mostly annoying as it's blocking the bugfix for bug 800561

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: python2.7-minimal 2.7.2-13ubuntu5
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
ApportVersion: 1.94.1-0ubuntu1
Architecture: amd64
Date: Thu Mar 8 12:04:58 2012
ExecutablePath: /usr/bin/python2.7
ProcCmdline: python
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm
 LANG=en_US.UTF-8
SegvAnalysis:
 Segfault happened at: 0x7f6446e98bef: movslq 0xe0(%r12),%rax
 PC (0x7f6446e98bef) ok
 source "0xe0(%r12)" (0x000000e0) not located in a known VMA region (needed readable region)!
 destination "%rax" ok
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: python2.7
StacktraceTop:
 ?? () from /usr/lib/libxklavier.so.16
 g_object_newv () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
 ?? () from /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
 ?? () from /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
 ?? ()
Title: python2.7 crashed with SIGSEGV in g_object_newv()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: pkcs11

Related branches

Revision history for this message
Stéphane Graber (stgraber) wrote :
affects: python2.7 (Ubuntu) → libxklavier (Ubuntu)
visibility: private → public
Revision history for this message
Apport retracing service (apport) wrote :

Stacktrace:
 #0 0x00007f6446e98bef in ?? ()
 No symbol table info available.
 #1 0x0000000000000000 in ?? ()
 No symbol table info available.
StacktraceTop:
 ?? ()
 ?? ()

Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
tags: added: apport-failed-retrace
tags: removed: need-amd64-retrace
Changed in libxklavier (Ubuntu):
importance: Undecided → High
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Martin Pitt (pitti)
tags: added: rls-p-tracking
Changed in libxklavier (Ubuntu Precise):
status: New → In Progress
assignee: Canonical Desktop Team (canonical-desktop-team) → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote : Re: python2.7 crashed with SIGSEGV in g_object_newv() when using gi binding for xklavier (gir1.2-xkl-1.0)

This is not a bug. The API does not publicly expose the constructor, i. e. Xkl.Engine.new() does not exist. Xkl.Engine() invokes the GObject constructor on it, which we cannot hide unfortunately.

The API documentation [1] shows that you need to use the singleton function Xkl.Engine.get_instance(display) for this. This works fine, the upstream code has a test script for all this, which you might steal from [2].

[1] http://xlibs.freedesktop.org/xkbdesc/doc/libxklavier-xkl-engine.html#xkl-engine-get-instance
[2] http://cgit.freedesktop.org/libxklavier/tree/tests/test_gi.py

Changed in libxklavier (Ubuntu Precise):
status: In Progress → Triaged
affects: libxklavier (Ubuntu Precise) → ubiquity (Ubuntu Precise)
Changed in ubiquity (Ubuntu Precise):
assignee: Martin Pitt (pitti) → Stéphane Graber (stgraber)
summary: - python2.7 crashed with SIGSEGV in g_object_newv() when using gi binding
- for xklavier (gir1.2-xkl-1.0)
+ Calls Xkl.Engine() gobject constructor which is invalid; needs to use
+ Xkl.Engine.get_instance
Revision history for this message
Stéphane Graber (stgraber) wrote :

Fixed in trunk, thanks Martin for the help.

Changed in ubiquity (Ubuntu Precise):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 2.9.27

---------------
ubiquity (2.9.27) precise; urgency=low

  * Port keyboard indicator from xklavier to Xkl and from gconf to gsettings.
    Update the test accordingly. (LP: #950087, LP: #800561)
  * Add bin/ubiquity-bluetooth-agent, a bluetooth agent allowing any HID
    bluetooth device for 5 minutes, then spawning bluetooth-applet if
    available, otherwise simply dies.
  * Start bluetooth-applet from ubiquity-dm (LP: #644198)
  * Copy /var/lib/bluetooth to /target/var/lib/bluetooth to keep the list
    of trusted devices on the target system. (LP: #644198)
  * Update PO template and translations for new bluetooth string.
  * Automatic update of included source packages: netcfg 1.68ubuntu14,
    partman-auto 93ubuntu20, partman-auto-loop 0ubuntu21.
 -- Stephane Graber <email address hidden> Fri, 09 Mar 2012 12:11:19 -0500

Changed in ubiquity (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.