Hide Forgot
There is a memory leak in client_open in 3.0.5rc6. This is the valgrind report showing the leak 516 bytes in 11 blocks are definitely lost in loss record 105 of 145 ==4084== at 0x4C24E27: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==4084== by 0x55234D1: strdup (in /lib64/libc-2.9.so) ==4084== by 0x4E4262B: loc_copy (xlator.c:1024) ==4084== by 0x6422A70: client_open (client-protocol.c:773) ==4084== by 0x6676ED3: afr_sh_data_open (afr-self-heal-data.c:1178) ==4084== by 0x6676F7E: afr_self_heal_data (afr-self-heal-data.c:1205) ==4084== by 0x667BF5B: afr_sh_metadata_done (afr-self-heal-metadata.c:88) ==4084== by 0x667C175: afr_sh_metadata_finish (afr-self-heal-metadata.c:150) ==4084== by 0x667E3BA: afr_sh_metadata_lk_cbk (afr-self-heal-metadata.c:747) ==4084== by 0x6434AEC: client_inodelk_cbk (client-protocol.c:5441) ==4084== by 0x64379DB: protocol_client_interpret (client-protocol.c:6571) ==4084== by 0x64386A1: protocol_client_pollin (client-protocol.c:6869) ==4084==
vijay - are we fixing this in 3.0.x or 3.1 and then also applying it to the other ?
Just reviewed this part of the code in 3.1 codebase, and the bug is no more valid in 3.1 branch. Should we close this?
Please fix this only for release-3.0. If we are to make a further 3.0.x release, it would be useful to have this fix.
PATCH: http://patches.gluster.com/patch/4004 in release-3.0 (protocol/client: fix for client mem-leaks in case of failures)
The memory leaks happen only in case of failures. I have modified the code to always error out so that the code will hit the memory leak path. With the fix, I observed that the process is not leaking memory anymore.