Discussion:
duplocale test fails on CentOS 6
(too old to reply)
Tom G. Christensen
2017-09-22 18:57:46 UTC
Permalink
Raw Message
Hello,

The duplocale test is failling on CentOS 6:

test-duplocale.c:187: assertion 'strcmp (results.monetary,
expected_results.monetary) == 0' failed

I ran it under gdb to see the values:
(gdb) run
Starting program:
/home/tgc/projects/gnulib/duplocale/gltests/test-duplocale

Breakpoint 1, test_with_locale_parameter () at test-duplocale.c:187
187 ASSERT (strcmp (results.monetary, expected_results.monetary)
== 0);
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.209.el6_9.2.x86_64
(gdb) p results.monetary
$1 =
"$123,75\000\202\254\000\377\377\177\000\000\001\000\000\000\000\000\000\000H\347\377\367\377\177\000\000\177U\335q\000\000\000\000\226V\336\367\377\177",
'\000' <repeats 11 times>"\336,
\377\377\377\177\000\000?\000\000\000\000\000\000\000\000\336\377\377\377\177\000\000\003\000\000\000\063,5\000P\253\377\367\377\177\000\000.N="
(gdb) p expected_results.monetary
$2 =
"$123.75\000\350\344\377\367\377\177\000\000\320\337\377\377\377\177\000\000\370\337\377\377\377\177\000\000\220\341\377\367\377\177\000\000\230\253\377\367\377\177\000\000.N=\366\000\000\000\000jb\336\367\377\177\000\000\000\000\000\000\000\000\000\000\230\253\377\367\377\177\000\000\001\000\000\000\063,5\000\000\000\000\000\000\000\000\000\001\000\000"

Ignoring the garbage you can see a comma where the dot was expected.

-tgc
Bruno Haible
2017-09-23 15:41:06 UTC
Permalink
Raw Message
Hello Tom,
Post by Tom G. Christensen
test-duplocale.c:187: assertion 'strcmp (results.monetary,
expected_results.monetary) == 0' failed
(gdb) run
/home/tgc/projects/gnulib/duplocale/gltests/test-duplocale
Breakpoint 1, test_with_locale_parameter () at test-duplocale.c:187
187 ASSERT (strcmp (results.monetary, expected_results.monetary) == 0);
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.209.el6_9.2.x86_64
(gdb) p results.monetary
$1 =
"$123,75\000\202\254\000\377\377\177\000\000\001\000\000\000\000\000\000\000H\347\377\367\377\177\000\000\177U\335q\000\000\000\000\226V\336\367\377\177",
'\000' <repeats 11 times>"\336,
\377\377\377\177\000\000?\000\000\000\000\000\000\000\000\336\377\377\377\177\000\000\003\000\000\000\063,5\000P\253\377\367\377\177\000\000.N="
(gdb) p expected_results.monetary
$2 =
"$123.75\000\350\344\377\367\377\177\000\000\320\337\377\377\377\177\000\000\370\337\377\377\377\177\000\000\220\341\377\367\377\177\000\000\230\253\377\367\377\177\000\000.N=\366\000\000\000\000jb\336\367\377\177\000\000\000\000\000\000\000\000\000\000\230\253\377\367\377\177\000\000\001\000\000\000\063,5\000\000\000\000\000\000\000\000\000\001\000\000"
Ignoring the garbage you can see a comma where the dot was expected.
Thanks for the report. This assertion failure is a combination of
(1) a bug in the test: it was freeing a locale object that was still in use as
the current thread's locale,
(2) glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=19633>
which produces a dot instead of a comma or vice versa.

I could reproduce (1) as a crash inside nl_langinfo() on glibc/x86 systems
(but not on glibc/x86_64 systems), even on systems with glibc-2.24, where (2)
is already fixed.

And once I fixed (1), I could no longer reproduce the test failure you reported.
But another test program, written specifically for (2), still failed.

So I've committed:
- for (1): a test fix.
- for (2): new modules 'monetary' and 'strfmon_l'.

Thanks for this report!

Bruno

Loading...