Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keychain access crashing on SecKeychainFindGenericPassword



On Jul 27, 2008, at 3:03 PM, Greg wrote:

Hi, I don't know if this is the right list to post this to, but I'm encountering an annoying problem and I'm not sure where to turn to for help, so I apologize if this is the wrong place to ask this question.

I'm writing a program that stores some secure preferences in the keychain access application, and retrieves them via this call:

	void *rawData = NULL;
	UInt32 dataLength;
	status = SecKeychainFindGenericPassword(keychain,
		LABEL_LENGTH, DEFAULT_LABEL,
		[key length], [key UTF8String],
		&dataLength, &rawData, ref);

This works, sometimes, and it used to work all the time. Then suddenly, it stopped working for some reason that I've yet to pin down.

Remove the file /var/db/CodeEquivalenceDatabase and reboot. That file has gotten corrupted and runs securityd into an endless memory-eating loop that (usually) ends up running your system out of memory and into the ground.


Securityd uses the code equivalence database to keep track of programs that the user said are "the same". Sadly, it uses dbm for that database (that was before sqlite showed up :-), and dbm has this "interesting" corruption behavior. Happily, the code equivalence database is not used at all for signed programs, and so we'll be phasing out the entire equivalence feature some time (relatively) soon.

(Meanwhile, you *could* sign your program during development. It would get rid of the keychain dialog, if nothing else. You still want to ditch the corrupted file, though.)

Cheers
-- perry
---------------------------------------------------------------------------
Perry The Cynic email@hidden
To a blind optimist, an optimistic realist must seem like an Accursed Cynic.
---------------------------------------------------------------------------


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/apple-cdsa/email@hidden

This email sent to email@hidden
References: 
 >Keychain access crashing on SecKeychainFindGenericPassword (From: Greg <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.