3

I'm getting suddenly a crash when trying to save my VPN profile. I believe this happens due to permission problems when accessing the keychain. Unlike iOS where I can delete the whole app on the simulator and fully reset it, on mac I don't seem to be able to do that.

I never get that initial popup where it asks me if it had the permission to install the profile. Is there a way to fully reset this?

var vpnManager : NEVPNManager
self.vpnManager.loadFromPreferences(completionHandler: vpnLoadHandler)

func vpnLoadHandler(error: (Error?)) -> Void {
  self.vpnManager.saveToPreferences(completionHandler: vpnSaveHandler). // Crash happens here
}

Exception:

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000004
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [8290]

VM Regions Near 0x4:
--> 
    __TEXT                 0000000100791000-00000001009d0000 [ 2300K] r-x/r-x SM=COW  /Users/USER/Library/Developer/Xcode/DerivedData/myapp-dspbcxdpmpqntaeullwdrgftmcyb/Build/Products/Debug/myapp-mac.app/Contents/MacOS/myapp-mac

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.security              0x00007fff3b000dd5 Security::NameValueDictionary::NameValueDictionary(Security::CssmData const&) + 63
1   com.apple.security              0x00007fff3b1e57eb SecKeychainItemCopyFromPersistentReference + 361
2   com.apple.NetworkExtension      0x00007fff352735cc -[NEKeychainItem copyKeychainItem:copyPrivateKey:] + 484
3   com.apple.NetworkExtension      0x00007fff35274276 -[NEKeychainItem copyDataFromKeychainItem:outPassword:outIdentifier:outPersistentReference:] + 89
4   com.apple.NetworkExtension      0x00007fff3527454d -[NEKeychainItem copyPassword] + 119
5   com.apple.NetworkExtension      0x00007fff352ebe0b -[NEVPNManager additionalSetup] + 929
6   com.apple.NetworkExtension      0x00007fff352ec2b6 -[NEVPNManager saveToPreferencesWithCompletionHandler:] + 288
Houman
  • 64,245
  • 87
  • 278
  • 460

0 Answers0