Bug 762652 (GLUSTER-920) - memory leak in stat-prefetch
Summary: memory leak in stat-prefetch
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-920
Product: GlusterFS
Classification: Community
Component: stat-prefetch
Version: 2.0.9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-12 06:26 UTC by Raghavendra Bhat
Modified: 2010-05-18 07:26 UTC (History)
1 user (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-05-12 06:26:21 UTC
There is a memory leak in stat-prefetch in the functions sp_mkdir, sp_mknod and sp_symlink which use sp_new_entry_cbk as the call back function. In sp_new_entry_cbk STACK_UNWIND is called instead of SP_STACK_UNWIND thus not freeing the local hence leading to leak. This is the valgrind output reporting the leak.


1,884 bytes in 116 blocks are definitely lost in loss record 145 of 191
==6978==    at 0x4C24E27: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6978==    by 0x55124D1: strdup (in /lib64/libc-2.9.so)
==6978==    by 0x4E3F7B1: loc_copy (xlator.c:881)
==6978==    by 0x709E63D: sp_symlink (stat-prefetch.c:1845)
==6978==    by 0x72B513A: fuse_symlink (fuse-bridge.c:1180)
==6978==    by 0x72BA85C: fuse_thread_proc (fuse-bridge.c:2569)
==6978==    by 0x527D39F: start_thread (in /lib64/libpthread-2.9.so)
==6978==    by 0x5576BDC: clone (in /lib64/libc-2.9.so)

2,106 bytes in 126 blocks are definitely lost in loss record 149 of 191
==6978==    at 0x4C24E27: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6978==    by 0x55124D1: strdup (in /lib64/libc-2.9.so)
==6978==    by 0x4E3F7B1: loc_copy (xlator.c:881)
==6978==    by 0x709E096: sp_mknod (stat-prefetch.c:1782)
==6978==    by 0x72B4645: fuse_mknod (fuse-bridge.c:1059)
==6978==    by 0x72BA85C: fuse_thread_proc (fuse-bridge.c:2569)
==6978==    by 0x527D39F: start_thread (in /lib64/libpthread-2.9.so)
==6978==    by 0x5576BDC: clone (in /lib64/libc-2.9.so)

1,670,914 bytes in 29,230 blocks are definitely lost in loss record 187 of 191
==6978==    at 0x4C24E27: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6978==    by 0x55124D1: strdup (in /lib64/libc-2.9.so)
==6978==    by 0x4E3F7B1: loc_copy (xlator.c:881)
==6978==    by 0x709DA63: sp_mkdir (stat-prefetch.c:1711)
==6978==    by 0x72B48FD: fuse_mkdir (fuse-bridge.c:1089)
==6978==    by 0x72BA85C: fuse_thread_proc (fuse-bridge.c:2569)
==6978==    by 0x527D39F: start_thread (in /lib64/libpthread-2.9.so)
==6978==    by 0x5576BDC: clone (in /lib64/libc-2.9.so)

LEAK SUMMARY:
==6978==    definitely lost: 1,675,584 bytes in 29,509 blocks
==6978==    indirectly lost: 0 bytes in 0 blocks
==6978==      possibly lost: 16,121,824 bytes in 178,594 blocks
==6978==    still reachable: 42,837,238 bytes in 277 blocks
==6978==         suppressed: 0 bytes in 0 blocks

Comment 1 Anand Avati 2010-05-13 16:12:27 UTC
PATCH: http://patches.gluster.com/patch/3256 in release-2.0 (fix memory leak in mkdir, mknod, symlink by freeing local)


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