evgenyneu/keychain-swift

KeychainStorage with iOS version 12

MariaJsn opened this issue · 5 comments

Hello,
When I tried to open app I am getting error from KeychainStorage with iOS version 12.4. (There is a code in appdelegate related with KeychainStorage)
It says 'EXC_BAD_ACCESS', There is no more detail message

How can I fix this error?

Thanks
Maria

Hi @MariaJsn, thanks for reporting the issue. The error looks similar to this issue #63. I don't know how to fix it, sorry. There must be a bug in this library.

Just FYI, I have found that it isn't really a good idea to thread access to the UserDefaults prefs. I have a threaded test in my RVS_Persistent_Prefs project that I have commented out, because it's basically a proof that the class isn't thread-safe. Not sure if the same goes for the keychain.

It's probably my fault, but I never really worried too much about it, as the class isn't really meant to be used in a thread-heavy environment.

Thanks @ChrisMarshallNY that's good to know.

Not sure if the same goes for the keychain.

It does, Keychain API is not thread safe. ahernandezlopez has added locks to this library to fix the crashes (#68). But there could still be concurrency bugs in this library.

I believe that Apple’s guidance is that any SDK element should be considered NOT thread-safe, unless specifically labeled as thread-safe.

That’s actually a pretty significant part of their UIKit/AppKit/WatchKit framework. I’m not sure if SwiftUI is improving that.

BTW, thanks for this tool. I’ve been using it for years.