Open cloudshiftchris opened 2 years ago
Perhaps the context here is relevant.
It talks about releasing a resource, otherwise "invalid record" errors will be encountered.
Issue is likely in modifyGenericPassword - it isn't calling CFRelease on the pointer passed to SecKeychainItemModifyContent
Hey, thanks for the detailed report @cloudshiftchris. I'll have a better look at it when I manage to find a whole in my schedule. Feel free to submit a PR in the meantime if you want.
After a period of time (presumably, possibly some other undetermined factor) all keychain API calls fail with 'Invalid Record' exception. This persists until the process is restarted.
Context:
./gradlew daemon --stop
) and re-running a build launches a new daemon that works successfully (for a period of time)Workaround:
As noted above, stopping the Gradle daemon and restarting is the only identified workaround.
Calling code:
The below Kotlin code is what makes the OSX Keychain API calls; note the delete/add, in an attempt to compensate (this does not work). When the failure mode is active, all API calls here consistently fail - modify, find, delete, add.
pt.davidafsilva.apple:jkeychain:1.1.0
Gradle: 7.4.2, 7.5.1
openjdk 17.0.5 2022-10-18 LTS OpenJDK Runtime Environment Corretto-17.0.5.8.1 (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.5.8.1 (build 17.0.5+8-LTS, mixed mode, sharing)
MacBook Pro / M1 Pro chip / 32GB RAM ProductName: macOS ProductVersion: 12.6 BuildVersion: 21G115