After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 332545 - deskbar meet some trouble with internationalization variables
deskbar meet some trouble with internationalization variables
Status: RESOLVED FIXED
Product: deskbar-applet
Classification: Deprecated
Component: general
Git master
Other Linux
: Normal critical
: ---
Assigned To: Deskbar Applet Maintainer(s)
Deskbar Applet Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-02-25 15:09 UTC by Eloi Primaux
Modified: 2006-03-11 23:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (801 bytes, patch)
2006-03-11 20:33 UTC, Christian Persch
none Details | Review

Description Eloi Primaux 2006-02-25 15:09:46 UTC
Steps to reproduce:
launch deskbar-applet by the panel  or add it 


Stack trace:
Backtrace was generated from '/usr/Gnome-2.14/libexec/deskbar-applet'

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1211721536 (LWP 14609)]
0xffffe410 in ?? ()
  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 __waitpid_nocancel
    from /lib/libpthread.so.0
  • #5 libgnomeui_segv_handle
    from /usr/Gnome-2.14/lib/libgnomeui-2.so.0
  • #6 <signal handler called>
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 ??
  • #11 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #12 *__GI_abort
    at ../sysdeps/generic/abort.c line 88
  • #13 g_logv
    from /usr/Gnome-2.14/lib/libglib-2.0.so.0
  • #14 uiError
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #15 __xmlRaiseError
    from /usr/lib/libxml2.so.2
  • #16 __xmlErrEncoding
    from /usr/lib/libxml2.so.2
  • #17 xmlCurrentChar__internal_alias
    from /usr/lib/libxml2.so.2
  • #18 xmlParseAttValueInternal
    from /usr/lib/libxml2.so.2
  • #19 xmlParseAttValue__internal_alias
    from /usr/lib/libxml2.so.2
  • #20 xmlParseAttribute__internal_alias
    from /usr/lib/libxml2.so.2
  • #21 xmlParseStartTag__internal_alias
    from /usr/lib/libxml2.so.2
  • #22 xmlParseElement__internal_alias
    from /usr/lib/libxml2.so.2
  • #23 xmlParseContent__internal_alias
    from /usr/lib/libxml2.so.2
  • #24 xmlParseElement__internal_alias
    from /usr/lib/libxml2.so.2
  • #25 xmlParseContent__internal_alias
    from /usr/lib/libxml2.so.2
  • #26 xmlParseElement__internal_alias
    from /usr/lib/libxml2.so.2
  • #27 xmlParseContent__internal_alias
    from /usr/lib/libxml2.so.2
  • #28 xmlParseElement__internal_alias
    from /usr/lib/libxml2.so.2
  • #29 xmlParseDocument__internal_alias
    from /usr/lib/libxml2.so.2
  • #30 do_parse
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #31 impl_Bonobo_UIContainer_setNode
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #32 _ORBIT_skel_small_Bonobo_UIContainer_setNode
    from /usr/Gnome-2.14/lib/libbonobo-2.so.0
  • #33 ORBit_c_stub_invoke
    from /usr/Gnome-2.14/lib/libORBit-2.so.0
  • #34 Bonobo_UIContainer_setNode
    from /usr/Gnome-2.14/lib/libbonobo-2.so.0
  • #35 impl_xml_set
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #36 bonobo_ui_component_set
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #37 bonobo_ui_util_set_ui
    from /usr/Gnome-2.14/lib/libbonoboui-2.so.0
  • #38 _wrap_panel_applet_setup_menu_from_file
    from /usr/Gnome-2.14/lib/python2.4/site-packages/gtk-2.0/gnomeapplet.so
  • #39 PyCFunction_Call
    at Objects/methodobject.c line 77
  • #40 PyEval_EvalFrame
    at Python/ceval.c line 3547
  • #41 PyEval_EvalCodeEx
    at Python/ceval.c line 2730
  • #42 function_call
    at Objects/funcobject.c line 548
  • #43 PyObject_Call
    at Objects/abstract.c line 1751
  • #44 instancemethod_call
    at Objects/classobject.c line 2431
  • #45 PyObject_Call
    at Objects/abstract.c line 1751
  • #46 PyEval_CallObjectWithKeywords
    at Python/ceval.c line 3419
  • #47 PyInstance_New
    at Objects/classobject.c line 575
  • #48 PyObject_Call
    at Objects/abstract.c line 1751
  • #49 PyEval_EvalFrame
    at Python/ceval.c line 3755
  • #50 PyEval_EvalCodeEx
    at Python/ceval.c line 2730
  • #51 function_call
    at Objects/funcobject.c line 548
  • #52 PyObject_Call
    at Objects/abstract.c line 1751
  • #53 PyEval_CallObjectWithKeywords
    at Python/ceval.c line 3419
  • #54 PyObject_CallObject
    at Objects/abstract.c line 1742
  • #55 pyg_closure_marshal
    from /usr/Gnome-2.14/lib/python2.4/site-packages/gtk-2.0/gobject.so
  • #56 g_closure_invoke
    from /usr/Gnome-2.14/lib/libgobject-2.0.so.0
  • #57 bonobo_closure_invoke_va_list
    from /usr/Gnome-2.14/lib/libbonobo-2.so.0
  • #58 bonobo_closure_invoke
    from /usr/Gnome-2.14/lib/libbonobo-2.so.0
  • #59 ??
  • #60 ??
  • #61 ??
  • #62 g__construct_objects_lock_lock
    from /usr/Gnome-2.14/lib/libgobject-2.0.so.0
  • #63 ??
  • #64 ??
  • #65 g_value_get_flags
    from /usr/Gnome-2.14/lib/libgobject-2.0.so.0

