Re: Crash with FD_SET when there are more than 1024 open files
Re: Crash with FD_SET when there are more than 1024 open files
- Subject: Re: Crash with FD_SET when there are more than 1024 open files
- From: email@hidden (Stefan Haller)
- Date: Fri, 16 Apr 2010 10:40:42 +0200
Stuart Smith <email@hidden> wrote:
> > We are investigating a reproducible crash that happens in Bonjour code
> > when we have many files open. The crash happens in
> > DNSServiceProcessResult (part of mDNSResponder), which contains the
> > following code:
>
> It seems you have a few alternatives:
> recompile with a larger value for FD_SETSIZE
> check that sd+1 is <= FD_SETSIZE before calling select(), although that
> isn't particularly helpful....
> use poll() instead of select()
Sigh; it seems I completely failed to make myself clear. Let me try
again:
The code I posted is not my code; if it was, I would know how to make it
work. The code is in mDNSResponder which is part of Mac OS.
I'm not even actively calling this code. All I'm doing is opening an
NSSavePanel; this causes the offending code to run (presumably in order
to populate the save panel's side bar with file servers). This seems to
be outside of my control.
I consider this a bug in Apple's code, and I reported it as such.
My concern, however, is that other, similar code might be running in my
process over which I have no control either. For example in other parts
of Mac OS, or as part of plugins that my application loads.
Also, for this particular bug it's not sufficiant for us to wait until
Apple fixes it in a future 10.6.x update. Many of our users are still
running 10.5 and don't want to upgrade.
So I'm looking for ways to protect against this, for example by making
sure that there are always enough small file descriptors available.
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden