Segmentation Fault in edubuntu-menueditor

Bug #682975 reported by Vincent Vinet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Edubuntu Menu Editor
Fix Committed
Low
Marc Gariépy

Bug Description

Segmentation Fault when launching bin/menueditor and X is unavailable

$ DISPLAY=no_thanks bin/menueditor

/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
bin/menueditor:369: Warning: invalid (NULL) pointer instance
  builder.add_from_file(ui_filename)
bin/menueditor:369: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  builder.add_from_file(ui_filename)
bin/menueditor:369: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  builder.add_from_file(ui_filename)
bin/menueditor:369: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  builder.add_from_file(ui_filename)
bin/menueditor:369: Warning: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean'
  builder.add_from_file(ui_filename)
/home/vince/src/menueditor/menueditor/MenuTreeModel.py:105: GtkWarning: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  self.icon_theme = gtk.icon_theme_get_default ()
bin/menueditor:105: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  self.tvMenu.append_column(column)
bin/menueditor:105: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  self.tvMenu.append_column(column)
bin/menueditor:119: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  self.tvMenu.append_column(column)
bin/menueditor:119: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  self.tvMenu.append_column(column)
bin/menueditor:388: GtkWarning: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
  window.show()
bin/menueditor:388: GtkWarning: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_context_set_font_description: assertion `context != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_context_set_base_dir: assertion `context != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_context_set_language: assertion `context != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_new: assertion `context != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_text: assertion `layout != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_attributes: assertion `layout != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_alignment: assertion `layout != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_width: assertion `layout != NULL' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_get_extents: assertion `layout != NULL' failed
  window.show()
bin/menueditor:388: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  window.show()
bin/menueditor:388: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_get_pixel_extents: assertion `PANGO_IS_LAYOUT (layout)' failed
  window.show()
bin/menueditor:388: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed
  window.show()
bin/menueditor:388: PangoWarning: pango_layout_set_wrap: assertion `PANGO_IS_LAYOUT (layout)' failed
  window.show()
bin/menueditor:388: GtkWarning: gtk_widget_size_allocate(): attempt to allocate widget with width -1050547 and height 4595
  window.show()
bin/menueditor:388: GtkWarning: gtk_widget_size_allocate(): attempt to allocate widget with width -1050560 and height 4625
  window.show()
bin/menueditor:388: GtkWarning: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed
  window.show()
bin/menueditor:388: GtkWarning: gdk_colormap_get_visual: assertion `GDK_IS_COLORMAP (colormap)' failed
  window.show()
bin/menueditor:388: GtkWarning: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed
  window.show()
bin/menueditor:388: GtkWarning: gdk_window_new: assertion `GDK_IS_WINDOW (parent)' failed
  window.show()
[1] 5937 segmentation fault DISPLAY=no_thanks bin/menueditor

Revision history for this message
Vincent Vinet (vince-vinet) wrote :

Here is a fix to catch the warning and the long series of asserts in gtk

a simple check of
window.get_screen() is not None

before
window.show()
in bin/menueditor

also does the trick, but shows an ugly trace of gtk asserts

Marc Gariépy (mgariepy)
Changed in menueditor:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Marc Gariépy (mgariepy)
Revision history for this message
Vincent Vinet (vince-vinet) wrote :

Other cleaner solution, but that shows a lot of gtk warnings

=== modified file 'bin/menueditor'
--- bin/menueditor 2010-09-15 19:04:17 +0000
+++ bin/menueditor 2010-11-30 13:56:58 +0000
@@ -385,6 +385,9 @@

     #run the application
     window = NewMenueditorWindow()
+ if not window.get_screen():
+ logging.critical('Screen not found')
+ sys.exit(1)
     window.show()
     gtk.main()

Marc Gariépy (mgariepy)
summary: - Segmentation Fault
+ Segmentation Fault in edubuntu-menueditor
Revision history for this message
Vincent Vinet (vince-vinet) wrote :

Much cleaner! :D

=== modified file 'bin/menueditor'
--- bin/menueditor 2010-09-15 19:04:17 +0000
+++ bin/menueditor 2010-11-30 14:03:32 +0000
@@ -359,6 +359,9 @@
     MenueditorWindow object. Use this function rather than
     creating a MenueditorWindow directly.
     """
+ if not gtk.gdk.display_get_default():
+ logging.critical("Display not found")
+ sys.exit(1)

     #look for the ui file that describes the ui
     ui_filename = os.path.join(getdatapath(), 'ui', 'MenueditorWindow.ui')

Revision history for this message
Vincent Vinet (vince-vinet) wrote :

Previous diff as a file

Revision history for this message
Vincent Vinet (vince-vinet) wrote :

Sorry :(

Revision history for this message
Marc Gariépy (mgariepy) wrote :

just commited the patch in the trunk.

Changed in menueditor:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.