This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12019] memchr overshoots on Alpha


------- Additional Comments From schwab at linux-m68k dot org  2010-09-15 07:42 -------
(In reply to comment #1)
> Stepping through the assembly reveals that the segfault is happening on:
> 
> memchr(page-1,0,3)
> 
> where page[-1] is '\0' and page is the start of an inaccessible page; when it
> should be successfully returning page-1.

This is an invalid use of memchr, see 7.1.4:

If a function argument is described as being an array, the pointer actually
passed to the function shall have a value such that all address computations
and accesses to objects (that would be valid if the pointer did point to the
first element of such an array) are in fact valid. 

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=12019

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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