This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[spc@armigeron.com] libc/1116: Bug in Alpha version of memchr() in glibc



Hi,

Is there anybody with alpha assembler knowledge going to fix
sysdeps/alpha/memchr.S ?

Andreas



Topics:
   libc/1116: Bug in Alpha version of memchr() in glibc


----------------------------------------------------------------------

Date: Mon, 10 May 1999 16:07:46 -0400
From: spc@armigeron.com
To: bugs@gnu.org
Subject: libc/1116: Bug in Alpha version of memchr() in glibc
Message-Id: <199905102007.QAA17810@armigeron.com>


>Number:         1116
>Category:       libc
>Synopsis:       If size is > $7fffffffffffffff, memchr() fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Mon May 10 16:20:01 EDT 1999
>Last-Modified:
>Originator:     Sean 'Captain Napalm' Conner
>Organization:
Armigeron Information Services, Inc.
>Release:        libc-2.0.7
>Environment:
	DEC Alpha, Linux 2.0.x, RedHat 5.2 distribution
Host type: @host@
System: Linux wopr.armigeron.com 2.0.36 #2 Fri Feb 26 16:17:31 EST 1999 i586 unknown
Architecture: i586

Addons: @subdirs@
Build CFLAGS: @CFLAGS@
Build CC: @CC@
Build shared: @shared@
Build profile: @profile@
Build omitfp: @omitfp@
Stdio: @stdio@

>Description:
	(see code below):

	Myself and a friend have tracked the problem down to the call to
	memchr().  If the high bit of SSIZET_MAX is stripped off, the
	function works correctly.  We concluded that this is not the correct
	behavior, and the code works fine on two other platforms (Intel and
	MIPS, also running RedHat with glibc).

>How-To-Repeat:

  The following code produces the incorrect output on a DEC Alpha running
RedHat Linux 5.2 using glibc 2.0.7.

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#define SSIZET_MAX   (~(size_t)0) 

int main(void)
{
   char  *p, *q;
   
   printf("SSIZET_MAX = %lx\n", (unsigned long )SSIZET_MAX);
   p = memchr(q = "Date: Something I never seem to have.", 0, SSIZET_MAX)
   printf("p = %p, p' = %p\n", p, q);
   return (0);
}

[spc]tempest:/home/spc>./a.out
SSIZET_MAX = ffffffffffffffff
p = (nil), p' = 0x120000808


>Fix:

>Audit-Trail:
>Unformatted:


------------------------------

End of forward-cAlXT Digest
***************************



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]