Subject: lib/33491: Severe memory leak in telldir() shows up with samba + large dirs
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <pkplex@orcon.net.nz>
List: netbsd-bugs
Date: 05/16/2006 09:45:00
>Number:         33491
>Category:       lib
>Synopsis:       Severe memory leak in telldir() shows up with samba + large dirs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 16 09:45:00 +0000 2006
>Originator:     Josh
>Release:        3.0 STABLE
>Organization:
>Environment:
Machine has been replaced with obsd... no uname -a right now, sorry...
>Description:
When running smbd ( from the 3.0 packages ) on a netbsd 3.0 STABLE box, and a large directory with many files is transferred onto the netbsd machine via samba, the smbd process starts using up memory very rapidly, in my case in around 1mb more memory per second, untill around 110Mb when the process was killed.

>How-To-Repeat:
Run smbd on a netbsd 3.0 box ( possibly other versions of netbsd ) and install samba from 3.0 pacakges. Set up some sort of smb share and then throw a huge directory tree with thousands of files in it onto the netbsd box.
>Fix:
The same problem occurs in obsd 3.8/3.9, And there is a patch for it in obsd current.

You can see the changes made to obsd here: 

http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/opendir.c
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/seekdir.c

I beleive freebsd also wrote a patch for this too.

:)

Josh