Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK segfault with GTK3 and mpl_toolkits #1813

Merged
merged 2 commits into from May 28, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented May 20, 2013

Something goes wrong when using a GTK3 backend and the mpl_toolkits. See this very minimal testcase:

>>> from gi.repository import Gtk
>>> import mpl_toolkits.axisartist
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Segmentatiefout (geheugendump gemaakt)

Most likely, something imports the old GTK2 bindings, run following for the same error:

>>> from gi.repository import Gtk
>>> import gtk

Grepping the sourcecode gives mpl_toolkits/gtktools.py where it is used, but I can't even find where it is imported.

@mdboom
Copy link
Member

mdboom commented May 20, 2013

This looks as if you do not have the development files for Gtk3 installed. Would you mind testing the attached patch? It should give you an error message to this effect.

try:
gi.require_version("Gtk", "3.0")
except ValueError:
raise ImportError("Gtk3 backend gtk3 development files to be installed.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing word: "requires".
Also, this has me puzzled, because I can run the gtk3agg backend on ubuntu Precise, but I don't have the libgtk-3-dev package installed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems things are packaged somewhat differently on Debian/Ubuntu than on Fedora. I think on Ubuntu, the required package is: gir1.2-gtk3.0 https://launchpad.net/ubuntu/precise/+package/gir1.2-gtk-3.0

Since we don't really know what distro the user will be using, I'm inclined to change this to:

"The Gtk3 backend requires that the GObject introspection bindings for Gtk 3 are installed."

That should give a user enough to Google something by.

mdboom added a commit that referenced this pull request May 28, 2013
GTK segfault with GTK3 and mpl_toolkits
@mdboom mdboom merged commit dd38945 into matplotlib:master May 28, 2013
mdboom added a commit that referenced this pull request May 28, 2013
GTK segfault with GTK3 and mpl_toolkits
@mdboom mdboom deleted the gtk3-version-check branch August 7, 2014 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants