mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

Crash on Linux when using miamlloc v2.1.2 with dynamic override

Open Gayisnotgay opened this issue 1 year ago • 0 comments

  • I have a dynamic library which cannot be linked against mimalloc for some reason // MyDynLib.cpp image add_library(myDynLib SHARED MyDynLib.cpp)

  • in my main program which link against mimalloc, i use dlopen/dlsym to explicitly call the function in the above prebuilt dynamic library // TestMimalloc.cpp image add_executable(MyProgram TestMimalloc.cpp) target_link_libraries(MyProgram PUBLIC mimalloc -ldl)

  • i ran my program using LD_PRELOAD=/path/to/libmimalloc-debug.so and MIMALLOC_VERBOSE=1, but it crashed (saying free(): invalid pointer)where i call the function defined in the prebuilt dynamic library image

Gayisnotgay avatar Jan 31 '24 02:01 Gayisnotgay