Steinar H. Gunderson wrote:
Your best guess at this point is probably Valgrind. Recompile the etch version with debug information (remove the "dh_strip" line in debian/rules), then run mountd with "valgrind --leak-check=full rpc.mountd -F -d all". After it's started leaking, just Ctrl-C it and see what comes out. You're probably most interested in the "definitely leaked" part.
In attach the valgrind output with libc6-dbg installed and /etc/nsswitch configured to use files for netgroups instead of ldap. The memory leaks is still there.
-- Rik Theys 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
==19854== Memcheck, a memory error detector. ==19854== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==19854== Using LibVEX rev 1658, a library for dynamic binary translation. ==19854== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==19854== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework. ==19854== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==19854== For more details, rerun with: -v ==19854== ==19854== My PID = 19854, parent PID = 13178. Prog and args are: ==19854== rpc.mountd ==19854== -F ==19854== -d ==19854== all ==19854== ==19854== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==19854== at 0x4100306: sendto (socket.S:65) ==19854== by 0x411B1CE: __netlink_request (ifaddrs.c:131) ==19854== by 0x411B92C: getifaddrs (ifaddrs.c:378) ==19854== by 0x4120650: __get_myaddress (pmap_clnt.c:60) ==19854== by 0x412072A: pmap_unset (pmap_clnt.c:151) ==19854== by 0x8052856: rpc_init (rpcmisc.c:75) ==19854== by 0x804B80E: main (mountd.c:674) ==19854== Address 0xBED3F69D is on thread 1's stack ==19854== ==19854== Syscall param socketcall.sendto(msg) points to uninitialised byte(s) ==19854== at 0x4100306: sendto (socket.S:65) ==19854== by 0x411B1CE: __netlink_request (ifaddrs.c:131) ==19854== by 0x411B948: getifaddrs (ifaddrs.c:390) ==19854== by 0x4120650: __get_myaddress (pmap_clnt.c:60) ==19854== by 0x412072A: pmap_unset (pmap_clnt.c:151) ==19854== by 0x8052856: rpc_init (rpcmisc.c:75) ==19854== by 0x804B80E: main (mountd.c:674) ==19854== Address 0xBED3F69D is on thread 1's stack ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804F56A: xtab_write (xtab.c:90) ==19854== by 0x804B2DF: main (mountd.c:689) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C7C0: mountlist_del (rmtab.c:99) ==19854== by 0x804AF4F: mount_umnt_1_svc (mountd.c:230) ==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) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C7C0: mountlist_del (rmtab.c:99) ==19854== by 0x804AEFE: mount_umnt_1_svc (mountd.c:231) ==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) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C413: mountlist_add (rmtab.c:59) ==19854== by 0x804CD77: cache_export (cache.c:403) ==19854== by 0x804A779: get_rootfh (mountd.c:420) ==19854== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349) ==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) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C413: mountlist_add (rmtab.c:59) ==19854== by 0x804CD50: cache_export (cache.c:405) ==19854== by 0x804A779: get_rootfh (mountd.c:420) ==19854== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349) ==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) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C413: mountlist_add (rmtab.c:59) ==19854== by 0x804D13D: nfsd_export (cache.c:298) ==19854== by 0x804CDFA: cache_process_req (cache.c:345) ==19854== by 0x804D88D: my_svc_run (svc_run.c:88) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C413: mountlist_add (rmtab.c:59) ==19854== by 0x804D3DE: nfsd_fh (cache.c:228) ==19854== by 0x804CDFA: cache_process_req (cache.c:345) ==19854== by 0x804D88D: my_svc_run (svc_run.c:88) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== Syscall param open(mode) contains uninitialised byte(s) ==19854== at 0x40F190D: open64 (open64.c:41) ==19854== by 0x805215D: xflock (xio.c:60) ==19854== by 0x804C413: mountlist_add (rmtab.c:59) ==19854== by 0x804D7F9: auth_unix_ip (cache.c:87) ==19854== by 0x804CDFA: cache_process_req (cache.c:345) ==19854== by 0x804D88D: my_svc_run (svc_run.c:88) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== ERROR SUMMARY: 5681 errors from 10 contexts (suppressed: 21 from 2) ==19854== malloc/free: in use at exit: 1,734,220 bytes in 5,813 blocks. ==19854== malloc/free: 101,748 allocs, 95,935 frees, 65,922,982 bytes allocated. ==19854== For counts of detected errors, rerun with: -v ==19854== searching for pointers to 5,813 not-freed blocks. ==19854== checked 228,368 bytes. ==19854== ==19854== ==19854== 6,150 bytes in 256 blocks are definitely lost in loss record 15 of 20 ==19854== at 0x401D38B: malloc (vg_replace_malloc.c:149) ==19854== by 0x804DFB1: client_compose (client.c:309) ==19854== by 0x804BB72: auth_authenticate (auth.c:85) ==19854== by 0x804A527: get_rootfh (mountd.c:384) ==19854== by 0x804A8CB: mount_mnt_3_svc (mountd.c:349) ==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) ==19854== by 0x804B6F8: main (mountd.c:722) ==19854== ==19854== ==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) ==19854== ==19854== ==19854== 1,405,440 bytes in 2,745 blocks are definitely lost in loss record 20 of 20 ==19854== at 0x401D38B: malloc (vg_replace_malloc.c:149) ==19854== by 0x401D415: realloc (vg_replace_malloc.c:306) ==19854== by 0x4267B62: ??? ==19854== by 0x4119200: innetgr (getnetgrent_r.c:352) ==19854== by 0x804DD54: client_check (client.c:390) ==19854== by 0x804DF7A: client_compose (client.c:260) ==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== ==19854== LEAK SUMMARY: ==19854== definitely lost: 1,580,262 bytes in 5,746 blocks. ==19854== possibly lost: 0 bytes in 0 blocks. ==19854== still reachable: 153,958 bytes in 67 blocks. ==19854== suppressed: 0 bytes in 0 blocks. ==19854== Reachable blocks (those to which a pointer was found) are not shown. ==19854== To see them, rerun with: --show-reachable=yes