Export to GitHub

wtclient - issue #7

Crash when deallocating WTClient


Posted on Nov 25, 2010 by Swift Monkey

I observe a crash sometimes at the end of an upload. After investigation, it seems to be caused by a missing setter in WTClient.m, where the authentication is not retained when it should be. Here is a proposed setter:

  • (void)setAuthentication:(CFHTTPAuthenticationRef)auth { if(auth != authentication) { if(authentication) CFRelease(authentication); authentication = auth; if(authentication) CFRetain(authentication); } }

Thread 3 Crashed: 0 libobjc.A.dylib 0x02820a63 objc_msgSend + 23 1 CFNetwork 0x01be9534 HTTPMessage::~HTTPMessage() + 160 2 CoreFoundation 0x025d5bcb _CFRelease + 251 3 CFNetwork 0x01c0eefe HTTPReadStream::~HTTPReadStream() + 100 4 CoreFoundation 0x025d5bcb _CFRelease + 251 5 CoreFoundation 0x025f969c CFStreamDeallocate + 204 6 CoreFoundation 0x025d5bcb _CFRelease + 251 7 MyApp 0x00246edf -[WTHTTPConnection dealloc] + 541 (WTHTTPConnection.m:301) 8 MyApp 0x002452e0 -[WTClient dealloc] + 457 (WTClient.m:276) 9 Foundation 0x00f612b7 __NSFinalizeThreadData + 1220 10 libSystem.B.dylib 0x94de4289 _pthread_tsd_cleanup + 190 11 libSystem.B.dylib 0x94de3e36 _pthread_exit + 154 12 Foundation 0x00f6ad72 -[NSString compare:options:] + 0 13 Foundation 0x00f6acf0 __NSThread__main + 1411 14 libSystem.B.dylib 0x94ddb85d _pthread_start + 345 15 libSystem.B.dylib 0x94ddb6e2 thread_start + 34

Status: New

Labels:
Type-Defect Priority-Medium