Сбой - EXC_BAD_ACCESS KERN_INVALID_ADDRESS специализированный _VariantDictionaryBuffer.nativeUpdateValue (_: forKey :) - PullRequest
0 голосов
/ 13 мая 2018

У меня сбой, но я не уверен, что его вызвало.

Я использую Twilio Framework, и все работает нормально, но получаю странный сбой Я похож на словарь, связанный с этим вопрос:

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

Функция TicketManager:

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

func addDialog(_ dialog:TCHChannel)
{
    self.dialogs[dialog.sid ?? ""] = dialog
}

Я не уверен, что случилось, что может быть причиной этого сбоя

...