[Samba] nmbd memory leak in 2.2.x CVS

Noel Kelly nkelly at citrusnetworks.net
Sun Nov 24 10:20:00 GMT 2002


Hi Jeremy,

I disabled Hyperthreading on the customer's CPU and have updated their
kernel to the latest Redhat Official one.  There still seems to be a leak in
one of the nmbd processes though.  I have run it through Valgrind for a
couple of days (see below) and although there are errors on one of the
processes, the memory leak summary does not seem to show anything untoward
(the 30 bytes lost seems to happen wherever I test it).

The server is running as a WINS server (2.2.6 from mid-Nov CVS), but it is
only a small network of ten machines.  On my test network of about the same
size the nmbd processes stay static sized.  Can anyone think of an other
reason why a nmbd process would grow continuously from its starting size of
1704 to 13Mb after two weeks?

Thanks,
Noel


[root at roar bin]# killall nmbd
==28849==
==28849== ERROR SUMMARY: 70 errors from 1 contexts (suppressed: 0 from 0)
==28849== malloc/free: in use at exit: 301653 bytes in 217 blocks.
==28849== malloc/free: 17416 allocs, 17199 frees, 6698849 bytes allocated.
==28849== For counts of detected errors, rerun with: -v
==28849== searching for pointers to 217 not-freed blocks.
[root at roar bin]# ==28849== checked 5976468 bytes.
==28849==
==28849== definitely lost: 30 bytes in 1 blocks.
==28849== possibly lost:   0 bytes in 0 blocks.
==28849== still reachable: 301623 bytes in 216 blocks.
==28849==
==28849== 30 bytes in 1 blocks are definitely lost in loss record 9 of 31
==28849==    at 0x40044624: malloc (vg_clientfuncs.c:100)
==28849==    by 0x8089CEA: string_init (in /usr/local/samba/bin/nmbd)
==28849==    by 0x8064ED5: lp_set_logfile (in /usr/local/samba/bin/nmbd)
==28849==    by 0x804C0E6: main (in /usr/local/samba/bin/nmbd)
==28849==
==28849== LEAK SUMMARY:
==28849==    definitely lost: 30 bytes in 1 blocks.
==28849==    possibly lost:   0 bytes in 0 blocks.
==28849==    still reachable: 301623 bytes in 216 blocks.
==28849== Reachable blocks (those to which a pointer was found) are not
shown.
==28849== To see them, rerun with: --show-reachable=yes
==28849==
==28850== discard 142 (1928 -> 26071) translations in range 0x40269000 ..
0x40272FFF
==28850== discard syms in /lib/libnss_files-2.2.5.so due to munmap()
==28850==
==28850== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 1)
==28850== malloc/free: in use at exit: 1173586 bytes in 9408 blocks.
==28850== malloc/free: 24593 allocs, 15185 frees, 19931893 bytes allocated.
==28850== For counts of detected errors, rerun with: -v
==28850== searching for pointers to 9408 not-freed blocks.
==28850== checked 7120108 bytes.
==28850==
==28850== definitely lost: 30 bytes in 1 blocks.
==28850== possibly lost:   0 bytes in 0 blocks.
==28850== still reachable: 1173556 bytes in 9407 blocks.
==28850==
==28850== 30 bytes in 1 blocks are definitely lost in loss record 16 of 38
==28850==    at 0x40044624: malloc (vg_clientfuncs.c:100)
==28850==    by 0x8089CEA: string_init (in /usr/local/samba/bin/nmbd)
==28850==    by 0x8064ED5: lp_set_logfile (in /usr/local/samba/bin/nmbd)
==28850==    by 0x804C0E6: main (in /usr/local/samba/bin/nmbd)
==28850==
==28850== LEAK SUMMARY:
==28850==    definitely lost: 30 bytes in 1 blocks.
==28850==    possibly lost:   0 bytes in 0 blocks.
==28850==    still reachable: 1173556 bytes in 9407 blocks.
==28850== Reachable blocks (those to which a pointer was found) are not
shown.
==28850== To see them, rerun with: --show-reachable=yes
==28850==

-----Original Message-----
From: jra at dp.samba.org [mailto:jra at dp.samba.org]
Sent: 17 November 2002 19:25
To: Noel Kelly
Cc: samba at lists.samba.org
Subject: Re: [Samba] nmbd memory leak in 2.2.x CVS


On Thu, Nov 14, 2002 at 07:58:07PM -0000, Noel Kelly wrote:
> I am running 2.2.6 on a customer's site and everything has been perfect.
> However I noticed the other day that one of the two nmbd processes (it is
a
> wins server) had grown to 13Mb over a two week period.  
> 
> I needed to update to the latest CVS version anyway and had hoped that
> something in that might fix things.  Five days later and things are
looking
> the same:
> 
> nmbd started on Nov 9th:
> root      1271  0.0  0.2  3684 1456 ?        S    Nov09   0:10
> /usr/local/samba/bin/nmbd -o
> root      1272  0.0  0.8  7100 4428 ?        S    Nov09   0:02
> /usr/local/samba/bin/nmbd -o
> 
> Today Nov 14th:
> root      1271  0.0  0.2  3688 1460 ?        S    Nov09   0:21
> /usr/local/samba/bin/nmbd -o
> root      1272  0.0  1.8 12376 9704 ?        S    Nov09   0:07
> /usr/local/samba/bin/nmbd -o
> 
> 
> As you can see nmbd process 1271 has slowly gets larger.  I have tried
> restarting after removing wins.dat but to no avail.
> 
> This is a PDC and the only server on a network with about ten XP clients.
> 'os level' is 65.  The log looks perfectly normal.
> 
> Anyone aware of the cause/solution or any suggestions to troubleshoot?  

Are you running it as a WINS server ? Can you try it with valgrind
and see if it catches any leaks ?

Jeremy.

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.410 / Virus Database: 231 - Release Date: 31/10/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.410 / Virus Database: 231 - Release Date: 31/10/2002
 



More information about the samba mailing list