Keychain methods fail with undocumented error -34018

Originator:chris.saldanha
Number:rdar://24566651 Date Originated:Feb 9, 2016
Status:Open Resolved:
Product:iOS SDK Product Version:(multiple)
Classification: Reproducible:sometimes
 
We are experiencing seemingly random errors from keychain access methods like SecItemCopyMatching() -- in cases where we know there's a value stored, we instead get the return code -34018 which is not a documented error code.

In many cases, we can quit and run the app again, and the same code will instead return the correct value and no error.

Steps to Reproduce:
Call SecItemCopyMatching() with a valid dictionary to request access to an existing keychain item, fails with error -34018 some of the time.

Expected Results:
Keychain methods should only return documented error codes, so should never return this error code.  If there is a problem accessing the keychain, there are existing error codes to communicate the reason for the failure.  In our cases, the keychain methods should return correct values in all cases that we see the -34018 code.

Actual Results:
We are getting error code -34018.

Version:
Multiple versions up to and including iOS 9.2.1

Notes:
This is likely the same issue being discussed on the Internet, like here: https://forums.developer.apple.com/thread/4743

Configuration:
Multiple devices, including iPhone and iPad

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!