Other information:
Other information:
## System libraries
(LFS-6.1 based system)
glibc 2.3.4
Xorg 6.9.0
libxml-2.0 2.6.22
glib-2.0 2.10.0
gtk+-2.0 2.8.12
libgnome-2.0 2.13.7
libgnomui-2.0 2.13.90
libbonobo-2.0 2.13.1
libbonoboui-2.0 2.13.2
libpanelapplet-2.0 2.13.92

evolution-data-server-1.6 1.5.91
CFLAGS=' -O3 -march=athlon-xp -msse -m3dnow
Comment 1 Raphael Slinckx 2006-02-26 00:50:22 UTC
Well, i can't say anything much wiser than 'Works For Me'
Could you also provide some output when run in console mode (start the deskbar with -w option) ?
Comment 2 Eloi Primaux 2006-02-26 09:20:15 UTC
ok i did it :

 /usr/Gnome-2.14/lib/deskbar-applet/deskbar-applet -w
Running installed deskbar, using [/usr/Gnome-2.14/lib/python2.4/site-packages/de skbar:$PYTHONPATH]
Data Dir: /usr/Gnome-2.14/share/deskbar-applet
Handlers Dir: ['/home/eloi/.gnome2/deskbar-applet/handlers', '/usr/Gnome-2.14/li b/deskbar-applet/handlers']
Binding Global shortcut <Alt>F3 to focus the deskbar
Starting Deskbar instance: <gnome.applet.Applet object (PanelApplet) at 0xb6499c d4> None
Layout changed to 1

XML-CRITICAL **: Input is not proper UTF-8, indicate encoding !
Bytes: 0xE9 0x66 0xE9 0x72

aborting...

i also did a rm -fr /home/eloi/.gnome2/deskbar-applet/handlers
just to check if it was from my conf

no the issue still the same

note i use libxml-2.0 2.6.22

Regards
Comment 3 Raphael Slinckx 2006-02-27 01:56:00 UTC
Well, i'm a bit confused here, this has never been brought up before, and i definitely don't see it here.. I don't know what we should do !

Probaby you can try cleaning everything and restarting from scratch ? Other than that.. i can't say many more unfortunately seems like a libxml problem anyhow
Comment 4 Fryderyk Dziarmagowski 2006-03-01 18:17:16 UTC
I can confirm this bug. It crashes with same critical xml message. Today I found, that running it with LC_ALL=C solves the problem. So, propably only non english deskbar-applet users are affected (my default setting is pl_PL)
Comment 5 Eloi Primaux 2006-03-05 12:47:11 UTC
i confirm the LC_ALL variable issue but for me it only cashes when this variable is undefined then when i set it to fr_FR or C or anything it works well
thus i've updated my profile to take care of this
thanks
Comment 6 Eloi Primaux 2006-03-05 12:49:40 UTC
could i close it ? 
Because it's not due to a deskbar-applet bug but a missing environment variable
Comment 7 Raphael Slinckx 2006-03-05 13:37:00 UTC
Closing as invalid, since this is not a deskbar bug but some obscure lang bug affecting one of the libraries in the stack..
Comment 8 Eloi Primaux 2006-03-05 16:51:03 UTC
Wait wait wait...

