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 662133 - Crashes python when using create_context()
Crashes python when using create_context()
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-18 20:00 UTC by Michael Terry
Modified: 2012-11-29 11:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Terry 2011-10-18 20:00:32 UTC
I can crash Python in Ubuntu 11.10 using gtksourceview 3.2.2:

from gi.repository import GtkSource
v = GtkSource.View()
c = v.get_completion()
ctx = c.create_context(None)
dir(ctx)

Seems that the object returned by create_context has a refcount of 0.  This smells like another ref_sink issue.
Comment 1 Ignacio Casal Quinteiro (nacho) 2011-10-18 22:28:50 UTC
mmm, maybe some annotation problem?
Comment 2 Michael Terry 2011-10-19 11:55:00 UTC
The gir says the returned object is transfer-full.
Comment 3 Ignacio Casal Quinteiro (nacho) 2011-10-19 12:07:52 UTC
mmm, that might be the problem as the object an initiallyunkowned object.
Comment 4 Michael Terry 2011-10-19 12:17:51 UTC
I think that is correct though?  InitiallyUnowned objects start with a floating ref.  If it didn't say transfer-full, the object would end up being leaked because no one would take ownership of that floating ref, right?

I was thinking that the python wrapper object is using ref_sink and then unrefs it too soon (i.e. before the object is out of scope).
Comment 5 Ignacio Casal Quinteiro (nacho) 2011-10-19 13:12:51 UTC
I guess we should reassign this to pygobject
Comment 6 Martin Pitt 2012-04-22 15:07:06 UTC
Confirmed with 3.2.
Comment 7 Martin Pitt 2012-11-29 11:04:22 UTC
This is fixed in 3.7.x with the dropping of the static GSource bindings.