GNOME Bugzilla – Bug 139738
Gtranslator crashes when saving file with Hebrew chars
Last modified: 2010-01-19 21:38:11 UTC
From the Debian BTS (http://bugs.debian.org/242927): When trying to save a PO file which has Hebrew chars the program crashes. It also empties the file contents. I tried to reproduce the crash by: 1. Open a Po file. 2. Enter a English char. 3. Save. Went OK. File size is also OK. 4. Replace with a Hebrew char. 5. Save. 6. A crash happen... 7. File is truncated to 0 bytes. (=data loss).
Thanks for the bug report. Without a stack trace from the crash it's very hard to determine what caused the crash. Please see http://bugzilla.gnome.org/getting-traces.cgi for more information about getting a useful stack trace.
From the debian bugzilla : Hi, I found out that this kind of crash happens when the po file encoding isn't UTF-8. When the encoding is UTF-8 I can save Hebrew without problems. I'm going to mark this fixed.
It's nice you found out how to workaround the crash, but it would be best if the crash itself was fixed, please try to install bug-buddy and provide a stack trace.
I agree, this should not be crashing, even if there is a workaround.
The submitter provided a backtrace (see below) and suggested one can remove the encoding from the po file manually to get the crash. Backtrace was generated from '/usr/bin/gtranslator' (no debugging symbols found) Using host libthread_db library "/lib/tls/libthread_db.so.1". (no debugging symbols found) `system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols. (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread 1088746176 (LWP 4117)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 0x408ae4ee in __waitpid_nocancel () from /lib/tls/libpthread.so.0
+ Trace 55012
Thread 1 (Thread 1088746176 (LWP 4117))
I could reproduce this, I took a random po file, which initially had: # Translation of libbonobo to Croatiann # Copyright (C) Croatiann team # Translators: Automatski Prijevod <>,Robert Sedak <robert.sedak@sk.tel.hr>, msgid "" msgstr "" "Project-Id-Version: libbonobo 0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2004-09-13 15:34+0100\n" "PO-Revision-Date: 2004-03-13 13:11+CET\n" "Last-Translator: auto\n" "Language-Team: Croatian <lokalizacija@linux.hr>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: TransDict server\n" I removed the charset=UTF-8 in the CT, ie: "Content-Type: text/plain\n" Then I launched a debugging symbols version of gtranslator from gdb, it will crash immediately if you pass the file to the command line or if you open a file with the file open dialog. Before the crash, I get hundreds of warnings like: (gtranslator:1953): gtranslator-WARNING **: /home/lool/hr.po:83: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] (gtranslator:1953): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté (gtranslator:1953): gtranslator-WARNING **: /home/lool/hr.po:84: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] (gtranslator:1953): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté ... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1088779104 (LWP 1953)] 0x0805c874 in gtranslator_translation_changed (buffer=0x0, useless=0x0) at gui.c:733 733 GtrMsg *msg = GTR_MSG(po->current->data); (gdb) I stripped the po file to have a single translation with 8-bit chars, and got: bee% LC_ALL=C gdb ./debian/gtranslator/usr/bin/gtranslator GNU gdb 6.3-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) run Starting program: /home/lool/tmp-gtranslator/gtranslator-1.1.5/debian/gtranslator/usr/bin/gtranslator [Thread debugging using libthread_db enabled] [New Thread 1088779104 (LWP 1977)] (gtranslator:1977): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté (gtranslator:1977): gtranslator-WARNING **: /home/lool/hr.po:17: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] (gtranslator:1977): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté (gtranslator:1977): gtranslator-WARNING **: /home/lool/hr.po:18: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] (gtranslator:1977): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté (gtranslator:1977): gtranslator-WARNING **: /home/lool/hr.po:19: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] (gtranslator:1977): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: La conversion du jeu de caractères « text/plain » vers « utf-8 » n'est pas supporté (gtranslator:1977): gtranslator-WARNING **: /home/lool/hr.po:20: could not convert line from 'text/plain' to UTF-8: [NULL ERRV] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1088779104 (LWP 1977)] 0x0805c874 in gtranslator_translation_changed (buffer=0x0, useless=0x0) at gui.c:733 733 GtrMsg *msg = GTR_MSG(po->current->data); (gdb) I believe the stacktrace is irrelevant, the warnings should be fixed first. Regards,
Created attachment 36675 [details] [review] charset parameter in Content-Type parsing patch I did not search to fix the warnings, but there really might be something nasty with the gerror passed to g_convert() or inside glib.
Seems applicable in CVS too, the warning are probably gone since I couldn't find g_convert() calls anymore. Do you know when will gettext 0.15 be released? Do you have some experimental packages setup?
The gettext version required for CVS HEAD is now 0.14.2. The extra API calls required were eventually rolled into that version.
*** This bug has been marked as a duplicate of 379112 ***
Whoops, sorry. This isn't a duplicate of that one. This is a seperate issue.
I'd close this now that gtr 1.1.x is not maintained anymore.
Closing this as it shouldn't be a problem anymore.