Open kefahi opened 4 years ago
I figured out the root cause - but not the solution yet -.
It turned out that the default compilation options on alpine forces the malloc library to libc.
$ redis-server -v
Redis server v=5.0.9 sha=869dcbdc:0 malloc=libc bits=64 build=5e0aa57c0bc626b1
While if i compile redis by hand without setting that it would use jemalloc
$ redis-server -v
Redis server v=6.0.6 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=770a2d00214189a6
I compile RediSearch without any malloc configuration so it defaults to jemalloc. When I run redisearch against the jemalloc compiled redis all run without any issues.
So the problem is specific to when we have mismatching malloc libs.
How can I direct RediSearch to compile with libc malloc instead, I haven't figured that out yet.
Without figuring that out (by at least having some hint on how to change the malloc used in RediSearch) it is always guaranteed that it will not work with the version of Redis that is compiled with an alternative malloc library.
@kefahi please define REDIS_MODULE_TARGET
so enable code in /src/rmalloc.h
.
@ashtul
Sorry I concluded too soon.
It turned out that this option is enabled per default in the CMakeLists.txt
OPTION(USE_REDIS_ALLOCATOR "Use redis allocator" ON)
which -on the same file- controls
IF(USE_REDIS_ALLOCATOR)
ADD_DEFINITIONS(-DREDIS_MODULE_TARGET)
ENDIF ()
I verified this by looking at the exact compile proceedings
make build VERBOSE=1
...
cd /home/kefah/RediSearch/build/src/rmutil && /usr/bin/cc -DREDISMODULE_EXPERIMENTAL_API -DREDIS_MODULE_TARGET -DRS_GIT_SHA=\"45750997726c28a87022b046cfb207ddd28ad7b2\" -DRS_GIT_VERSION=\"v1.6.6-79-g45750997\" -D_GNU_SOURCE -I/home/kefah/Downloads/RediSearch/src -Wall -Wno-unused-function -Wno-unused-variable -Wno-sign-compare -fPIC -Werror=implicit-function-declaration -pthread -fno-strict-aliasing -Werror=incompatible-pointer-types -std=gnu99 -O2 -g -UNDEBUG -o CMakeFiles/test_periodic.dir/test_periodic.c.o -c /home/kefah/Downloads/RediSearch/src/rmutil/test_periodic.c
...
So the -DREDIS_MODULE_TARGET flag is being use per default.
@kefahi
Can you try compiling redis with USE_JEMALLOC=no
?
@kefahi any news?
System information and software versions
Steps to reproduce
The build process completes smoothly without issues. (only couple of minor, apparently unrelated warnings).
Run
Create Index and add document
The FT.ADD command simply causes redis to core dump with the following