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

Bug#457337: libc6: mremap() returns invalid address



On Fri, Dec 21, 2007 at 12:15:43PM -0500, Andreas Kloeckner wrote:
> Breakpoint 1, mmap_resize (m=0x2b6a5b236010, oldp=0x2b6a5bdb4000,
> nb=406784) at src/gklib/dlmalloc.c:2358
> 2358        if (cp != CMFAIL) {

So you're here...

> 2356        char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
> 2357                                      oldmmsize, newmmsize, 1);

Having just done this...

> #define CALL_MREMAP(addr, osz, nsz, mv) ((void)(addr),(void)(osz), \
>                                          (void)(nsz), (void)(mv),MFAIL)

Which you said expands to this...

> (gdb) p cp
> $3 = 0x5bdb4000 <Address 0x5bdb4000 out of bounds>

So how can this possibly be true, and how does mremap have anything to
do with your problem?  Nowhere in this code are you calling it.

I think we need a testcase for this problem, if you are convinced it
has something to do with glibc.  Also try strace.

-- 
Daniel Jacobowitz
CodeSourcery



Reply to: