Thu 14 Jan 2010 09:55:19 AM UTC, comment #4:
> i've checked (attached a watch to gram_pos after 'start'ing
> the program in gdb) that gram_pos members are valid during
> some periods of time, but at some point lexing ends and sets
> them both to NULL.
So that should be reproducible on Unix systems. And indeed:
$ /arch/x86-linux/gnu-inst-gettext/0.17/bin/msgfmt -c --statistics -o test.gmo test.po
/arch/x86-linux/gnu-inst-gettext/0.17/bin/msgfmt: (null): warning: PO file header fuzzy
warning: older versions of msgfmt will give an error on this
test.po:3: headerfield `Project-Id-Version' missing in header
test.po:3: headerfield `PO-Revision-Date' missing in header
test.po:3: headerfield `Last-Translator' missing in header
test.po:3: headerfield `Language-Team' missing in header
test.po:3: headerfield `MIME-Version' missing in header
test.po:3: headerfield `Content-Transfer-Encoding' missing in header
- translated messages.
Here the message contains a "(null)" marker. Indeed, this bug
exists in gettext 0.17 and was fixed in CVS/git:
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=9ae04cda9d8955105abd842aed4fbee567e80a26
> This bug is actually nested in the fact that int_vasprintf()
> from gnulib doesn't support NULL arguments for "%s" on Windows.
The support of NULL pointer arguments was added in gnulib long
before gettext 0.17, here:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=b680ccf8f914177c9f4fab65bead5c6b034c5d99
But this function would print "(NULL)", not "(null)". You are
right, it's not the gnulib vasnprintf function which is being
used but the old gettext substitute from gettext/gnulib-local/lib/vasprintf.c,
and this function does not support NULLs.
Time to ditch this old function. I'm applying this in the
gnulib-local/ directory:
2010-01-14 Bruno Haible <bruno@clisp.org>
Use full 'vasnprintf' module from gnulib. The reduced one did not
support NULL arguments.
- lib/vasprintf.c: Remove file.
- m4/vasprintf.m4: Remove file.
- modules/vasprintf.diff: Remove file.
- Makefile.am (EXTRA_DIST): Remove them.
Reported by LRN at <http://savannah.gnu.org/bugs/?28593>.
|
Thu 14 Jan 2010 07:07:44 AM UTC, comment #2:
Nope, i've checked (attached a watch to gram_pos after 'start'ing the program in gdb) that gram_pos members are valid during some periods of time, but at some point lexing ends and sets them both to NULL.
This bug is actually nested in the fact that int_vasprintf() from gnulib doesn't support NULL arguments for "%s" on Windows. Or, if you look at it another way, in the fact that msgfmt passes NULL as an argument for "%s" without checking it.
I've fixed that in my local copy by hacking msgfmt.c to make such check (in two places), and i'm happy with it for the moment. But fixing gnulib is beyond my ability, i'm afraid.
|
Thu 14 Jan 2010 12:02:21 AM UTC, comment #1:
It looks like a DLL import/export problem with the variable
'gram_pos' from libgettextsrc.dll. Something related to
gettext-tools/woe32dll/gettextsrc-exports.c must have failed to
work installation. Most probably you did not build your mingw
binaries in the way described in gettext's README.woe32.
As a workaround, you can build with --disable-shared. This will
make all DLL problems go away.
|
Wed 13 Jan 2010 06:45:04 PM UTC, original submission:
$ msgfmt --version
msgfmt.exe (GNU gettext-tools) 0.17
Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
$ cat test.po
#, fuzzy
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
$ gdb --args /mingw/bin/msgfmt -c --statistics -o test.gmo test.po
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) b msgfmt.c:881
Breakpoint 1 at 0x40282a: file msgfmt.c, line 881.
(gdb) r
Starting program: F:/mingw/bin/msgfmt.exe -c --statistics -o test.gmo test.po
[New thread 8172.0x1b30]
Error: dll starting at 0x77d40000 not found.
Error while mapping shared library sections:
NOT_AN_IMAGE: No such file or directory.
Error while mapping shared library sections:
%WINDIR%\SysWOW64\ntdll32.dll: No such file or directory.
Error: dll starting at 0x77d40000 not found.
Error: dll starting at 0x77c20000 not found.
[New thread 8172.0x193c]
Breakpoint 1, msgfmt_parse_debrief (that=0x3f7158) at msgfmt.c:881
881 multiline_warning (xasprintf ("%s: ", gram_pos.file_name),
(gdb) p gram_pos
$1 = {file_name = 0x0, line_number = 0}
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x64b1c39b in int_vasprintf (result=0x22fe94, format=0x40c4fc "%s: ", args=0x22fed4 "") at vasprintf.c:100
100 total_width += strlen (va_arg (ap, char *));
(gdb) bt
#0 0x64b1c39b in int_vasprintf (result=0x22fe94, format=0x40c4fc "%s: ", args=0x22fed4 "") at vasprintf.c:100
#1 0x64b155c8 in xvasprintf (format=0x40c4fc "%s: ", args=0x22fed4 "") at xvasprintf.c:107
#2 0x64b15601 in xasprintf (format=0x40c4fc "%s: ") at xasprintf.c:29
#3 0x00402854 in msgfmt_parse_debrief (that=0x3f7158) at msgfmt.c:881
#4 0x70c02e2d in catalog_reader_parse (pop=0x3f7158, fp=0x77bf1d08, real_filename=0x3f70d8 "test.po", logical_filename=0x3f4ed6 "test.po", input_syntax=0x70c2b160) at read-catalog-abstract.c:80
#5 0x00401bf6 in main (argc=6, argv=0x3f4fb8) at msgfmt.c:1095
|