Hello, I am running RH6.0 + updates on an x86 machine. This box is networked and uses NIS to sync accounts across our network. The problem arises when code like the following is run on a RH6 machine with the default NIS installation: #include <stdio.h> #include <netdb.h> int main() { while (1) { struct hostent* pHostEnt = NULL ; pHostEnt = gethostbyname("www.redhat.com"); } return 0 ; } Note that using gethostbyname_r has the same problem (I did a search on deja.com, and Theodore Tso mentioned that using the standard gethostbyname is prone to memory leaks.) Running this program and watching it in top will show that the process will continually eat memory until it severely bogs down the machine. The problem is glibc-related, but it is actaully triggered with RH's default NIS setup. The "hosts:" entry in /etc/nsswitch.conf has 'nisplus' listed before 'dns' - I'm guessing the leak starts here, as switching the order (ie, having 'dns' listed before 'nisplus' on a network setup that queries a valid DNS server) will fix the problem. --Ant
Hello, I just found this URL on deja.com which sheds more light. Perhaps it's time for a new glibc RPM release? http://x46.deja.com/getdoc.xp?server=x46&AN=479412353&CONTEXT=935376493.1108344895&hitnum=2
One last note - my friend runs the latest Mandrake which includes this version of glibc; he's a huge Mandrake advocate. We can't have RH be behind Mandrake in bugfixes now, can we? ;)
Memory leaks in NIS code are fixed in the Raw Hide glibc.