Skip to content

[pixels-retina] Remove jemalloc prefix for LD_PRELOAD allocator interposition #1331

@AntiO2

Description

@AntiO2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions