Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 195465

Summary: Porthole 0.5.0 segfaults when run as root
Product: Portage Development Reporter: Greg Toombs <greg.toombs>
Component: Third-Party ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, gentoo
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Greg Toombs 2007-10-11 05:19:17 UTC
When I start porthole without root permission, the application is fine.

When I run porthole with gksudo, it spits out the following:

/usr/bin/porthole:62: GtkDeprecationWarning: gtk.threads_init is deprecated, use gtk.gdk.threads_init instead
  gtk.threads_init()
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: Warning: invalid (NULL) pointer instance
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: GtkWarning: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: Warning: g_object_get: assertion `G_IS_OBJECT (object)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: Warning: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean'
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: GtkWarning: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_context_set_font_description: assertion `context != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_context_set_base_dir: assertion `context != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_context_set_language: assertion `context != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_new: assertion `context != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_text: assertion `layout != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_attributes: assertion `layout != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_alignment: assertion `layout != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_set_width: assertion `layout != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_get_extents: assertion `layout != NULL' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: PangoWarning: pango_layout_get_pixel_extents: assertion `PANGO_IS_LAYOUT (layout)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: GtkWarning: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)
/usr/lib/python2.4/site-packages/porthole/mainwindow.py:95: GtkWarning: gdk_keymap_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed
  self.wtree = gtk.glade.XML(self.gladefile, "main_window", self.prefs.APP)


Reproducible: Always

Steps to Reproduce:
In a console, run

gksudo porthole &
Comment 1 Willard Dawson 2007-10-12 23:30:29 UTC
I also am experiencing a runtime failure with porthole when run as root. When run as non-root, the application executes OK, with only the following error output:

/usr/bin/porthole:62: GtkDeprecationWarning: gtk.threads_init is deprecated, use gtk.gdk.threads_init instead
  gtk.threads_init()
/usr/lib/python2.5/site-packages/porthole/utils.py:31: DeprecationWarning: The sre module is deprecated, please import re.
  import sre

However, when run as root, a longer stream of errors is output, and the applicatoin exits right away (without displaying the GUI, even):

/usr/bin/porthole:62: GtkDeprecationWarning: gtk.threads_init is deprecated, use gtk.gdk.threads_init instead
  gtk.threads_init()
/usr/lib/python2.5/site-packages/porthole/utils.py:31: DeprecationWarning: The sre module is deprecated, please import re.
  import sre
Traceback (most recent call last):
  File "/usr/bin/porthole", line 184, in <module>
    prefs = _utils.PortholePreferences(prefs_additions)
  File "/usr/lib/python2.5/site-packages/porthole/utils.py", line 241, in __init__
    dom = XMLManager(self.__PFILE)
  File "/usr/lib/python2.5/site-packages/porthole/xmlmgr.py", line 111, in __init__
    self.__dom = parse(source)
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/minidom.py", line 1915, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/expatbuilder.py", line 926, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.5/site-packages/_xmlplus/dom/expatbuilder.py", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 1, column 0
Exception exceptions.AttributeError: "XMLManager instance has no attribute '_XMLManager__dom'" in <bound method XMLManager.__del__ of <porthole.xmlmgr.XMLManager instance at 0x864d10c>> ignored

If you need a stacktrace, it will take me until the end of next week to get back to that, due to other commitments (sorry).
Comment 2 Greg Toombs 2007-10-25 00:41:52 UTC
From the output of gksudo porthole, I now get

/usr/bin/porthole:62: GtkDeprecationWarning: gtk.threads_init is deprecated, use gtk.gdk.threads_init instead
  gtk.threads_init()
/usr/lib/python2.5/site-packages/porthole/utils.py:31: DeprecationWarning: The sre module is deprecated, please import re.
  import sre

and it doesn't start.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2008-05-29 13:06:23 UTC
Sorry, It has taken so long to find this bug on porthole.  I have been very busy and never thought to check bugzilla.

The only thing I can think of for all these is that a user recently had the problem that it would not run as root but was OK as a user.  It turned out that it was a corrupted ./porthole/prefs.xml file. When he deleted it operation returned to normal.

For the original poster:  For whatever reason, it seems to have failed reading the glade file.  It is possible that your /root/.porthole/prefs.xml file is corrupted, so it did not get a correct file name.  Try renaming or deleting it.  It may also affect any newer versions of porthole.

For comment #1:   this line in your output:

xml.parsers.expat.ExpatError: no element found: line 1, column 0

indicates that your /root/.porthole/prefs.xml file is corrupted for sure.  Deleting it will restore operation.



For comment #2: There is not enough output there to determine any cause.  Please run it from a terminal with the -d flag to turn on debug printing.  Also if it runs as your user without gksudo, then it is likely that your prefs.xml file is also corrupted.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2009-06-01 08:14:33 UTC
The latest release of porthole version-0.6.0_rc5 has code changes to allow it to continue booting with a corrupted prefs.xml file. It will instead boot with the default options.  Also porthole-0.5.0 will also be very soon getting out of date with changes to portage.
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2009-10-27 14:33:54 UTC
porthole-0.5.0 has been removed from tree, please upgrade to >=porthole-0.6.0.