Bug#218930: SEVERE bug with ctype (isxdigit and co) in libc6 ds1-8 and ds1-9 (Sid) on i386
On Mon, Nov 03, 2003 at 02:48:34PM +0100, David Decotigny wrote:
>
> Package: libc6
> Version: 2.3.2.ds1-9
>
> (Note that I also tried the 2.3.2.ds1-8 with the same results as below).
>
> I should also mention:
> Package: libc6-dev
> Version: 2.3.2.ds1-9
>
> I apt-get dist-upgrade today my Sid (did it 10 days ago and it was still
> fine at that time I guess). Now, the libc6 headers seem to be inconsistent
> with the __ctype variable in the libc6 shared library and archive, or the
> __ctype variable (in libc6 library) itself is broken. This causes the
> isxdigit() (at least) function to behave incorrectly:
>
> isxdigit('0') = 0
> isxdigit('1') = 0
> ...
> isxdigit('9') = 0
> isxdigit('a') = 0
> ...
> isxdigit('f') = 0
> isxdigit('A') = 0
> ...
> isxdigit('F') = 0
> isxdigit('q') = 0
> isxdigit('s') = 0
> isxdigit('d') = 0
> isxdigit('z') = 0
> ...
>
> The source to get this was :
>
> #include <ctype.h>
> #include <stdio.h>
>
> int main ()
> {
> char *p;
> for (p = "0123456789abcdefABCDEFqsdzabcdef" ; *p != '\0'; p++)
> printf("isxdigit('%c') = %d\n", *p, isxdigit(*p));
> return 0;
> }
>
> (compiled with gcc-2.95 and gcc of the current gcc of the Sid, with shared
> version of the libc6, and static version)
>
> Other informations:
> $ cat /proc/cpuinfo
> processor : 0
> vendor_id : AuthenticAMD
> cpu family : 6
> model : 4
> model name : AMD Athlon(tm) Processor
> stepping : 2
> cpu MHz : 807.207
> cache size : 256 KB
> ...
> $ uname -a
> Linux baloo 2.4.22 #2 mar aoû 26 23:26:24 CEST 2003 i686 GNU/Linux
> $ gcc --version
> gcc (GCC) 3.3.2 (Debian)
> $ gcc-2.95 --version
> 2.95.4
> $ echo $LC_ALL
> fr_FR@euro
Something is really wrong with your system.
I can't reproduce this using fr_FR@euro, en_US,
> Please note that I get the same behaviour with LC_ALL unset !
>
> Suggestion:
> When I look in the libc6 headers, I get :
> _ISxdigit = (1 << ( 4 ))
Are you sure? In my copy it says:
_ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
What header are you looking at, please?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
Reply to: