Crashes when implicitly accessing the Keychain from NSURL
Crashes when implicitly accessing the Keychain from NSURL
- Subject: Crashes when implicitly accessing the Keychain from NSURL
- From: Mike Fischer <email@hidden>
- Date: Thu, 10 Jan 2008 12:38:40 +0100
HI!
I'm not sure this is really a networking issue but I couldn't come up
with a better place to ask this question. So please point me me
somewhere else if you think this would be better asked there.
While developing an application that repeatedly (once per second
would be a reasonable value) loads an image from a webserver
(actually a webcam) a friend of mine testing the app is sometimes
(but not always) encountering crashes that always follow the same
pattern:
Process: XXXXX [261]
Path: /Applications/XXXXX.app/Contents/MacOS/XXXXX
Identifier: de.fi-works.XXXXX
Version: 1.0a2 (2)
Code Type: X86 (Native)
Parent Process: launchd [201]
Date/Time: 2008-01-08 18:51:59.884 +0100
OS Version: Mac OS X 10.5.1 (9B18)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000b00c6070
Crashed Thread: 1
[snip]
Thread 1 Crashed:
0 libSystem.B.dylib 0xffff1299 __longcopy + 153
1 libSystem.B.dylib 0xffff086e __memcpy + 206
2 com.apple.security 0x957df60e
Security::NameValuePair::CloneData(Security::CssmData const&) + 48
3 com.apple.security 0x957df6b2
Security::NameValuePair::NameValuePair(Security::CssmData const&) +
100
4 com.apple.security 0x957df988
Security::NameValueDictionary::NameValueDictionary
(Security::CssmData const&) + 116
5 com.apple.security 0x956e9ad2
Security::KeychainCore::CCallbackMgr::consume(unsigned int,
unsigned int, Security::CssmData const&) + 36
6 com.apple.security 0x957d67f0
Security::SecurityServer::NotificationPort::receive
(Security::MachPlusPlus::Message const&) + 394
7 com.apple.security 0x957f3cdd
Security::MachPlusPlus::CFAutoPort::cfCallback(__CFMachPort*,
void*, long, void*) + 67
8 com.apple.CoreFoundation 0x93c5b5c5 __CFMachPortPerform +
117
9 com.apple.CoreFoundation 0x93c7f941 CFRunLoopRunSpecific
+ 3921
10 com.apple.CoreFoundation 0x93c7fd38 CFRunLoopRunInMode + 88
11 com.apple.Foundation 0x967d9560 +[NSURLConnection
(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 320
12 com.apple.Foundation 0x9677604d -[NSThread main] + 45
13 com.apple.Foundation 0x96775bf4 __NSThread__main__ + 308
14 libSystem.B.dylib 0x90256075 _pthread_start + 321
15 libSystem.B.dylib 0x90255f32 thread_start + 34
[snip]
What's notable about the crashes is that they always look exactly the
same, and always seem to happen inside a thread that is created
internally by [NSURL resourceDataUsingCache:NO], apparently while it
is accessing the keychain to get the authentication info for the url.
The other thing that is remarkable is that each time this happens, a
number of other processes, like Safari and Mail.app running on the
same machine crash with exactly the same error at exactly the same time.
According to my friend Keychain Access.app does not see any errors in
its keychains (the Keychain First Aid command did not find anything).
And I don't see anything obvious that I'm doing wrong. My code,
called from an NSTimer callback, couldn't be more simple and looks
like this:
NSURL *url = [NSURL URLWithString:[self urlString]];
NSData *d = [url resourceDataUsingCache:NO];
And [self urlString] yields @"http://192.168.0.21/axis-cgi/jpg/
image.cgi?resolution=640x480". The webcam initially answers with a
401 return code to ask for HTTP authentication credentials that are
stored in the login Keychain.
I have not seen these crashes on my machine (PPC G5 running 10.4.11).
Any ideas?
Thanks!
Mike
--
Mike Fischer Softwareentwicklung, EDV-Beratung
Schulung, Vertrieb
Web: <http://homepage.mac.com/mike_fischer/index.html>
Note: I read this list in digest mode!
Send me a private copy for faster responses.
_______________________________________________
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