Crash with jemalloc 2.2.1

Jason Evans jasone at canonware.com
Tue Apr 19 10:25:48 PDT 2011


On 04/18/2011 01:11 PM, Felipe Wilhelms Damasio - Taghos wrote:
> I'm using jemalloc to build a webcache system.
>
> I'm doing around 600-700 calloc/free per second. (a calloc-per-new-session).
>
> It's a linux machine with kernel 2.6.34 and glibc 2.11.2.
>
> jemalloc was compiled with:
>
>      ./configure  --enable-prof --enable-dss --enable-fill --enable-stats
> --enable-xmalloc --enable-swap
>
> I have no malloc options file.
>
> At some point, my program crashed. I generated a core dump and a gdb bt
> showed this:
>
> #0  arena_avail_comp (arena=0x1000a80, size=36864, large=true, zero=true) at
> src/arena.c:222
> 222        size_t b_size = b->bits&  ~PAGE_MASK;
> (gdb) bt
> #0  arena_avail_comp (arena=0x1000a80, size=36864, large=true, zero=true) at
> src/arena.c:222
> #1  arena_avail_tree_nsearch (arena=0x1000a80, size=36864, large=true,
> zero=true) at src/arena.c:249
> #2  arena_run_alloc (arena=0x1000a80, size=36864, large=true, zero=true) at
> src/arena.c:593
> #3  0x00007fe240427b20 in arena_malloc_large (arena=0x1000a80, size=36864,
> zero=80) at src/arena.c:1474
> #4  0x00007fe240422007 in icalloc (num=<value optimized out>, size=35472) at
> include/jemalloc/internal/jemalloc_internal.h:620
> #5  calloc (num=<value optimized out>, size=35472) at src/jemalloc.c:1185
> #6  0x0000000000408a76 in SES_new (fd=11191) at cache_session.c:11
> #7  0x000000000041563e in main (argc=3, argv=0x7fff357085c8) at server.c:2261
>
> Is this indication of a bug in jemalloc or in my program?
>
> What other info can I provide to help track this down?

This is likely an application bug, e.g. a double free.  I'd suggest 
testing with valgrind (without jemalloc linked in) if you can, or using 
a debug build of jemalloc if valgrind isn't an option.  There are 
assertions in debug builds of jemalloc that detect many (but not all) 
application memory bugs.

Thanks,
Jason



More information about the jemalloc-discuss mailing list