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 139738 - Gtranslator crashes when saving file with Hebrew chars
Gtranslator crashes when saving file with Hebrew chars
Status: RESOLVED FIXED
Product: gtranslator
Classification: Other
Component: Generally bug'd
HEAD
Other Linux
: Normal major
: 1.1.8
Assigned To: Ross Golder
Fatih Demir
Depends on:
Blocks:
 
 
Reported: 2004-04-11 18:49 UTC by Jordi Mallach
Modified: 2010-01-19 21:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
charset parameter in Content-Type parsing patch (1.83 KB, patch)
2005-01-28 23:30 UTC, Loïc Minier
none Details | Review

Description Jordi Mallach 2004-04-11 18:49:15 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).
Comment 1 Vincent Noel 2004-08-09 15:47:58 UTC
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.
Comment 2 Vincent Noel 2005-01-27 18:10:12 UTC
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.
Comment 3 Loïc Minier 2005-01-27 19:03:34 UTC
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.
Comment 4 Jordi Mallach 2005-01-27 20:07:43 UTC
I agree, this should not be crashing, even if there is a workaround.
Comment 5 Loïc Minier 2005-01-28 09:19:36 UTC
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

Thread 1 (Thread 1088746176 (LWP 4117))

  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
  • #1 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #2 <signal handler called>
  • #3 gtranslator_parse_the_file_from_file_dialog
  • #4 g_list_foreach
    from /usr/lib/libglib-2.0.so.0
  • #5 gtranslator_save_file
  • #6 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #11 gtk_button_clicked
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #19 gtk_button_released
    from /usr/lib/libgtk-x11-2.0.so.0
  • #20 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #24 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #25 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #26 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #27 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #28 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #29 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #30 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #31 g_main_depth
    from /usr/lib/libglib-2.0.so.0
  • #32 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #33 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #34 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #35 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #36 main
  • #0 __waitpid_nocancel
    from /lib/tls/libpthread.so.0

Comment 6 Loïc Minier 2005-01-28 09:30:14 UTC
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,
Comment 7 Loïc Minier 2005-01-28 23:30:39 UTC
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.
Comment 8 Loïc Minier 2005-01-29 00:24:59 UTC
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?
Comment 9 Ross Golder 2005-08-11 17:30:41 UTC
The gettext version required for CVS HEAD is now 0.14.2. The extra API calls
required were eventually rolled into that version.
Comment 10 Ross Golder 2006-11-28 00:32:56 UTC

*** This bug has been marked as a duplicate of 379112 ***
Comment 11 Ross Golder 2006-11-28 00:37:28 UTC
Whoops, sorry. This isn't a duplicate of that one. This is a seperate issue.
Comment 12 Ignacio Casal Quinteiro (nacho) 2009-10-29 19:31:01 UTC
I'd close this now that gtr 1.1.x is not maintained anymore.
Comment 13 Ignacio Casal Quinteiro (nacho) 2010-01-19 21:38:11 UTC
Closing this as it shouldn't be a problem anymore.