bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MirBSD mbtowc bug? failure on test-wcrtomb


From: Eric Blake
Subject: Re: MirBSD mbtowc bug? failure on test-wcrtomb
Date: Thu, 21 Oct 2010 16:19:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.4

On 09/15/2010 04:31 AM, Bruno Haible wrote:
Hi Eric,

Bruno, this one probably needs your help for a gnulib workaround.  On
MirBSD 10 (20100815), wcrtomb is found but not replaced; leading to
failure in the unit test:

ac_cv_func_wcrtomb=yes
ac_cv_have_decl_wcrtomb=yes
gl_cv_func_wcrtomb_retval=yes
gl_cv_have_raw_decl_wcrtomb=yes
GNULIB_WCRTOMB='1'
HAVE_WCRTOMB='1'
REPLACE_WCRTOMB='0'

../../gltests/test-wcrtomb.c:43: assertion failed
Abort trap (core dumped)
FAIL: test-wcrtomb.sh

Can you please recompile the test with -g -O0 and then show a gdb stack
trace?

LC_ALL=ja_JP gltests/test-wcrtomb 3
../../gltests/test-wcrtomb.c:43: assertion failed
Abort trap (core dumped)

(gdb) bt
#0  0x0297e103 in kill () from /usr/lib/libc.so.41.8
#1  0x029ba59c in abort () from /usr/lib/libc.so.41.8
#2 0x1c0008bc in check_character (s=0xcfbf8489 "\306\374\313\334\270\354>", n=2)
    at ../../gltests/test-wcrtomb.c:43
#3  0x1c000d0c in main (argc=2, argv=0xcfbf84f8)
    at ../../gltests/test-wcrtomb.c:136

$ locale -a
C
en_US.OPTU-8
en_US.UTF-8
POSIX

oddly enough, that doesn't include ja_JP; maybe the configure test that learned whether ja_JP exists is broken?


Failing on 'LC_ALL=ja_JP ./test-wcrtomb 3' at this line:

    wc = (wchar_t) 0xBADFACE;
    iret = mbtowc (&wc, s, n);
    ASSERT (iret == n);

with n==2, iret==1, s=="\303\274\303\237er".

This makes no sense to me: LC_ALL=ja_JP and the argument "3" are indicating
that a locale with EUC-JP encoding is being tested. But the string
s=="\303\274\303\237er" indicates an argument "2" and that an UTF-8 locale
is being tested. Has the test program been miscompiled or what??

More likely, I copied and pasted from the wrong section of code.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]