|
From: Piotr J. <p.j...@gm...> - 2010-06-16 11:18:17
|
Hello,
from the valgrind.h on VALGRIND_MALLOCLIKE_BLOCK:
"'rzB' is the redzone size if the allocator
can apply redzones -- these are blocks of padding at the start and end of
each block. Adding redzones is recommended as it makes it much more likely
Valgrind will spot block overruns."
Detecting overruns didn't quite work for me though so I dug inside
valgrind source and found in mc_main.c:
case VG_USERREQ__MALLOCLIKE_BLOCK: {
Addr p = (Addr)arg[1];
SizeT sizeB = arg[2];
//UInt rzB = arg[3]; XXX: unused!
Bool is_zeroed = (Bool)arg[4];
MC_(new_block) ( tid, p, sizeB, /*ignored*/0, is_zeroed,
MC_AllocCustom, MC_(malloc_list) );
return True;
}
So it looks like the redzones are completely ignored.
Is the comment out of date or the feature not yet implemented? Can I
just emulate it by adding unaddressable blocks myself at both ends of
the new block?
--
Best Regards,
Piotr Jaroszyński
|