|
From: Johan R. <jry...@ni...> - 2003-12-19 20:34:30
|
Hi!
I use mmap() to allocate anonymous private memory. But it seems
that valgrind does not intercept my memory allocations, and starts
to complain about accesses to the regions.
==25948== Invalid write of size 4
==25948== at 0x402DFAC7: memset (in /lib/libc-2.3.1.so)
==25948== by 0x40279866: __libc_start_main (in /lib/libc-2.3.1.so)
==25948== by 0x8049408: (within /gnu/build/P-guss--T-mips-elf/guss/guss)
==25948== Address 0x4155D000 is not stack'd, malloc'd or free'd
Memory at addresses 0x4155D000 and above is allocated using:
void *stack_top = mmap (NULL, 1*1024*1024,
PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, 0, 0);
Shouldn't V be able to dectect this?
--
Johan Rydberg, Free Software Developer, Sweden
http://rtmk.sf.net | http://www.nongnu.org/guss/
|
|
From: Jeremy F. <je...@go...> - 2003-12-19 21:54:38
|
On Fri, 2003-12-19 at 12:34, Johan Rydberg wrote: > Hi! > > I use mmap() to allocate anonymous private memory. But it seems > that valgrind does not intercept my memory allocations, and starts > to complain about accesses to the regions. > > ==25948== Invalid write of size 4 > ==25948== at 0x402DFAC7: memset (in /lib/libc-2.3.1.so) > ==25948== by 0x40279866: __libc_start_main (in /lib/libc-2.3.1.so) > ==25948== by 0x8049408: (within /gnu/build/P-guss--T-mips-elf/guss/guss) > ==25948== Address 0x4155D000 is not stack'd, malloc'd or free'd > > Memory at addresses 0x4155D000 and above is allocated using: > > void *stack_top = mmap (NULL, 1*1024*1024, > PROT_READ|PROT_WRITE, > MAP_ANONYMOUS|MAP_PRIVATE, 0, 0); > > Shouldn't V be able to dectect this? Yep. And since almost everything is done with mmaps, it would be surprising to find that mmap is outright broken. What version of Valgrind are you using? Are you also getting a SIGSEGV? Could you try using --trace-syscalls=yes to see what the pattern of mmap calls is around there? J |