Bastian Blank wrote: > The following program shows the cause: > > | #include <sys/stat.h> > | #include <sys/mman.h> > | #include <fcntl.h> > | > | int main(int argc, const char * const argv[]) > | { > | struct stat st; > | lstat(argv[1], &st); > | > | int fd = open(argv[1], O_RDONLY); > | void *data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); > | void *t = memchr(data, 0, st.st_size); > | printf("ptr: %p, ret: %p, len: 0x%zx\n", data, t, st.st_size); > | return 0; > | } > > Example output: > | % ./test /etc/passwd > | ptr: 0x2000000000050000, ret: 0x200000000005040e, len: 0x40e > > The found location is already after the buffer. memchr is AFAIK expanded > by gcc.
FYI: http://sourceware.org/bugzilla/show_bug.cgi?id=10162 Maybe glibc 2.11.1 (which includes a cherry-pick of commit 6622141) will fix this. I checked gcc’s memchr builtin; there is no ia64-specific version, and the generic code just deals with constants and delegates the real work to libc memchr. Jonathan -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org