Steinar H. Gunderson wrote:
I've looked through the loss records while waiting for the Omega reports:
<snip/>
==19854== 168,672 bytes in 2,745 blocks are definitely lost in loss record 19
of 20
==19854== at 0x401D38B: malloc (vg_replace_malloc.c:149)
==19854== by 0x80531D7: xmalloc (xcommon.c:152)
==19854== by 0x804ECD6: hostent_dup (hostname.c:124)
==19854== by 0x804EEC7: get_reliable_hostbyaddr (hostname.c:253)
==19854== by 0x804DF23: client_compose (client.c:253)
==19854== by 0x804BB72: auth_authenticate (auth.c:85)
==19854== by 0x804AEB9: mount_umnt_1_svc (mountd.c:225)
==19854== by 0x8052BBD: rpc_dispatch (rpcdispatch.c:55)
==19854== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==19854== by 0x41226C1: svc_getreq_common (svc.c:465)
==19854== by 0x4122716: svc_getreqset (svc.c:376)
==19854== by 0x804D899: my_svc_run (svc_run.c:90)
This one looks like a genuine leak. client_compose() seems to do a host
lookup without actually freeing it. Could you try adding a "free(he);" to the
bottom of client_compose() (support/export/client.c:253)?
I've patched this file and reran valgrind. I changed the exports so it
lists * instead of a netgroup and removed all ldap entries from
nsswitch.conf. The used memory increases to about 5.9% and stays on that
level. This patch seems to help.
See attach for valgrind output.
I'm currently rerunning my test with a netgroup in /etc/exports.
When that's done (stays stable at approx 6%), I will also patch the
client.c file for the leak you mentioned first (free(old);) and see if
it helps even more.
Rik
--
Rik Theys
Systeemgroep
KU Leuven - Dept. ESAT
Kasteelpark Arenberg 10
B-3001 LEUVEN - HEVERLEE
Tel.: +32(0)16/32.11.07
----------------------------------------------------------------
<<Any errors in spelling, tact or fact are transmission errors>>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
==4465== Memcheck, a memory error detector.
==4465== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==4465== Using LibVEX rev 1658, a library for dynamic binary translation.
==4465== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==4465== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation
framework.
==4465== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==4465== For more details, rerun with: -v
==4465==
==4465== My PID = 4465, parent PID = 13178. Prog and args are:
==4465== rpc.mountd
==4465== -F
==4465== -d
==4465== all
==4465==
==4465== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==4465== at 0x4101306: sendto (socket.S:65)
==4465== by 0x411C1CE: __netlink_request (ifaddrs.c:131)
==4465== by 0x411C92C: getifaddrs (ifaddrs.c:378)
==4465== by 0x4121650: __get_myaddress (pmap_clnt.c:60)
==4465== by 0x412172A: pmap_unset (pmap_clnt.c:151)
==4465== by 0x8052866: rpc_init (rpcmisc.c:75)
==4465== by 0x804B80E: main (mountd.c:674)
==4465== Address 0xBE84469D is on thread 1's stack
==4465==
==4465== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==4465== at 0x4101306: sendto (socket.S:65)
==4465== by 0x411C1CE: __netlink_request (ifaddrs.c:131)
==4465== by 0x411C948: getifaddrs (ifaddrs.c:390)
==4465== by 0x4121650: __get_myaddress (pmap_clnt.c:60)
==4465== by 0x412172A: pmap_unset (pmap_clnt.c:151)
==4465== by 0x8052866: rpc_init (rpcmisc.c:75)
==4465== by 0x804B80E: main (mountd.c:674)
==4465== Address 0xBE84469D is on thread 1's stack
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804F57A: xtab_write (xtab.c:90)
==4465== by 0x804B2DF: main (mountd.c:689)
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804C413: mountlist_add (rmtab.c:59)
==4465== by 0x804CD77: cache_export (cache.c:403)
==4465== by 0x804A779: get_rootfh (mountd.c:420)
==4465== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349)
==4465== by 0x8052BCD: rpc_dispatch (rpcdispatch.c:55)
==4465== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==4465== by 0x41236C1: svc_getreq_common (svc.c:465)
==4465== by 0x4123716: svc_getreqset (svc.c:376)
==4465== by 0x804D899: my_svc_run (svc_run.c:90)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804C413: mountlist_add (rmtab.c:59)
==4465== by 0x804CD50: cache_export (cache.c:405)
==4465== by 0x804A779: get_rootfh (mountd.c:420)
==4465== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349)
==4465== by 0x8052BCD: rpc_dispatch (rpcdispatch.c:55)
==4465== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==4465== by 0x41236C1: svc_getreq_common (svc.c:465)
==4465== by 0x4123716: svc_getreqset (svc.c:376)
==4465== by 0x804D899: my_svc_run (svc_run.c:90)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804C7C0: mountlist_del (rmtab.c:99)
==4465== by 0x804AF4F: mount_umnt_1_svc (mountd.c:230)
==4465== by 0x8052BCD: rpc_dispatch (rpcdispatch.c:55)
==4465== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==4465== by 0x41236C1: svc_getreq_common (svc.c:465)
==4465== by 0x4123716: svc_getreqset (svc.c:376)
==4465== by 0x804D899: my_svc_run (svc_run.c:90)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804C7C0: mountlist_del (rmtab.c:99)
==4465== by 0x804AEFE: mount_umnt_1_svc (mountd.c:231)
==4465== by 0x8052BCD: rpc_dispatch (rpcdispatch.c:55)
==4465== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==4465== by 0x41236C1: svc_getreq_common (svc.c:465)
==4465== by 0x4123716: svc_getreqset (svc.c:376)
==4465== by 0x804D899: my_svc_run (svc_run.c:90)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== Syscall param open(mode) contains uninitialised byte(s)
==4465== at 0x40F290D: open64 (open64.c:41)
==4465== by 0x805216D: xflock (xio.c:60)
==4465== by 0x804C413: mountlist_add (rmtab.c:59)
==4465== by 0x804D3DE: nfsd_fh (cache.c:228)
==4465== by 0x804CDFA: cache_process_req (cache.c:345)
==4465== by 0x804D88D: my_svc_run (svc_run.c:88)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== ERROR SUMMARY: 29614 errors from 8 contexts (suppressed: 21 from 2)
==4465== malloc/free: in use at exit: 186,822 bytes in 1,437 blocks.
==4465== malloc/free: 382,888 allocs, 381,451 frees, 320,901,309 bytes
allocated.
==4465== For counts of detected errors, rerun with: -v
==4465== searching for pointers to 1,437 not-freed blocks.
==4465== checked 228,208 bytes.
==4465==
==4465==
==4465== 32,880 bytes in 1,370 blocks are definitely lost in loss record 17 of
18
==4465== at 0x401D38B: malloc (vg_replace_malloc.c:149)
==4465== by 0x804DFB1: client_compose (client.c:310)
==4465== by 0x804BB72: auth_authenticate (auth.c:85)
==4465== by 0x804A527: get_rootfh (mountd.c:384)
==4465== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349)
==4465== by 0x8052BCD: rpc_dispatch (rpcdispatch.c:55)
==4465== by 0x804BA4F: mount_dispatch (mount_dispatch.c:83)
==4465== by 0x41236C1: svc_getreq_common (svc.c:465)
==4465== by 0x4123716: svc_getreqset (svc.c:376)
==4465== by 0x804D899: my_svc_run (svc_run.c:90)
==4465== by 0x804B6F8: main (mountd.c:722)
==4465==
==4465== LEAK SUMMARY:
==4465== definitely lost: 32,880 bytes in 1,370 blocks.
==4465== possibly lost: 0 bytes in 0 blocks.
==4465== still reachable: 153,942 bytes in 67 blocks.
==4465== suppressed: 0 bytes in 0 blocks.
==4465== Reachable blocks (those to which a pointer was found) are not shown.
==4465== To see them, rerun with: --show-reachable=yes