Problem
cpp/pixels-retina builds its bundled jemalloc with --with-jemalloc-prefix=je_. That makes the generated libjemalloc.so export prefixed allocator symbols instead of the standard malloc, free, calloc, and realloc symbols.
When this library is used with LD_PRELOAD, the dynamic loader cannot interpose the normal allocator symbols. RocksDB and other native code may keep allocating through glibc while pixels-retina uses jemalloc APIs, which risks mixed allocator ownership and core dumps under Retina workloads.
Proposed fix
- Remove
--with-jemalloc-prefix=je_ from the pixels-retina jemalloc build.
- Update JNI memory metric calls from
je_mallctl to mallctl so they match the unprefixed jemalloc build.
- Keep
ENABLE_JEMALLOC=OFF builds working.
Validation
- Build
pixels-retina with jemalloc enabled.
- Confirm jemalloc configure reports an empty
JEMALLOC_PREFIX.
- Confirm the built
libjemalloc.so exports unprefixed malloc, free, calloc, realloc, and mallctl symbols.
- Build
pixels-retina with -DENABLE_JEMALLOC=OFF.
Problem
cpp/pixels-retinabuilds its bundled jemalloc with--with-jemalloc-prefix=je_. That makes the generatedlibjemalloc.soexport prefixed allocator symbols instead of the standardmalloc,free,calloc, andreallocsymbols.When this library is used with
LD_PRELOAD, the dynamic loader cannot interpose the normal allocator symbols. RocksDB and other native code may keep allocating through glibc while pixels-retina uses jemalloc APIs, which risks mixed allocator ownership and core dumps under Retina workloads.Proposed fix
--with-jemalloc-prefix=je_from the pixels-retina jemalloc build.je_mallctltomallctlso they match the unprefixed jemalloc build.ENABLE_JEMALLOC=OFFbuilds working.Validation
pixels-retinawith jemalloc enabled.JEMALLOC_PREFIX.libjemalloc.soexports unprefixedmalloc,free,calloc,realloc, andmallctlsymbols.pixels-retinawith-DENABLE_JEMALLOC=OFF.