Bug 797875

Summary: Memory leaks reported by valgrind in nfs and nlm code
Product: [Community] GlusterFS Reporter: Shwetha Panduranga <shwetha.h.panduranga>
Component: nfsAssignee: Rajesh <rajesh>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: urgent    
Version: mainlineCC: amarts, gluster-bugs, rajesh, vagarwal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-28 06:48:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Attaching valgrind nfs log file none

Description Shwetha Panduranga 2012-02-27 11:50:24 UTC
Created attachment 566021 [details]
Attaching valgrind nfs log file

Description of problem:
Operations Performed:create volume, add brick, replace-brick, nfs mount from client. 

Version-Release number of selected component (if applicable):
mainline

==17396== 
==17396== 44 bytes in 1 blocks are definitely lost in loss record 17 of 353
==17396==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==17396==    by 0x4C59BCC: __gf_calloc (mem-pool.c:145)
==17396==    by 0x4C3EA8A: gf_strdup (mem-pool.h:130)
==17396==    by 0x4C3FD0E: __dentry_create (inode.c:499)
==17396==    by 0x4C407E2: __inode_link (inode.c:815)
==17396==    by 0x4C408F7: inode_link (inode.c:847)
==17396==    by 0x9473E19: nfs3svc_lookup_cbk (nfs3.c:1189)
==17396==    by 0x945FD86: nfs_fop_lookup_cbk (nfs-fops.c:316)
==17396==    by 0x923AC49: io_stats_lookup_cbk (io-stats.c:1468)
==17396==    by 0x9019ACD: qr_lookup_cbk (quick-read.c:417)
==17396==    by 0x8E048CB: ioc_lookup_cbk (io-cache.c:266)
==17396==    by 0x4C29759: default_lookup_cbk (defaults.c:46)

==17396== 55 bytes in 1 blocks are definitely lost in loss record 51 of 353
==17396==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==17396==    by 0x4C59BCC: __gf_calloc (mem-pool.c:145)
==17396==    by 0x945E745: gf_strdup (mem-pool.h:130)
==17396==    by 0x945EAD2: nfs_loc_fill (nfs-common.c:177)
==17396==    by 0x945EC6D: nfs_inode_loc_fill (nfs-common.c:213)
==17396==    by 0x948D436: nfs3_fh_resolve_inode_done (nfs3-helpers.c:3539)
==17396==    by 0x948E990: nfs3_fh_resolve_inode (nfs3-helpers.c:3971)
==17396==    by 0x948EA24: nfs3_fh_resolve_resume (nfs3-helpers.c:4003)
==17396==    by 0x948EC4F: nfs3_fh_resolve_root (nfs3-helpers.c:4057)
==17396==    by 0x948EE8F: nfs3_fh_resolve_and_resume (nfs3-helpers.c:4104)
==17396==    by 0x9492E18: nlm4svc_lock (nlm4.c:1312)
==17396==    by 0x4EA50A8: rpcsvc_handle_rpc_call (rpcsvc.c:514)

==17396== 376 (256 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 269 of 353
==17396==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==17396==    by 0x4C59BCC: __gf_calloc (mem-pool.c:145)
==17396==    by 0x4C3FEF7: __inode_create (inode.c:541)
==17396==    by 0x4C41521: __inode_table_init_root (inode.c:1203)
==17396==    by 0x4C41877: inode_table_new (inode.c:1283)
==17396==    by 0x945CECC: nfs_init_subvolume (nfs.c:347)
==17396==    by 0x945D06B: nfs_init_subvolumes (nfs.c:375)
==17396==    by 0x945E329: init (nfs.c:744)
==17396==    by 0x4C2640D: __xlator_init (xlator.c:365)
==17396==    by 0x4C26537: xlator_init (xlator.c:388)
==17396==    by 0x4C68036: glusterfs_graph_init (graph.c:300)
==17396==    by 0x4C687DC: glusterfs_graph_activate (graph.c:490)
==17396== 

==17396== 1,438 (488 direct, 950 indirect) bytes in 1 blocks are definitely lost in loss record 308 of 353
==17396==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==17396==    by 0x4C59BCC: __gf_calloc (mem-pool.c:145)
==17396==    by 0x4C55882: __fd_create (fd.c:600)
==17396==    by 0x4C559BC: fd_create_uint64 (fd.c:646)
==17396==    by 0x949046F: nlm4_file_open_and_resume (nlm4.c:529)
==17396==    by 0x949281E: nlm4_lock_resume (nlm4.c:1252)
==17396==    by 0x948D4B3: nfs3_fh_resolve_inode_done (nfs3-helpers.c:3545)
==17396==    by 0x948E990: nfs3_fh_resolve_inode (nfs3-helpers.c:3971)
==17396==    by 0x948EA24: nfs3_fh_resolve_resume (nfs3-helpers.c:4003)
==17396==    by 0x948EC4F: nfs3_fh_resolve_root (nfs3-helpers.c:4057)
==17396==    by 0x948EE8F: nfs3_fh_resolve_and_resume (nfs3-helpers.c:4104)
==17396==    by 0x9492E18: nlm4svc_lock (nlm4.c:1312)

Comment 1 Rajesh 2012-03-27 06:48:13 UTC
hi shwetha, do you have the nfs logs corresponding to this valgrind report?

Comment 2 Rajesh 2012-03-28 06:48:02 UTC
when the process is terminated, there could still be pending replies, hence the missing unref/free's on inodes and fd's, which happen in cbk's.

Comment 3 Anand Avati 2012-03-29 14:54:43 UTC
CHANGE: http://review.gluster.com/2994 (core: fix all the iobuf related refs and unrefs) merged in master by Vijay Bellur (vijay)