when you set LC_ALL to 'pl_PL' it crashes, when i set it to 'fr_FR' (i made a mistake in my last comm) it also crashes but when you set it to 'C' or when i set it to 'fr' it works properly

i read the locale manpage and i saw that if LC_ALL set to a non-empty string value, override the values of all the other internationalization variables

so
do we need to only set internationalization variables with the two first alphabetical characters ?? (the manpage(s) i read say no)
is it reproducible with all locales ?? (i think yes pl/pl_PL fr/fr_FR)
is it an deskbar only bug ?? (maybe no, but it worked well some weeks ago with the same locale configuration)
is it an libxml2 bug ?? (i think no)

that's why i think this "bug" is not yet resolved invalid it's only fixed by playing with locales variables
Comment 9 Eloi Primaux 2006-03-05 17:58:07 UTC
i've checked my locales and recreated them according to my conf
then deskbar works without problem, the fact is
as deskbar get better with time it won't work on system where defined locales are missing, you were true it wasn't an deskbar bug

Best regards
Eloi Primaux
Comment 10 Fryderyk Dziarmagowski 2006-03-06 08:36:50 UTC
It's not a missing enviroment variable!. My LC_ALL is _always_ set to pl_PL, and only 2.13.92 version is affected. I've just checked 2.13.{90,91} and it works perfectly in same enviroment (running libxml2 2.6.23 since 06.01.2006).
Comment 11 Eloi Primaux 2006-03-06 19:00:20 UTC
you're true and if you want to make it work you should check if you have all yours locales, i mean : if the /usr/share/locales/pl_PL exist and is populated, in doubt do this : localedef -i pl_PL -f ISO-8859-1 /usr/share/locale/pl_PL
this will recreate your pl_PL locale and deskbar will work correctly
Comment 12 Fryderyk Dziarmagowski 2006-03-06 21:09:48 UTC
My locales are generated properly. Setting LC_ALL is propably not best solution, so I've changed my .zshrc. LC_ALL is not set at all, only LANG is set to pl_PL, but deskbar-applet still crashes. Next try was setting LANG to pl_PL.UTF8 (default pl_PL encoding is ISO-8859-2 aka Latin2). Strange, but it works! Why deskbar-applet assumes that my default encoding is UTF8? So, I guess that something changed beetwen 2.13.91 and 2.13.92 that touches some parsing methods or something like that. The problem is: I'm not a python hacker, so making a vim -d will be propably pointless (I will try anyway ;>)
Comment 13 Raphael Slinckx 2006-03-06 21:59:50 UTC
Can i stress that it isn't directly a deskbar bug, since deskbar by itself doesn't manipulate any of these variables.

I know it uses lignome-desktop which might be affected, it also uses a lot of libraries to manipulate xml, python stuff, glib stuff, blah blah..
Comment 14 Eloi Primaux 2006-03-06 22:42:14 UTC
Maybe...  maybe not...
 But as far i understood this "bug" (which is not a bug) is due to some missing system locales, which make xml interpreters to fallback to C with incompatible system defined internationalization variables like LANG LC_TYPE ... .
This is,(i think) how the bug appears.
I don't think there will be an user friendly way of doing, to track and fix misconfigured systems and missing locales.
As an example my first system was an LFS-3.1, i have now an 6.1 (since a year) but locales setting has always been (for me) something from the dark side. And i never had any clue (or time) of how to do it correctly. This was, because none of all the applications i was using then, had issuing to me something like deskbar did.
In fact, i can say: "thanks to deskbar's trouble, i was able to fix my locales and now i have a clue of how to do it."

And to answer you, no i don't think you should stress with it.
But may i suggest you to put a sentence dealing with it in a FAC or the README, since locales setting is not deskbar's goal.

