I was trying to replace the BLOCK_ALLOC usage in pike_memory.c DEBUG_MALLOC mode. Unfortunately, since it uses the block allocator in its malloc tracer, which in turn calls malloc, that results in a deadlock. From what I can tell, that problem was already present when using the old "block_alloc.h", but it wasnt triggered since memory pages are preallocated.
Before I try to work around that: What kinds of malloc misuses and memory access errors will DEBUG_MALLOC actually detect, which valgrind won't? Is it something we want to keep?
arne
Before I try to work around that: What kinds of malloc misuses and memory access errors will DEBUG_MALLOC actually detect, which valgrind won't? Is it something we want to keep?
The main feature of DEBUG_MALLOC, is that it often is capable of determining where the bug that generated the leak is (typically a reference counting bug), where as valgirnd/memcheck would only indicate where it was allocated. It also integrates with the gc, so that for nested structures only the root leak is reported.
I'd like to keep it.
/grubba
pike-devel@lists.lysator.liu.se