NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: memory leak in gethnamaddr?



On Sunday 16 March 2014 16:45:41 Christos Zoulas wrote:
> >So is there now a memory leak in gethostbyaddr/gethostbyname or is
> >sge_qmaster calling them in some bogus way that it used to get away
> >with but doesn't now?  I can't see what that would be.
> 
> I would bet on a memory leak.

Definitely looks like it.  The following program grows in memory usage 
till exhausted.  "saddleback" is just the name of a local machine in the 
dns.

#include <netdb.h>

main ()
{
  struct hostent *h;
  int i = 0;

  while (1) {
    h = gethostbyname("saddleback");
    i++;
    if (i % 100 == 0) sleep (2);
  }
}


Haven't spotted where the leak is yet.

cheers
mark


Home | Main Index | Thread Index | Old Index