Regards
Comment 15 Fryderyk Dziarmagowski 2006-03-06 22:49:03 UTC
So, I've made a small investigation. Copying old Deskbar_Applet.xml (from 2.13.91) over file from 2.13.92 solves the problem.
Only difference is:
<menuitem name="Clear" verb="Clear" _label="_Clear History" pixtype="stock" pixname="gtk-delete"/>
And problematic place is white space between _Clear and History.
Comment 16 Raphael Slinckx 2006-03-06 22:56:12 UTC
Why is it problematic ?
Comment 17 Fryderyk Dziarmagowski 2006-03-06 23:01:27 UTC
It is problematic, because it causes a crash (removing white space solves the problem)
Comment 18 Fryderyk Dziarmagowski 2006-03-06 23:03:19 UTC
One more:
replacing _Clear History with _Clear\ History solves the crash too.
Comment 19 Raphael Slinckx 2006-03-06 23:11:52 UTC
Well then it's clearly a libbonobo-somewhere bug, that's parsing the bonobo xml file ?
Comment 20 Fryderyk Dziarmagowski 2006-03-07 07:12:57 UTC
It not so clear, libbonoboui works without smallest problem (there is small 'hello-world' test-program in tarball, I've just added some white spaces to _label and it works and shows such label properly).
Same test is present in gnome-python package. It works too, but everything after white space in _label is not shown.
Seems like bonobo.ui from gnome-python 2.12.x won't work with bonoboui 2.13.x properly (there is no gnome-python release for GNOME 2.14!).
Comment 21 Gustavo Carneiro 2006-03-07 19:01:17 UTC
From
"""
XML-CRITICAL **: Input is not proper UTF-8, indicate encoding !
Bytes: 0xE9 0x66 0xE9 0x72

aborting...
"""

I can only deduce that probably the french translator has put a message not in UTF-8 in the translation for "_Clear History".  Changing this string in the UI solves the crash because gettext no longer finds a translation therefore uses the original string which has no UTF-8 problem.

PS: there is no need for a new release of gnome-python for GNOME 2.14; unless people request new features or APIs, branching gnome-python is pointless.
Comment 22 Fryderyk Dziarmagowski 2006-03-07 23:03:56 UTC
If translation of a string from Deskbar_Applet.xml contains special UTF8 characters deskbar-applet crashes. Yes, it crashes with properly encoded string!
I've ripped out special chars from "_Clear History" translation and it works.
And it crashes *only* on that xml bonoboui file. For example de.po translation contains not UTF8 chars and only a warning is shown:

/usr/lib/python2.4/site-packages/deskbar/ui/DeskbarPreferencesUI.py:12: GtkWarning: Failed to set label from markup due to error parsing markup: Fehler in Zeile 1, Zeichen 9: UngĂźltiger UTF-8-kodierter Text
/usr/lib/python2.4/site-packages/deskbar/ui/DeskbarPreferencesUI.py:12: GtkWarning: Invalid input string
/usr/lib/python2.4/site-packages/deskbar/ui/DeskbarPreferencesUI.py:77: PangoWarning: Invalid UTF-8 string passed to pango_layout_set_text()

I've tested one more time hello.py from gnome-python tarball. I've changed _label="_About..." in Bonobo_Sample_Hello.xml and replaced "About" with some UTF8 special chars and it works without any warnings... 
Comment 23 Eloi Primaux 2006-03-11 12:45:19 UTC
Well it seems that the UTF-8 war isn't yet finished, thus i writted a small script to convert any file to UTF-8:


#!/bin/bash
# Begin iso2utf8 script
# use : iso2utf8 file
# eloi AT bliscat DOT org

cat "$1" | iconv -f UTF-8 -t UTF-8 >/dev/null
if [ $? = 0 ]; then
	echo "$1 is UTF-8"
	exit 2
fi
# The first matching ISO will be used
  CLIST="ISO-8859-1 \
	ISO-8859-2 \
	ISO-8859-3 \
	ISO-8859-4 \
	ISO-8859-5 \
	ISO-8859-6 \
	ISO-8859-7 \
	ISO-8859-8 \
	ISO-8859-9 \
	ISO-8859-10 \
	ISO-8859-11 \
	ISO-8859-13 \
	ISO-8859-14 \
	ISO-8859-15"
for i in $CLIST; do
cat "$1" | iconv -f $i -t $i >/dev/null
if [ $? = 0 ] ; then
	iconv -f $i -t UTF-8 "$1" >"$1.utf-8"
	mv "$1" "$1.old"
	mv "$1.utf-8" "$1"
	echo "$1 converted to UTF-8"
	exit 2
fi
done
# End iso2utf8 script

Comment 24 Fryderyk Dziarmagowski 2006-03-11 13:28:53 UTC
This is very nice try, but pl.po is _correctly_ encoded in UTF-8.
Comment 25 Raphael Slinckx 2006-03-11 15:48:53 UTC
Can you try to add

gettext.bind_textdomain_codeset('deskbar-applet', 'utf8')

after line 41:
     41 gettext.textdomain('deskbar-applet')
in deskbar/deskbar-applet.py

and see if it works..
Comment 26 Fryderyk Dziarmagowski 2006-03-11 16:24:19 UTC
still same critical warning. critical warining...?
How could I be so stupid :\

% G_DEBUG='' /usr/lib/deskbar-applet/deskbar-applet -w
Running installed deskbar, using [/usr/lib/python2.4/site-packages/deskbar:$PYTHONPATH]
Data Dir: /usr/share/deskbar-applet
Handlers Dir: ['/home/users/fritz/.gnome2/deskbar-applet/handlers', '/usr/lib/deskbar-applet/handlers']
Binding Global shortcut <Alt>F3 to focus the deskbar
Starting Deskbar instance: <gnome.applet.Applet object (PanelApplet) at 0xb626f43c> None
Layout changed to 1

(deskbar-applet:24850): XML-CRITICAL **: Input is not proper UTF-8, indicate encoding !
Bytes: 0xB6 0xE6 0x20 0x5F


(deskbar-applet:24850): XML-CRITICAL **: AttValue: ' expected


(deskbar-applet:24850): XML-CRITICAL **: attributes construct error


(deskbar-applet:24850): XML-CRITICAL **: Couldn't find end of Start Tag menuitem line 4


(deskbar-applet:24850): XML-CRITICAL **: Premature end of data in tag popup line 3


(deskbar-applet:24850): XML-CRITICAL **: Premature end of data in tag popups line 2


(deskbar-applet:24850): XML-CRITICAL **: Premature end of data in tag Root line 1

Loading module 'SieÄ' from file /usr/lib/deskbar-applet/handlers/web_address.pyc.

A visual result of this trick is: there is no right mouse click menu at all.
Comment 27 Eloi Primaux 2006-03-11 17:35:53 UTC
This is not reproducible, your locales may be corrupted:

I've created polish locale according of what you told me upper, and also created an user inwhich the environment is exactly the same as you reported (pl_PL) and the result is:
No errors, no error on special utf-8 character, no error whith deskbar even with the last release.

Then, sorry but it's your system which produce these errors.

Please could you recreate all your locales, i mean, everything including the C one.
Or more i think you should re-install glibc

note (it was fun to read gnome in polish)

Comment 28 Christian Persch 2006-03-11 18:35:00 UTC
I can reproduce this.
Comment 29 Eloi Primaux 2006-03-11 19:13:01 UTC
But, how could you explain that 'on my box' it was solved by recreating all locales ?

i've recreated the polish environment to track it, and i've seen no error

i also modified the pl.po file to volumtary insert a non UTF-8 character and also add and remove special UTF-8 characters, the results were the same (after had reinstalled deskbar;)) : no errors

