Bug 77211 - Gtk-CRITICAL errors when starting redhat-config-nfs
Gtk-CRITICAL errors when starting redhat-config-nfs
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-nfs (Show other bugs)
8.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Paul Cormier
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-03 05:43 EST by Peter van Egdom
Modified: 2013-01-10 16:29 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-16 12:22:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter van Egdom 2002-11-03 05:43:37 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

Description of problem:

(as recommended in Bugzilla bug id # 72797 this bug is openened against GTK).

This problem occurs on a reasonably fresh Red Hat Linux 8.0 install.

 (
   The following RPM's have been installed since initial install :
   - Java run-time environment.
   - Flash codec.
   - MP3 codecs.
   - NVIDIA drivers from the NVIDIA site.
   - Some Red Hat documentation from the documentation CD.
 )


When starting "redhat-config-nfs" the program crashes.

Other 'redhat-config-*' tools work fine, apart from some non-fatal
gtk/python errors.

Note, the source CD's have been 100%-CRC checked.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. type in "redhat-config-nfs" in an xterm.
2.
3.
	

Actual Results:  The program crashed.

Expected Results:  The program should have started.

Additional info:

This is the crash output :

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed

(redhat-config-nfs.py:28944): Gtk-CRITICAL **: file gtkitemfactory.c: line 958
(gtk_item_factory_create_item): assertion `entry->path[0] == '/'' failed
Traceback (most recent call last):
  File "/usr/share/redhat-config-nfs/redhat-config-nfs.py", line 29, in ?
    mainWindow.mainWindow()
  File "/usr/share/redhat-config-nfs/mainWindow.py", line 114, in __init__
    self.actionMenu = self.menuBar.get_children()[0].get_submenu()        
IndexError: list index out of range


Here are some installed RPM's :

redhat-config-nfs-1.0.1-3

gtk2-engines-1.9.0-4
gtkhtml-1.0.4-3
gtk+-1.2.10-22
pygtk2-libglade-1.99.12-7
gnome-python2-gtkhtml2-1.99.11-8
usermode-gtk-1.63-1
gtk-engines-0.11-13
gtkam-0.1.4-6
gtkglarea-1.2.2-13
rep-gtk-0.16.0.90-4
pygtk2-1.99.12-7
gtk2-2.0.6-8
gtkhtml2-2.0.1-2
Comment 1 Owen Taylor 2002-11-13 11:17:57 EST
The Gtk-Critical warning means that GTK+ detected the app doing something
bad.
Comment 2 Brent Fox 2002-11-19 14:54:34 EST
I don't see how the app could be "doing something bad".  

Here's a snippet of the code in question:

self.menuBar = gtk.MenuBar()
accel_group = gtk.AccelGroup()
item_fac = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group)

self.mainWindow.add_accel_group(accel_group)
item_fac.create_items([
     ((_('/_File')),                   None,    None, 0, '<Branch>'),
     ((_('/_File/_Add Share')),    None,    self.on_add_button_clicked, 6,
'<StockItem>', gtk.STOCK_ADD),
     ((_('/_File/_Properties')),       None,   
self.on_properties_button_clicked, 6, '<StockItem>', gtk.STOCK_PROPERTIES),
     ((_('/_File/_Delete')),           None,    self.on_delete_button_clicked,
6, '<StockItem>', gtk.STOCK_DELETE),
     ((_('/_File/_Quit')),             None,    self.destroy, 6, '<StockItem>',
gtk.STOCK_QUIT),
     ((_('/_Help')),                     None,    None, 0, '<Branch>'),
     ((_('/_Help/_Contents')),             None,  self.on_help_button_clicked,
1, '<StockItem>', gtk.STOCK_HELP),
     ((_('/_Help/_About')),              None,    self.on_about_clicked, 2, ''),
      ])

self.menuBar = item_fac.get_widget('<main>')
self.actionMenu = self.menuBar.get_children()[0].get_submenu()


owen: The traceback starts with IconFactory failing to add the items to the menu
properly.  Is there anything wrong with the way I'm calling create_items()?

By the way, this code works just fine on my test machine with a stock 8.0
install, so it's not easily reproducible.
Comment 3 Owen Taylor 2002-11-19 16:24:37 EST
Maybe the problem is in the translations? Might want
to try:

 LANG=nl_NL.UTF-8 redhat-config-nfs

(Guessing from the email address, haven't actually tried
it)

The way you've translated the menus in the above code is
not the recommended style. Item factory _paths_ should
never be translated. The way you are supposed to do
translations is to mark the paths as translateable
strings [ N_() in C ] and then use 
gtk_item_factory_set_translate_func() to set a translation
function, which in C is:

 char *
 my_translate_func (const char *path, gointer data)
 {
   return gettext (path);
 }

Hopefully this facility is bound in Python. GTK+ strips
all but the last component of the returned result from
the returned result when creating the menu items so 
that it doesn't matter if the translator translates the 
entire path or just the last component.
Comment 4 Brent Fox 2002-12-13 11:07:34 EST
Actually, I think the problem is coming from the fact that the nl.po file is not
UTF-8 encoded, and that is making GTK very confused.  All of the other po files
for redhat-config-nfs are UTF-8 encoded, and they all seem to work ok.

For example, this is what I see on my machine:

[bfox@bfox po]$ file nl.po
nl.po: ASCII English text

[bfox@bfox po]$ file de.po
de.po: UTF-8 Unicode English text

As you can see, de.po is UTF-8 encoded but nl.po is not.  I have tried
converting nl.po to UTF-8 with iconv, but it doesn't seem to work.  I'm going to
transfer ownership of this bug to pgampe since he is the translastion master.

pgampe, what needs to happen to make nl.po UTF-8 encoded?
Comment 5 Paul Gampe 2002-12-15 18:15:14 EST
Running the file command on the current CVS version of nl.po says it is it  
plain english, but I have confirmed via iconv that it is valid utf-8.  
  
When I compiled and installed the current CVS nl.po file the above error no  
longer occurs.  So I'd say this is solved once the new .po files are picked 
up.  
  
Comment 6 Brent Fox 2002-12-16 12:22:25 EST
pgampe: I think you're right.  I no longer see the encoding errors with
redhat-config-nfs-1.0.2-2.  I wonder why file is incorrect, though.  Resolving
as Rawhide.

Note You need to log in before you can comment on or make changes to this bug.