Bug 77211 - Gtk-CRITICAL errors when starting redhat-config-nfs
Summary: Gtk-CRITICAL errors when starting redhat-config-nfs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-nfs
Version: 8.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Paul Cormier
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-03 10:43 UTC by Peter van Egdom
Modified: 2013-01-10 21:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-16 17:22:25 UTC
Embargoed:


Attachments (Terms of Use)

Description Peter van Egdom 2002-11-03 10:43:37 UTC
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 16:17:57 UTC
The Gtk-Critical warning means that GTK+ detected the app doing something
bad.


Comment 2 Brent Fox 2002-11-19 19:54:34 UTC
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 21:24:37 UTC
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 16:07:34 UTC
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 23:15:14 UTC
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 17:22:25 UTC
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.