Python GC destroys PyGObject with external references

Bug #1728461 reported by Cédric Bellegarde
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pygobject
Fix Released
Medium
pygobject (Ubuntu)
New
Undecided
Unassigned

Bug Description

PyGObject traverses its closures in tp_traverse, but the lifetime of the closures
is tied to the lifetime of the GObject and not the wrapper. This confuses
the Python GC when it sees a ref cycle and tries to break it up with tp_clear.
Since tp_clear will not invalidate the closure and only invalidate the Python
wrapper the closure callback gets called with the now cleared/invalid object.

This bug make python gtk programs to segfault randomly.

Patch available here:
https://bugzilla.gnome.org/show_bug.cgi?id=731501

Should apply to 3.24 or be easily backported: one line patch adding a if statement.

Changed in pygobject:
importance: Unknown → Medium
status: Unknown → 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.