GNOME Bugzilla – Bug 636609
d-feet causes segfault if started with $DISPLAY unset
Last modified: 2011-11-15 13:54:59 UTC
Hi, I'm forwarding a bugreport that have been opened in debian sometime ago: "When started with empty $DISPLAY, d-feet causes a segmentation fault. I did not explore further as to what the exact cause is, but if $DISPLAY is set so that it can connect to an X server, the segfault does not happen. Steps to reproduce: 1. % export DISPLAY="" 2. % d-feet Expected result: d-feet complains that it cannot open display, like xterm for example. Actual result: d-feet displays the following messages and segfaults: [19:34:17][tazle@pryan][~]% d-feet /var/lib/python-support/python2.5/gtk-2.0/gtk/__init__.py:72: GtkWarning: could not open display warnings.warn(str(e), _gtk.Warning) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: Unknown property: GtkAction.enabled self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: Warning: invalid (NULL) pointer instance self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: Warning: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean' self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: Screen for GtkWindow not set; you must always set a screen for a GtkWindow before using the window self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_context_set_font_description: assertion `context != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_context_set_base_dir: assertion `context != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_context_set_language: assertion `context != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_new: assertion `context != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_text: assertion `layout != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_attributes: assertion `layout != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_alignment: assertion `layout != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_set_width: assertion `layout != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_get_extents: assertion `layout != NULL' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: PangoWarning: pango_layout_get_pixel_extents: assertion `PANGO_IS_LAYOUT (layout)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: Invalid icon size 3 self.ui.add_from_file(ui_dir + '/' + file) /var/lib/python-support/python2.5/dfeet/_ui/uiloader.py:38: GtkWarning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed self.ui.add_from_file(ui_dir + '/' + file) zsh: segmentation fault d-feet " Original bugreport: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517251
import gtk in a try except block early so we catch errors like DISPLAY not being set. Fix is in master. I should have another release later this week