On Oct 19, 2009, at 2:16 AM, Keith Duncan wrote:
I wrote a simple NSURLProtocol subclass and started observing crashes in URL Loading code. I've extracted the crasher into a simple test project which loads an image from a URL with custom scheme which I handle every hundredth of a second.

When compiled with -fobjc-gc it reliably crashes; without it runs indefinitely however, there are leaked NSString instances allocated by NSURLConnection in +sendSynchronousRequest:… I've filed this as rdar://problem/7314551 for reference.

The test project can be found http://33software.com/files/CrashLoadingURL.zip The bug is reproductable in the SpecialPictureProtocol sample code if compiled for garbage collection too.

Can anyone else verify this or point to a workaround?

Looks like a bug somewhere, and I don't see anything obviously wrong in your code.

At first I was suspicious because your -startLoading code calls other notifications like didReceiveResponse and didFinishLoading. Some clients can be confused about that; they aren't prepared for the connection to be torn down that early. The usual solution is to do the real work using performSelector:@selector(doRealWork) withObject:nil afterDelay:0.0, but I tried that and it still crashed.

At this point I expect there's a GC bug in the NSURLProtocol machinery, specifically the bridge between NSURLProtocol and CFURLProtocol. We'll look further in 7314551.


--
Greg Parker     gpar...@apple.com      Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to