Jemalloc debug mode

Jason Evans jasone at canonware.com
Wed Feb 4 21:44:50 PST 2015


On Jan 30, 2015, at 7:18 AM, SNL <snl20465 at gmail.com> wrote:
> I am running following simple test case but double free is not detected, what am I missing ?
> 
> [df.c]

I saved your program as ~/jemalloc/df.c, added #include <stdlib.h>, then did the following:

	gcc -g df.c -o df
	./autogen.sh --enable-prof --enable-prof-libunwind --enable-debug && make all
	LD_PRELOAD=$HOME/jemalloc/lib/libjemalloc.so.2 MALLOC_CONF=tcache:false ./df

Here's the result:

	<jemalloc>: include/jemalloc/internal/arena.h:1003: Failed assertion: "arena_mapbits_allocated_get(chunk, pageind) != 0"

You can verify that you're actually using jemalloc (and that it's configured as you intend) by adding stats_print:true to MALLOC_CONF, e.g.:

	LD_PRELOAD=$HOME/jemalloc/lib/libjemalloc.so.2 MALLOC_CONF=tcache:false,stats_print:true ./df

> 2.  Is quarantine basically a per thread free list ? How does it interact with tcache ?


tcache is a lower level facility than quarantine, so freed objects travel quarantine-->tcache-->arena.

Jason


More information about the jemalloc-discuss mailing list