From owner-freebsd-bugs Thu Sep 11 20:15:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA24428 for bugs-outgoing; Thu, 11 Sep 1997 20:15:46 -0700 (PDT) Received: from word.smith.net.au (word.smith.net.au [202.0.75.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA24414; Thu, 11 Sep 1997 20:15:36 -0700 (PDT) Received: from word.smith.net.au (localhost.smith.net.au [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id MAA00728; Fri, 12 Sep 1997 12:43:35 +1000 (EST) Message-Id: <199709120243.MAA00728@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: Graham Wheeler cc: freebsd-hackers@freebsd.org, freebsd-bugs@freebsd.org, gram@gram.cdsec.com (Graham Wheeler) Subject: Re: Memory leak in getservbyXXX? In-reply-to: Your message of "Sat, 11 Sep 1997 18:44:22 +0200." <199709111644.SAA18957@cdsec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 12 Sep 1997 12:43:35 +1000 From: Mike Smith Sender: owner-freebsd-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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