Bug 762725 (GLUSTER-993) - memory leak-in stat-prefetch
Summary: memory leak-in stat-prefetch
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-993
Product: GlusterFS
Classification: Community
Component: stat-prefetch
Version: 3.0.4
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-11 09:26 UTC by Raghavendra Bhat
Modified: 2015-12-01 16:45 UTC (History)
2 users (show)

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


Attachments (Terms of Use)

Description Raghavendra Bhat 2010-06-11 06:27:47 UTC
this is observed in 3.0.5rc6.

Comment 1 Raghavendra Bhat 2010-06-11 09:26:52 UTC
There is a memory-leak in sp_process_inode_ctx. This is the valgrind output reporting the leak.
279 bytes in 10 blocks are definitely lost in loss record 94 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 0x73013AD: sp_process_inode_ctx (stat-prefetch.c:284)
==4084==    by 0x730EED3: sp_getxattr (stat-prefetch.c:3064)
==4084==    by 0x75269B7: fuse_getxattr (fuse-bridge.c:2669)
==4084==    by 0x7528C0F: fuse_thread_proc (fuse-bridge.c:3193)
==4084==    by 0x528E39F: start_thread (in /lib64/libpthread-2.9.so)
==4084==    by 0x5587BDC: clone (in /lib64/libc-2.9.so)

in sp_getxattr_cbk it should be SP_STACK_UNWIND which frees the local structure, but STACK_UNWIND is used, thus causing a leak.

Comment 2 Anand Avati 2010-06-14 08:32:17 UTC
PATCH: http://patches.gluster.com/patch/3413 in release-3.0 (free local->loc structure by using SP_STACK_UNWIND instead of STACK_UNWIND)

Comment 3 Tejas Bhise 2010-07-26 08:18:28 UTC
Raghu - is this code going in 3.1 also ?

Comment 4 Anand Avati 2010-08-21 09:17:10 UTC
PATCH: http://patches.gluster.com/patch/4227 in master (performance/stat-prefetch: use SP_STACK_UNWIND instead of STACK_UNWIND_STRICT.)


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