Demo to get "Segmentation fault (core dumped)" when the binary is full static option -static is used by the linker
redis_integration_tes02$ ./run_build_debug.sh make
Read the next:
sewenew/redis-plus-plus#356 https://stackoverflow.com/questions/9002264/starting-a-stdthread-with-static-linking-causes-segmentation-fault
pthread cause segmenetation fault you must add -Wl,--whole-archive pthread -Wl,--no-whole-archive
to the linker options
target_link_libraries( ${PROJECT_NAME} INTERFACE hiredis -Wl,--whole-archive pthread -Wl,--no-whole-archive )