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

Bug#218930: marked as done (SEVERE bug with ctype (isxdigit and co) in libc6 ds1-8 and ds1-9 (Sid) on i386)



Your message dated Mon, 3 Nov 2003 10:19:59 -0500
with message-id <20031103151957.GA12470@nevyn.them.org>
and subject line Bug#218930: SEVERE bug with ctype (isxdigit and co) in libc6 ds1-8 and ds1-9 (Sid) on i386
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 3 Nov 2003 13:48:37 +0000
>From David.Decotigny@free.fr Mon Nov 03 07:48:36 2003
Return-path: <David.Decotigny@free.fr>
Received: from postfix3-2.free.fr [213.228.0.169] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1AGf4N-0003jv-00; Mon, 03 Nov 2003 07:48:35 -0600
Received: from free.fr (malakoff-2-82-67-110-22.fbx.proxad.net [82.67.110.22])
	by postfix3-2.free.fr (Postfix) with ESMTP id B52FBC8CB
	for <submit@bugs.debian.org>; Mon,  3 Nov 2003 14:48:34 +0100 (CET)
Message-ID: <[🔎] 3FA65CB2.8070707@free.fr>
Date: Mon, 03 Nov 2003 14:48:34 +0100
From: David Decotigny <David.Decotigny@free.fr>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031024 Debian/1.5-2
X-Accept-Language: en
MIME-Version: 1.0
To: submit@bugs.debian.org
Subject: SEVERE bug with ctype (isxdigit and co) in libc6 ds1-8 and ds1-9
 (Sid) on i386
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0
	tests=HAS_PACKAGE
	version=2.53-bugs.debian.org_2003_11_1
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_11_1 (1.174.2.15-2003-03-30-exp)


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

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 ))
and :
   isxdigit(c) expanded to (according to gcc -E -DM) :
   (((__ctype_b) )[(int) ( ( c ) )] & (__ctype_mask_t)   _ISxdigit

And, by looking the value of __ctype for '1' for example :
   __ctype['1'] = 0xd808 (ie 1101100000001000 in base 2)
which means that the following bits are set :
   3 (ie _ISdigit)
   11 (ie _ISalnum)
   12 (ie ????)
   14 (ie ????)
   15 (ie ????)
AND NOT the _ISxdigit bit !

Idem for __ctype['a'] = 0xd608 (ie 1101011000001000 in base 2), with the 
following bits set:
   3 (ie _ISdigit)
   9 (ie _IScntrl)
   10 (ie _ISpunct)
   12 (ie ????)
   14 (ie ????)
   15 (ie ????)
Which looks completely broken !!!

So: what is wrong ? The ctype.h header ? Or the libc6.so and libc6.a libraries 
? Or both ?

Please help !... The linux kernel won't compile anymore because of this 
(cannot correctly generate drivers/char/consolemap_deftbl.c because isxdigit 
is broken in drivers/char/conmakehash.c).

Thanks.

-- 
David Decotigny -- http://david.decotigny.free.fr


---------------------------------------
Received: (at 218930-done) by bugs.debian.org; 3 Nov 2003 15:20:02 +0000
>From drow@crack.them.org Mon Nov 03 09:20:01 2003
Return-path: <drow@crack.them.org>
Received: from nevyn.them.org [66.93.172.17] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1AGgUr-0000LK-00; Mon, 03 Nov 2003 09:20:01 -0600
Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian))
	id 1AGgUp-0004si-S7; Mon, 03 Nov 2003 10:19:59 -0500
Date: Mon, 3 Nov 2003 10:19:59 -0500
From: Daniel Jacobowitz <dan@debian.org>
To: David Decotigny <David.Decotigny@free.fr>, 218930-done@bugs.debian.org
Subject: Re: Bug#218930: SEVERE bug with ctype (isxdigit and co) in libc6 ds1-8 and ds1-9 (Sid) on i386
Message-ID: <20031103151957.GA12470@nevyn.them.org>
References: <[🔎] 3FA65CB2.8070707@free.fr> <[🔎] 20031103141226.GA5222@nevyn.them.org> <3FA66E7A.8030309@free.fr> <20031103150745.GA6957@nevyn.them.org> <3FA671CE.3080302@free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3FA671CE.3080302@free.fr>
User-Agent: Mutt/1.5.1i
Delivered-To: 218930-done@bugs.debian.org
X-Spam-Status: No, hits=-3.5 required=4.0
	tests=BAYES_30,EMAIL_ATTRIBUTION
	version=2.53-bugs.debian.org_2003_11_1
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_11_1 (1.174.2.15-2003-03-30-exp)

On Mon, Nov 03, 2003 at 04:18:38PM +0100, David Decotigny wrote:
> Woooops ! Did not read it carefully enough. Thanks a LOT ! Now it perfectly 
> works !

No problem.  Closing bug report.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: