Re: Networking framework crash
Re: Networking framework crash
- Subject: Re: Networking framework crash
- From: Roland King <email@hidden>
- Date: Fri, 06 Feb 2015 08:18:29 +0800
>
>>
>> If you hit that limit you should see errors from various network API. File a bug report if you find some API that causing weird crashes instead of failing gracefully or halting with an appropriate error message when you run out of file descriptors.
>
> Well I'm seeing EXC_GUARD. Is that considered "graceful"? From the user's perspective it isn't, because it causes summary termination of the app which is almost always reported as "it crashed, wah!, you suck!". Ultimately this should propagate up to the NSURLSession API in some way - e.g. by returning nil instead of an object if it can't create its resources. I think one problem there is that the API is asynchronous - it creates the object which then starts a thread to open the socket - that's what the stack trace implies anyway. That would make it hard to simply not return a valid object. Not sure what the right design would be there - that's one for the networking architects to ponder I guess.
>
I don’t think that’s very graceful, no. Since the only ‘documentation’ on EXC_GUARD seems to be in the replies in devforums it’s hard to say exactly what the contract is. However that reply, to my reading, indicates means someone called a normal filehandle method on a guarded filehandle, ie violating the guard. The header file says this
#define EXC_GUARD 12 /* Violated guarded resource protections */
Whereas what you seem to have here is ‘filesystem call to a guarded resource failed in some normal way I could have reported properly’.
Yes you’re out of filehandles and so there’s a failure, would have been much more useful to have the original failure code logged [EMFILE] than EXC_GUARD which (again to my reading) means something entirely different and is misleading. So I’d file a bug against that one.
By the way - where do all these disparate max numbers of filehandles come from? I see the launchd one, makes sense, stuff launched from bash inherits bash’s 2560, stuff launched from finder on my box also gets 2560 (why), Xcode has its own ideas, which I suppose makes some sense as debugged processes probably need more handles and whatever Graham did to launch his process in this case got 256, which I haven’t yet found a way to get a process on 10.10 to do by default yet barring making launchd launch it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden