Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 1997 12:43:35 +1000
From:      Mike Smith <mike@smith.net.au>
To:        Graham Wheeler <gram@cdsec.com>
Cc:        freebsd-hackers@freebsd.org, freebsd-bugs@freebsd.org, gram@gram.cdsec.com (Graham Wheeler)
Subject:   Re: Memory leak in getservbyXXX? 
Message-ID:  <199709120243.MAA00728@word.smith.net.au>
In-Reply-To: Your message of "Sat, 11 Sep 1997 18:44:22 %2B0200." <199709111644.SAA18957@cdsec.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> We have a application-level gateway program which is occasionally freezing
> up, in what seems to be a busy loop (if we run `top' the gateway process is
> the most CPU-intensive, chewing up CPU cycles as fast as it can). We have
> collected several core dumps from the gateway program when this happens. 

If you can simulate the situation locally, attaching to the running 
process with gdb and stepping through the loop would almost certainly 
be very instructive.

> In each case, while the location in our own code varies, the stack trace
> always ends in a call to getservbyname() or getservbyport(). These in turn
> are calling either malloc() or free(), which in turn seem to be calling
> fstat() (at least according to the stack backtrace).

That's fairly odd; malloc()/free() do not call fstat().   Are you using 
the system malloc() or the GNU version?  

> Is anyone aware of a problem with the implementation of the /etc/services
> lookup routines in FreeBSD 2.2.2? I will go through the library source code
> myself tomorrow, and compre it with FreeBSD 2.1.0, but I am hoping that this
> problem is already known, and hopefully that a fix is available.

Not as far as I am aware; something like this would have been somewhat 
of a showstopper I would expect.  If you have a copy of the CVS 
repository on hand extracting the changes between 2.1 and 2.2 would be 
very straightforward.

Please keep us informed of your progress, and if there is anything more 
we can do to help, please ask!

mike





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709120243.MAA00728>