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 582102 - Starting a gtk.Builder application on a non-existing DISPLAY will segfault after warnings
Starting a gtk.Builder application on a non-existing DISPLAY will segfault af...
Status: RESOLVED DUPLICATE of bug 563823
Product: pygtk
Classification: Bindings
Component: glade
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-10 22:17 UTC by Bram Neijt
Modified: 2009-05-10 22:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bram Neijt 2009-05-10 22:17:23 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))
Comment 1 Paul Pogonyshev 2009-05-10 22:25:29 UTC
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 ***