GNOME Bugzilla – Bug 582102
Starting a gtk.Builder application on a non-existing DISPLAY will segfault after warnings
Last modified: 2009-05-10 22:25:29 UTC
The code posted below will result in a segmentation fault when using a proper glade file, but a non-existing display is specified. Saving the code as builder.py and running: $ DISPLAY=:747 ./builder.py Will result in the following output: /var/lib/python-support/python2.6/gtk-2.0/gtk/__init__.py:72: GtkWarning: could not open display warnings.warn(str(e), _gtk.Warning) ./show.py:9: Warning: invalid (NULL) pointer instance builder.add_from_file('treeviewed.glade') ./show.py:9: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gdk_display_get_window_at_pointer: assertion `GDK_IS_DISPLAY (display)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed builder.add_from_file('treeviewed.glade') ./show.py:9: GtkWarning: Invalid icon size 1 builder.add_from_file('treeviewed.glade') Segmentation fault This bug is on the fact that it will segfault even though it already noticed the display not being there. I would expect it to crash in a more graceful manner. The test was done on Ubuntu Jaunty, with package python-pygtk2 version 2.14.1-1ubuntu1 installed. The code used: #!/usr/bin/python import pygtk pygtk.require("2.0") import gtk def main(args): builder = gtk.Builder() assert builder builder.add_from_file('treeviewed.glade') assert builder window = builder.get_object("window") assert window assert hasattr(window, 'show') window.show() assert hasattr(gtk, 'main') gtk.main() return 0 if __name__ == '__main__': import sys sys.exit(main(sys.argv))
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 563823 ***