Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


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

gethotbyname error continued



The reason gethostbyname() is failing is because it is called before 
create_socket(). Instead of a memory leak, you have an fd leak :-)
On 18 Jun 2002 at 20:24, Frank Ramsay wrote:

> Dude!  you the man!
> Just after I sent the message I had been trying to think of what resource 
> could be running out but file descriptors never occured to me because the 
> create_socket isn't what's failing.  I'm going to 'discuss' this with the 
> guy who wrote it... (a whole day wasted becase he didn't type 
> close(conn_socket) in a few places. :(
> 
> -fjr
> 
> 
> >From: "Patrick R. McManus" <mcmanus at ducksong.com>
> >To: Frank Ramsay <fjramsay1234 at hotmail.com>
> >CC: warlord at MIT.EDU, discuss at blu.org
> >Subject: Re: gethotbyname error continued
> >Date: Tue, 18 Jun 2002 15:56:31 -0400
> >
> >[Frank Ramsay: Tue, Jun 18, 2002 at 07:52:38PM +0000]
> > > It is hitting gethostbyname (I put in printfs to be sure sure) and I 
> >tried
> > > changing the sethostent(0) to sethostent(1) and it didn't help
> > > BUT
> > > I've discovered that it stops working on the 1022n'd call _every time_
> > > (I removed the sleep in the main loop to get it to run faster) And that 
> >is
> > > very strange and I'm wondering if it's a bug in the library itself.
> >
> >Ahh!
> >
> >you're running out of filedescriptors..
> >
> >you do socket() to open a connection but you never do a close()...
> >
> >gethostbyname() can't get a fd (which it needs to open() /etc/hosts)
> >because they're all in use by your sockets.
> >
> >you aren't using all those sockets - close them.
> >
> >-P
> 
> 
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://www.blu.org/mailman/listinfo/discuss


--
Jerry Feldman <gaf at blu.org>
Associate Director
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org