This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12019] memchr overshoots on Alpha
- From: "schwab at linux-m68k dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 15 Sep 2010 07:42:06 -0000
- Subject: [Bug libc/12019] memchr overshoots on Alpha
- References: <20100914154213.12019.eblake@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- 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.