i also reproduced this on the fr.po file, same result

i know that i'm not a developer and i may be wrong, but my experience has shown me that most of bugs i encountred were specific to my system.

But if it works here, with an LFS, shouldn't be working with the most of known distribs ?

i'll be pleased to try other tests, but i really think it comes from yours locales.

Regards
Comment 30 Eloi Primaux 2006-03-11 19:14:57 UTC
When i said no errors, i said no fatal errors
Comment 31 Fryderyk Dziarmagowski 2006-03-11 19:38:48 UTC
Try:
G_DEBUG=fatal-criticals /path/to/deskbar-applet/deskbar-applet -w

sorry, but this bug has nothing to do with locale settings (see my note about de_DE locale). deskbar-applet (or something used by d-a) can't parse translated UTF-8 strings from ../data/Deskbar_Applet.xml.h. Wrong locale setting causes fallback to C and problem disappears...
Comment 32 Christian Persch 2006-03-11 20:33:42 UTC
Created attachment 61102 [details] [review]
fix
Comment 33 Christian Persch 2006-03-11 20:37:37 UTC
Actually the locale.bind_textdomain_codeset call is enough to fix this bug, gettext.bind_textdomain_codeset doesn't make any difference.
Comment 34 Fryderyk Dziarmagowski 2006-03-11 20:50:44 UTC
patch attached in #32 solves the problem. :D Thanks Christian!
Comment 35 Raphael Slinckx 2006-03-11 23:19:49 UTC
Cool, marking as fixed then !