mimalloc
mimalloc copied to clipboard
Crash on Linux when using miamlloc v2.1.2 with dynamic override
-
I have a dynamic library which cannot be linked against mimalloc for some reason
// MyDynLib.cppadd_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.cppadd_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