Bug 762726 (GLUSTER-994) - memory leak in client protocol
Summary: memory leak in client protocol
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-994
Product: GlusterFS
Classification: Community
Component: protocol
Version: 3.0.4
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Pranith Kumar K
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-11 09:30 UTC by Raghavendra Bhat
Modified: 2015-12-01 16:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Raghavendra Bhat 2010-06-11 09:30:13 UTC
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==

Comment 1 Tejas Bhise 2010-07-26 08:20:00 UTC
vijay - are we fixing this in 3.0.x or 3.1 and then also applying it to the other ?

Comment 2 Amar Tumballi 2010-07-28 03:07:20 UTC
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?

Comment 3 Vijay Bellur 2010-08-05 02:52:03 UTC
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.

Comment 4 Anand Avati 2010-08-06 07:37:50 UTC
PATCH: http://patches.gluster.com/patch/4004 in release-3.0 (protocol/client: fix for client mem-leaks in case of failures)

Comment 5 Pranith Kumar K 2010-08-09 13:20:51 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.