swift - 崩溃 - EXC_BAD_ACCESS KERN_INVALID_ADDRESS 专用 _VariantDictionaryBuffer.nativeUpdateValue(_:forKey:)
问题描述
我发生了崩溃,但我不确定是什么原因造成的。
我使用 Twilio 框架,一切正常,但我遇到了一个奇怪的 prod 崩溃,我看起来像是一个与 Dictionary 相关的问题:
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000e711dbea8
Crashed: com.apple.root.background-qos
0 libobjc.A.dylib 0x182696654 object_getClass + 64
1 CoreFoundation 0x1833f3e18 _CFRelease + 1060
2 TestApp 0x100cae408 specialized _VariantDictionaryBuffer.nativeUpdateValue(_:forKey:) (TicketsManager.swift)
3 TestApp 0x100b4ba94 specialized ChatManager.getAndJoinDialog(roomId:onSuesscs:onFaild:) (ChatManager.swift:798)
4 TestApp 0x100c5e7f0 specialized ChatMessagesManager.getAllMessagesFromServerForTicket(_:) (ChatMessagesManager.swift:164)
5 TestApp 0x1009d7ca0 ChatViewController.loadAllMessagesFomServer() (ChatViewController.swift:460)
6 TestApp 0x1009feed8 partial apply for closure #1 in ChatViewController.viewWillAppear(_:) (ChatViewController.swift:234)
7 TestApp 0x100aee754 closure #1 in static Utils.performTaskOnMain(_:) (Utils.swift:84)
8 TestApp 0x1009b778c thunk for @callee_owned () -> () (QRCodeViewController.swift)
9 libdispatch.dylib 0x182dcd088 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x182dcd048 _dispatch_client_callout + 16
11 libdispatch.dylib 0x182dda378 _dispatch_root_queue_drain + 1028
12 libdispatch.dylib 0x182dd9f10 _dispatch_worker_thread3 + 120
13 libsystem_pthread.dylib 0x183073120 _pthread_wqthread + 1268
14 libsystem_pthread.dylib 0x183072c20 start_wqthread + 4
票务管理器功能:
func getAndJoinDialog(roomId : String,onSuesscs: @escaping (() -> Void),onFaild: @escaping (()-> Void)) {
if let channel = self.getDialog(roomId) {
self.addDialog(channel)
self.joinDialogWithBlock(channel, successBlock: onSuesscs, failBlock: { (_) in
onFaild()
})
return
}
self.chat?.channelsList()?.channel(withSidOrUniqueName: roomId, completion: { (result, channel) in
if result.isSuccessful() && channel != nil{
self.addDialog(channel!)
self.joinDialogWithBlock(channel!, successBlock: onSuesscs, failBlock: { (_) in
onFaild()
})
}else {
DDLogError("getAndJoinDialog error: \(String(describing: result.error))")
onFaild()
}
})
} <- **Crash on this line**
添加对话框功能
func addDialog(_ dialog:TCHChannel)
{
self.dialogs[dialog.sid ?? ""] = dialog
}
我不确定是什么导致了这次崩溃
解决方案
推荐阅读
- android - 联系我们了解 FrameLayout、ScrollView 和 BottomNavigationView 的设计
- reactjs - 取消静音后如何使嵌入的 YouTube 视频重新启动?
- opencv - 在 OpenCV 中使用 Windows 剪贴板图像
- python-3.x - Selenium 循环通过 Mailinator 中的电子邮件
- sparql - Wikidata SPARQL:如果可用,如何按日期过滤?
- reactjs - 如何使用 React 从 Firestore 文档中渲染单个字段
- oop - 如何组合使用对象(现实世界的例子)
- mysql - 如何模拟 DB 进行单元测试
- javascript - 如何使链接的背景跟随光标?
- linux - 如何配置 apache 主 DocumentRoot 正确性?