Antonio SJ Musumeci | 10 Sep 2004 21:10
Gravatar

mmalloc

This may not be the correct place to ask but i'm not sure where else to. 
I just ran across mmalloc and it's just what I need for a project i'm 
working on. But i'm having some problems.

1. if i attempt to allocate more than 0x4000 i get this when i detach

./a.out: relocation error: ./a.out: symbol munmap, version GLIBC_2.0 not 
defined in file libc.so.6 with link time reference

2. If i incrementally allocate memory... after say 1KB-2KB it segfaults

0x08049a4d in mmalloc (md=0x40015000, size=4096) at mmalloc.c:298
298       mdp -> heapinfo[mdp -> heapinfo[block].free.prev].free.next

this is all i'm doing in my sample program

fd = open("mapped_data", O_CREAT|O_RDWR, S_IRWXU);
md = mmalloc_attach(fd, NULL);
data = mmalloc(md, 0x1000);
mmalloc_detach(md);

gcc-3.3.4
glibc-2.3.3
gdb-6.2

what am i missing? or is mmalloc just too old?
Michael Chastain | 14 Sep 2004 13:28
Picon

Re: mmalloc

gdb <at>  does not have much traffic; try this list:

  gdb <at> sources.redhat.com

It would help to use the 'script' command and include a complete
'typescript' file showing the gcc command and the whole gdb session.

Also you need to say the exact version of the operating system you are
using.

Michael Chastain

Gmane