GNOME Bugzilla – Bug 362983
Require bind_textdomain_codeset() unconditionally
Last modified: 2008-01-15 13:12:56 UTC
GIMP crashes on startup, in gimp_real_restore routine, when executed under non-UTF8 locale as cs_CZ.ISO8859-2 or fr_FR.ISO8859-15. In plug_ins_file_proc_compare() function, two non-utf8 strings are passed to glib's g_utf8_collate() function. Crash does not happen under UTF8 version of cs_CZ or fr_FR locales, not under LANG=C. This crash is new with GNOME 2.16 (glib 2.12.4), it is not happening under GNOME 2.14 (glib 2.10.3). Backtrace: (gdb) bt
+ Trace 76874
Note in frame 1, the arguments are iso8859-2 encoded strings. Advise if this is bug in GIMP (passing non-UTF8 strings to g_utf8_*), or glib bug, please.
This looks like a bug in gettext or a problem with your GIMP build. GIMP explicitly calls bind_textdomain_codeset() so that all translations are delivered in UTF-8 encoding, no matter what locale you are using. So either gettext is broken on your system or GIMP was built without support for bind_textdomain_codeset(). The availability of this function is being checked when configure is run at build time. If you built gimp yourself, please have a look at config.h and config.log and look for HAVE_BIND_TEXTDOMAIN_CODESET.
(regardless of the reason for this bug:) Since a missing bind_textdomain_codeset() results in a crash because gettext() automatically converts to LC_CTYPE in its absence, shouldn't we requite it unconditionally? Reopening and setting milestone since this is easy enough to sort out for 2.4 and shouldn't be forgotten.
quoting config.h: 49 /* Define to 1 if you have the `bind_textdomain_codeset' function. */ 50 #define HAVE_BIND_TEXTDOMAIN_CODESET 1 Could the problem be, that, for example, fax3g's query() routine does not call INIT_I18N() macro? It's called only in run() routine. Adding that call there "moves" the crash to other plugins...
I think i found the bug here. Can you try the following: - go to app/plug-in/plug-ins.c - search for gimp_menus_init() - move it up a few lines, right to the start of the if (! gimp->no_interface) scope
Confirmed, steps described in #4 do fix the startup crash for me.
Fixed in CVS. Leaving open and changing summary to cover the bind_textdomain_codeset() issue. 2006-10-18 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-ins.c (plug_ins_init): initialize the plug-in translation domains before using them. Fixes bug #362983.
2006-12-07 Sven Neumann <sven@gimp.org> * configure.in: require bind_textdomain_codeset(). Fixes bug #362983.