>Submitter-Id:   net
>Originator:     Richard Powell
>Organization:
net
>Confidential:
no
>Synopsis:
The pointer manipulations in lib/valloc.c lead to memory corruption on Cray vector 
systems.
>Severity:
serious
>Priority:
high
>Category:      portability
>Class:
sw-bug
>Release:       cvs-1.11
>Environment:
All Cray vector platforms running UNICOS
 
System: sn9132 edge 10.0.0la d10.168 CRAY SV1
Architecture: Cray-PVP
 
>Description:
 
The pointer manipulations in lib/valloc.c, which try to round up the address to a
page boundary, are somewhat platform dependent and may not work on
architectures that have to simulate byte addressing, such as Cray vector machines.
 
>How-To-Repeat:

>Fix:
 
This patch will allow for platform specific definitions of the getpagesize() function.
"_CRAY1" is defined by the Cray C compiler on all Cray vector machines.
 
cvs diff getpagesize.h
Index: getpagesize.h
===================================================================
RCS file: /cvs/ccvs/lib/getpagesize.h,v
retrieving revision 1.2
diff -r1.2 getpagesize.h
18,26c18,32
< #if defined (HAVE_UNISTD_H)
< #  include <unistd.h>
< #  if defined (_SC_PAGESIZE)
< #    define getpagesize() sysconf(_SC_PAGESIZE)
< #  else
< #    if defined (_SC_PAGE_SIZE)
< #      define getpagesize() sysconf(_SC_PAGE_SIZE)
< #    endif /* _SC_PAGE_SIZE */
< #  endif /* _SC_PAGESIZE */
---
> #if defined (_CRAY1)
> #  define getpagesize() 1
> #endif
>
> #if !defined (getpagesize)
> #  if defined (HAVE_UNISTD_H)
> #    include <unistd.h>
> #    if defined (_SC_PAGESIZE)
> #      define getpagesize() sysconf(_SC_PAGESIZE)
> #    else
> #      if defined (_SC_PAGE_SIZE)
> #        define getpagesize() sysconf(_SC_PAGE_SIZE)
> #      endif /* _SC_PAGE_SIZE */
> #    endif /* _SC_PAGESIZE */
> #  endif


_______________________________________________
Bug-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-cvs

Reply via email to