pygobject reference leak fix causes a lot of PyGTK apps to fail

Bug #713115 reported by Marc Deslauriers
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
PyGTK
Fix Released
High
pygobject (Ubuntu)
Fix Released
High
Martin Pitt
Natty
Fix Released
High
Martin Pitt
pygtk (Ubuntu)
Invalid
High
Unassigned
Natty
Invalid
High
Unassigned

Bug Description

Binary package hint: virt-manager

After doing a dist-upgrade this morning, virt-manager gives this:

mdeslaur@mdlinux:~$ virt-manager --debug
2011-02-04 09:13:11,560 (virt-manager:161): Application startup
2011-02-04 09:13:11,717 (engine:344): About to connect to uris ['qemu:///system', 'qemu+ssh://mdeslaur@192.168.66.200/system', 'qemu:///session']
/usr/share/virt-manager/virtManager/manager.py:278: GtkWarning: IA__gtk_widget_get_realized: assertion `GTK_IS_WIDGET (widget)' failed
  self.destroy_vm)
/usr/share/virt-manager/virtManager/manager.py:278: Warning: instance of invalid non-instantiatable type `(null)'
  self.destroy_vm)
/usr/share/virt-manager/virtManager/manager.py:278: Warning: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  self.destroy_vm)
/usr/share/virt-manager/virtManager/manager.py:278: Warning: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  self.destroy_vm)
Bus error (core dumped)

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: virt-manager 0.8.4-8ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-1.28-generic 2.6.38-rc2
Uname: Linux 2.6.38-1-generic x86_64
Architecture: amd64
Date: Fri Feb 4 09:13:44 2011
EcryptfsInUse: Yes
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_CA:en
 PATH=(custom, user)
 LANG=en_CA.UTF-8
 LC_MESSAGES=en_CA.utf8
 SHELL=/bin/bash
SourcePackage: virt-manager

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Something changes in pygobject 2.27.0+git20110131 that causes this. Downgrading to 2.27.0+git20110108 makes it work again.

Revision history for this message
Martin Pitt (pitti) wrote :

Reproducible from a clean install without configuration.

Changed in pygobject (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
status: New → Triaged
tags: added: regression-release
Changed in pygobject (Ubuntu Natty):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

The crash is triggered by this commit:

  http://git.gnome.org/browse/pygobject/commit/?id=f0a0b6c2eda89622de2b1e5ebb6a48103ad72a42

That patch is really correct, as it fixes previously uncleaned references, i. e. fixes tons of memory leaks. The problem is that this uncovered a lot of bugs in GTK and the gobject-introspection annotations, so I would at least spend some time to see if we can fix the actual bug in pygtk or gtk before I revert it in our packages.

Martin Pitt (pitti)
affects: virt-manager (Ubuntu Natty) → pygtk (Ubuntu Natty)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

As this is the sort of master bug, bug #713135 and bug #713172 describe different issues with the new pygobject (in hamster-applet and meld).

Revision history for this message
Martin Pitt (pitti) wrote :

For the record, this seems to be a reasonably small reproducer which doesn't cause the segfault (yet), but at least reproduces the invalid references:

$ python -c 'import gtk; r=gtk.ImageMenuItem("foo"); i=gtk.image_new_from_icon_name("gtk-ok", gtk.ICON_SIZE_MENU); r.set_image(i)'
-c:1: Warning: invalid unclassed pointer in cast to `GtkWidget'
-c:1: GtkWarning: IA__gtk_widget_set_parent: assertion `GTK_IS_WIDGET (widget)' failed
-c:1: Warning: g_object_set: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `G_IS_OBJECT (object)' failed

(-c:7847): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

Revision history for this message
Martin Pitt (pitti) wrote :

I uploaded a workaround to limit the impact of this for now, to essentially bring it back to the old memleak state:

pygobject (2.27.0+git20110131-0ubuntu6) natty; urgency=low

  * Add revert-refleak.patch: Revert upstream commit f0a0b6c2eda for now.
    Fixing the reference leaks uncovered a few bugs in PyGTK which need to be
    fixed first. (See LP #713115, #713172, #713135)

 -- Martin Pitt <email address hidden> Fri, 04 Feb 2011 18:18:51 +0100

I forwarded the pygtk bug upstream with the small reproducer; I'll still look into this a bit further, though.

Changed in pygobject (Ubuntu Natty):
status: In Progress → Invalid
Changed in pygtk (Ubuntu Natty):
importance: Undecided → High
status: New → Triaged
summary: - [natty] virt-manager no longer starts with recent updates
+ pygobject reference leak fix causes a lot of PyGTK apps to fail
Revision history for this message
Martin Pitt (pitti) wrote :

Using this as the master bug for all those related problems, as the actual problem in pygtk needs to be analyzed and fixed first (and will hopefully be reasonably generic). Once it is confirmed to work for virt-manager and meld, we can check the others and unduplicate again, but this way thy are more closely linked together.

Changed in pygtk:
importance: Unknown → High
status: Unknown → New
Martin Pitt (pitti)
Changed in pygobject (Ubuntu Natty):
status: Invalid → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

For the record, in the upstream bug we now identified the cause for most of these crashes and have a proposed fix which will make pygtk work for the new pygobject. This at least fixes the gtk.Image test case and virt-manager, but not meld yet; I'm hunting the latter now.

Revision history for this message
Martin Pitt (pitti) wrote :

meld works as well now, it was just messing with $PYTHONPATH. I'll finish the discussion upstream and have the patches committed, then I'll upload the lot.

Changed in pygobject (Ubuntu Natty):
status: Triaged → Fix Committed
Changed in pygtk (Ubuntu Natty):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → Fix Committed
Changed in pygtk:
status: New → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

We discussed that yesterday on IRC, and we now found a solution which keeps binary compatibility with existing pygtk. It's a hack, but it will do for the pygobject-2-28 branch. On the master branch, codegen will be removed entirely now.

Changed in pygtk (Ubuntu Natty):
assignee: Martin Pitt (pitti) → nobody
status: Fix Committed → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pygobject - 2.27.90-0ubuntu1

---------------
pygobject (2.27.90-0ubuntu1) natty; urgency=low

  * New upstream release.
  * Drop 0001-Revert-Remove-gio-static-bindings.patch,
    0002-GI-Run-gio-tests-separately-when-enabled.patch, applied upstream now.
  * Drop revert-refleak.patch, this was replaced with slightly better hack
    which brings back the ref leak fix for GI, but "emulates" the ref count
    bug for pygtk which relied on it (this hack only applies for pygobject
    2.28.x; later versions will have codegen, and thus pygtk support dropped
    entirely). (LP: #713115)
 -- Martin Pitt <email address hidden> Fri, 11 Feb 2011 18:13:49 +0100

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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