Bug 762729 (GLUSTER-997)

Summary: memory leak in afr
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: replicateAssignee: Pranith Kumar K <pkarampu>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 3.0.4CC: gluster-bugs, pkarampu, tejas, vijay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Raghavendra Bhat 2010-06-11 09:40:35 UTC
THere is a memory leak in afr_sh_data_open. This is observed in glusterfs-3.0.5rc6(3.0.5rc5 too). 

valgrind report:


 272 (64 direct, 208 indirect) bytes in 1 blocks are definitely lost in loss record 92 of 145
==4084==    at 0x4C2414B: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4084==    by 0x4E6425B: fd_create (fd.c:490)
==4084==    by 0x6676CBF: afr_sh_data_open (afr-self-heal-data.c:1170)
==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 0x667C09C: afr_sh_metadata_unlck_cbk (afr-self-heal-metadata.c:123)
==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==    by 0x6438D15: notify (client-protocol.c:6988)
==4084==    by 0x4E422F9: xlator_notify (xlator.c:929)
==4084==    by 0x7F35256: socket_event_poll_in (socket.c:771)

Comment 1 Tejas Bhise 2010-07-26 08:23:03 UTC
Pavan - please indicate target release.

Comment 2 Pranith Kumar K 2010-08-06 07:48:28 UTC
the client translator does not unref the fd if client_open errors out. the patch for the bug 762726 will fix this one as well, as client_local_wipe() deallocates the memory and unrefs the fd.