3

尝试保存我的 VPN 配置文件时突然崩溃。我相信这是由于访问钥匙串时的权限问题造成的。与我可以在模拟器上删除整个应用程序并完全重置它的 iOS 不同,在 mac 上我似乎无法做到这一点。

我从来没有收到过它询问我是否有权安装配置文件的初始弹出窗口。有没有办法完全重置这个?

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

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

例外:

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
4

0 回答 0