[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#563882: git-core FTBFS on ia64: t1001-read-tree-m-2way.sh test fails



On Tue, Jan 26, 2010 at 04:06:32PM -0600, Jonathan Nieder wrote:
> 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.
> 

This patch is already included in the Debian libc6 package. It actually
may be the cause of the problem you reported.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: