NSURLConnection crashes on Leopard
NSURLConnection crashes on Leopard
- Subject: NSURLConnection crashes on Leopard
- From: "Justin R. Miller" <email@hidden>
- Date: Wed, 14 Nov 2007 15:16:38 -0500
Hello,
I have an application that's stable on Tiger but is now crashing for
some users on Leopard. The crashes are of two varieties (see below for
excerpts of the crash logs) and seem to be related to NSURLConnection
internals.
I am using NSURLConnection for three types of requests (and from three
classes) in the application (one HTTPS POST and two HTTPS GETs) and
providing authentication info within
didReceiveAuthenticationChallenge: with persistence
NSURLCredentialPersistenceForSession.
I am initializing with initWithRequest: and releasing in one (and only
one) of a couple places in the delegates:
1) within didReceiveResponse: (upon certain HTTP status codes) after
sending a cancel
2) within didFailWithError:
3) within connectionDidFinishLoading:
I'm also potentially releasing outside of the delegate, but only after
sending a cancel message.
I have double-checked my memory management and it's driving me batty.
Where should I turn next? Or am I doing something obviously wrong?
Thanks in advance.
JM
Crash 1:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c17b1ee7
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x95b5c6e8 objc_msgSend + 24
1 com.apple.CFNetwork 0x94392bdf
__CFHTTPMessageDeallocate + 77
2 com.apple.CoreFoundation 0x91a277c8 _CFRelease + 216
3 com.apple.CFNetwork 0x9439387e
_CFURLRequestDeallocate + 113
4 com.apple.CoreFoundation 0x91a277c8 _CFRelease + 216
5 com.apple.CFNetwork 0x94395928
__CFURLCacheNode::~__CFURLCacheNode() + 66
6 com.apple.CFNetwork 0x943b4070
__CFURLCache::RemoveResponseFromCacheContainers(__CFURLCacheNode*,
_CFCachedURLResponse const*, __CFString const*, bool) + 276
7 com.apple.CFNetwork 0x943abae4
__CFURLCache::AddResponseIntoCacheContainers(__CFString const*,
__CFURLCacheNode*, bool) + 184
8 com.apple.CFNetwork 0x94397978
__CFURLCache::CreateAndStoreCacheNode(__CFURLCacheNode*,
_CFCachedURLResponse const*, __CFString const*, _CFURLRequest const*,
void const*, bool) + 272
9 com.apple.CFNetwork 0x943977b3
AddCacheTask(__CFURLCacheNode*) + 221
10 com.apple.CFNetwork 0x9439766b
CFURLCacheAddCachedResponseForRequest + 255
11 com.apple.CFNetwork 0x943949bc
_CFURLConnectionSendCallbacks + 1890
12 com.apple.CFNetwork 0x943941df muxerSourcePerform + 283
13 com.apple.CoreFoundation 0x91a2564e CFRunLoopRunSpecific +
3166
14 com.apple.CoreFoundation 0x91a25d38 CFRunLoopRunInMode + 88
15 com.apple.HIToolbox 0x909368a4
RunCurrentEventLoopInMode + 283
16 com.apple.HIToolbox 0x909365f6 ReceiveNextEventCommon
+ 175
17 com.apple.HIToolbox 0x90936531
BlockUntilNextEventMatchingListInMode + 106
18 com.apple.AppKit 0x90cb5d5b _DPSNextEvent + 657
19 com.apple.AppKit 0x90cb56a0 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
20 com.apple.AppKit 0x90cae6d1 -[NSApplication run] +
795
21 com.apple.AppKit 0x90c7b9ba NSApplicationMain + 574
Crash 2:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000008
Crashed Thread: 2
[...]
Thread 2 Crashed:
0 com.apple.CFNetwork 0x95552d88
CFHTTPMessageGetResponseStatusCode + 15
1 com.apple.CFNetwork 0x955976ea
_CFHTTPAuthenticationCreateFromResponseInternal + 40
2 com.apple.CFNetwork 0x95558b20
_CFHTTPConnectionCacheGetConnectionForProtocol + 1741
3 com.apple.CFNetwork 0x955576be createAndOpenStream +
1132
4 com.apple.CFNetwork 0x955571ec httpProtocolStart + 675
5 com.apple.CFNetwork 0x95559c91 httpReadStreamCB + 1669
6 com.apple.CoreFoundation 0x91a9a629
_CFStreamSignalEventSynch + 137
7 com.apple.CoreFoundation 0x91a8864e CFRunLoopRunSpecific +
3166
8 com.apple.CoreFoundation 0x91a88d38 CFRunLoopRunInMode + 88
9 com.apple.Foundation 0x94a86560 +
[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
+ 320
10 com.apple.Foundation 0x94a2304d -[NSThread main] + 45
11 com.apple.Foundation 0x94a22bf4 __NSThread__main__ + 308
12 libSystem.B.dylib 0x96299075 _pthread_start + 321
13 libSystem.B.dylib 0x96298f32 thread_start + 34
--
Justin R. Miller
Code Sorcery Workshop
http://codesorcery.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden