快速崩溃日志

时间:2018-06-05 07:04:15

标签: swift logging crash

我使用Fabric监控我的应用程序中的崩溃,但在打印日志中找到我的方法后,我没有发现测试有问题。请帮我看看是什么原因?谢谢~~~ 记录如下:

# 0. Crashed: com.apple.main-thread
0  EFB                            0x1041e2018 specialized FightPlanViewController.dispatchClick(\_:) (FightPlanViewController.swift:346)
1  EFB                            0x1041db4d8 @objc FightPlanViewController.dispatchClick(\_:) + 4371969240
2  UIKit                          0x18b5c26c8 -\[UIApplication sendAction:to:from:forEvent:] + 96
3  UIKit                          0x18b6e38a4 -\[UIControl sendAction:to:forEvent:] + 80
4  UIKit                          0x18b5c877c -\[UIControl \_sendActionsForEvents:withEvent:] + 440
5  UIKit                          0x18b6fe1dc -\[UIControl touchesEnded:withEvent:] + 572
6  UIKit                          0x18bba3dd8 \_UIGestureEnvironmentSortAndSendDelayedTouches + 4340
7  UIKit                          0x18bba0b50 \_UIGestureEnvironmentUpdate + 1236
8  UIKit                          0x18b63b540 -\[UIGestureEnvironment \_deliverEvent:toGestureRecognizers:usingBlock:] + 404
9  UIKit                          0x18b63b078 -\[UIGestureEnvironment \_updateGesturesForEvent:window:] + 276
10 UIKit                          0x18b63a8dc -\[UIWindow sendEvent:] + 3132
11 UIKit                          0x18b639238 -\[UIApplication sendEvent:] + 340
12 UIKit                          0x18be1ac0c \_\_dispatchPreprocessedEventFromEventQueue + 2340
13 UIKit                          0x18be1d1b8 \_\_handleEventQueueInternal + 4744
14 UIKit                          0x18be16258 \_\_handleHIDEventFetcherDrain + 152
15 CoreFoundation                 0x18183b404 __CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_A\_SOURCE0\_PERFORM\_FUNCTION__ + 24
16 CoreFoundation                 0x18183ac2c \_\_CFRunLoopDoSources0 + 276
17 CoreFoundation                 0x18183879c \_\_CFRunLoopRun + 1204
18 CoreFoundation                 0x181758da8 CFRunLoopRunSpecific + 552
19 GraphicsServices               0x18373b020 GSEventRunModal + 100
20 UIKit                          0x18b73978c UIApplicationMain + 236
21 EFB                            0x1041470c8 main (AppDelegate.swift:18)
22 libdyld.dylib                  0x1811e9fc0 start + 4

--

            0x1811e9fc0 start + 4

# 1. Thread
0  libsystem\_kernel.dylib         0x181319d84 \_\_workq\_kernreturn + 8
1  libsystem\_pthread.dylib        0x1814b7eb4 \_pthread\_wqthread + 928
2  libsystem\_pthread.dylib        0x1814b7b08 start\_wqthread + 4

# 2. Thread
0  libsystem\_kernel.dylib         0x1813190f4 \_\_psynch\_cvwait + 8
1  libsystem\_pthread.dylib        0x1814bbc90 \_pthread\_cond\_wait$VARIANT$mp + 644
2  PSPDFKit                       0x104cd30b8 PSPDFBundleImage + 208312
3  PSPDFKit                       0x104cd151c PSPDFBundleImage + 201244
4  PSPDFKit                       0x104f13328 boost::thread::start\_thread\_noexcept() + 392
5  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
6  libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
7  libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 3. com.apple.uikit.eventfetch-thread
0  libsystem\_kernel.dylib         0x1812f7e08 mach\_msg\_trap + 8
1  libsystem\_kernel.dylib         0x1812f7c80 mach\_msg + 72
2  CoreFoundation                 0x18183ae40 \_\_CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x181838908 \_\_CFRunLoopRun + 1568
4  CoreFoundation                 0x181758da8 CFRunLoopRunSpecific + 552
5  Foundation                     0x1821cd674 -\[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6  Foundation                     0x1821cd51c -\[NSRunLoop(NSRunLoop) runUntilDate:] + 148
7  UIKit                          0x18b41e7e4 -\[UIEventFetcher threadMain] + 136
8  Foundation                     0x1822ddefc __NSThread\_\_start__ + 1040
9  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
10 libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
11 libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 4. com.twitter.crashlytics.ios.MachExceptionServer
0  EFB                            0x1042b861c CLSProcessRecordAllThreads + 4372874780
1  EFB                            0x1042b861c CLSProcessRecordAllThreads + 4372874780
2  EFB                            0x1042b84d8 CLSProcessRecordAllThreads + 4372874456
3  EFB                            0x1042a79b8 CLSHandler + 4372806072
4  EFB                            0x1042a29cc CLSMachExceptionServer + 4372785612
5  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
6  libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
7  libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 5. CCP Socket Thead
0  libsystem\_kernel.dylib         0x1812f7e08 mach\_msg\_trap + 8
1  libsystem\_kernel.dylib         0x1812f7c80 mach\_msg + 72
2  CoreFoundation                 0x18183ae40 \_\_CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x181838908 \_\_CFRunLoopRun + 1568
4  CoreFoundation                 0x181758da8 CFRunLoopRunSpecific + 552
5  Foundation                     0x1821cd674 -\[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6  Foundation                     0x1822421a8 -\[NSRunLoop(NSRunLoop) run] + 88
7  EFB                            0x1042f0028 -\[MPASConnectTask networkRequestThreadEntryPoint:] (MPASConnectTask.m:173)
8  Foundation                     0x1822ddefc __NSThread\_\_start__ + 1040
9  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
10 libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
11 libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 6. com.apple.NSURLConnectionLoader
0  libsystem\_kernel.dylib         0x1812f7e08 mach\_msg\_trap + 8
1  libsystem\_kernel.dylib         0x1812f7c80 mach\_msg + 72
2  CoreFoundation                 0x18183ae40 \_\_CFRunLoopServiceMachPort + 196
3  CoreFoundation                 0x181838908 \_\_CFRunLoopRun + 1568
4  CoreFoundation                 0x181758da8 CFRunLoopRunSpecific + 552
5  CFNetwork                      0x1820664b0 -\[\_\_CoreSchedulingSetRunnable runForever] + 220
6  Foundation                     0x1822ddefc __NSThread\_\_start__ + 1040
7  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
8  libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
9  libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 7. com.apple.CFSocket.private
0  libsystem\_kernel.dylib         0x181319538 \_\_select + 8
1  CoreFoundation                 0x181843378 \_\_CFSocketManager + 644
2  libsystem\_pthread.dylib        0x1814b9220 \_pthread\_body + 272
3  libsystem\_pthread.dylib        0x1814b9110 \_pthread\_body + 290
4  libsystem\_pthread.dylib        0x1814b7b10 thread\_start + 4

# 8. com.apple.root.default-qos
0  libsystem\_kernel.dylib         0x1813190f4 \_\_psynch\_cvwait + 8
1  libsystem\_pthread.dylib        0x1814bbc90 \_pthread\_cond\_wait$VARIANT$mp + 644
2  EFB                            0x1042f1690 -\[MPASConnectTask onCall] (MPASConnectTask.m:455)
3  EFB                            0x1042f2480 -\[MPRequestRetrier doTaskRun] (MPRequestRetrier.m:86)
4  libdispatch.dylib              0x181184b24 \_dispatch\_call\_block\_and\_release + 24
5  libdispatch.dylib              0x181184ae4 \_dispatch\_client\_callout + 16
6  libdispatch.dylib              0x18118bc08 \_dispatch\_queue\_override\_invoke$VARIANT$mp + 716
7  libdispatch.dylib              0x181191d30 \_dispatch\_root\_queue\_drain + 588
8  libdispatch.dylib              0x181191a80 \_dispatch\_worker\_thread3 + 120
9  libsystem\_pthread.dylib        0x1814b7fac \_pthread\_wqthread + 1176
10 libsystem\_pthread.dylib        0x1814b7b08 start\_wqthread + 4

# 9. Thread
0  libsystem\_kernel.dylib         0x181319d84 \_\_workq\_kernreturn + 8
1  libsystem\_pthread.dylib        0x1814b7eb4 \_pthread\_wqthread + 928
2  libsystem\_pthread.dylib        0x1814b7b08 start\_wqthread + 4

# 10. Thread
0  libsystem\_kernel.dylib         0x181319d84 \_\_workq\_kernreturn + 8
1  libsystem\_pthread.dylib        0x1814b80a0 \_pthread\_wqthread + 1420
2  libsystem\_pthread.dylib        0x1814b7b08 start\_wqthread + 4


@objc func dispatchClick(_ sender:UIButton){
    let tag = sender.tag-100
    sender.isEnabled = false
    let flightId:String = FightModelManger.defaultManger.selectAll()[tag].flightId
    if sender.titleLabel?.text == "下载"||sender.titleLabel?.text == "DOWNLOAD"||sender.titleLabel?.text == "未生成"||sender.titleLabel?.text == "UNREALEASED"{
        self.checkDispatchUpdate(flightId: flightId, tag, true)
    }else{ 
        self.checkDispatchUpdate(flightId: flightId,tag, false)
    }
}



func checkDispatchUpdate(flightId:String,_ index:Int,_ isFirst:Bool){
    let button = self.view.viewWithTag(100+index) as! UIButton    
    let model = DispatchInfoModelManger.defaultManger.selectflightId(flightId: flightId)
    var  para = ["flightId":"","lastUpdateTime":""]
    if model.count == 0{
        para["flightId"] = flightId
        para["lastUpdateTime"] = "1900-01-01 00:00:00"
    }else{
        if let time = model.first?.dispatchTime{
            para["flightId"] = flightId
            para["lastUpdateTime"] = time
        }
    }
    let manger = Alamofire.SessionManager.default  //  网络超时
    manger.session.configuration.timeoutIntervalForRequest = 10
    if NetWorkState.isReachable(){
        manger.request(ReleaseInfoCheckURL, method: .get, parameters: para, encoding: URLEncoding.default, headers: nil).responseJSON(completionHandler: { (response) in
            switch response.result{
            case .success:
                if let dic = response.result.value {
                    let status = (dic as! NSDictionary)["status"]as! String
                    if status == "0"{  // 表示放行资料可以下载
                        self.downloadDispatchInfo(flightId: flightId, index)
                        DispatchQueue.main.async {
                             if self.aUser.nation == "CN"{
                                SVProgressHUD.show(withStatus: "正在下载放行资料,请稍候")
                                button.isEnabled = true
                            }else if self.aUser.nation == "EN"{
                                SVProgressHUD.show(withStatus: "Downloading the Release Data, please Wait a Minute")
                                button.isEnabled = true
                            }
                            SVProgressHUD.setBackgroundColor(kRGBColorFromHex(rgbValue:0x66CDAA))
                            SVProgressHUD.setForegroundColor(UIColor.black)
                            Mainwindow?.addSubview(self.maskView)
                        }
                    }else {
                        if model.count == 0{ 
                            if self.aUser.nation == "CN"{
                                self.alter(title: "抱歉", "放行资料未生成")
                                button.isEnabled = true
                            }else if self.aUser.nation == "EN"{
                                self.alter(title: "SORRY", "Release Data Not Generated")
                                button.isEnabled = true
                            }
                        }else{ 
                            let release = ReleaseViewController()
                            release.flightId = flightId
                            self.navigationController?.pushViewController(release, animated: true)
                            button.isEnabled = true
                        }
                    }
                }
            case .failure(let error):
                if (error._code == -1005)||(error._code == -1009){
                    SVProgressHUD.dismiss()
                    self.maskView.removeFromSuperview()
                    if self.aUser.nation == "CN"{
                        SVProgressHUD.showError(withStatus: "网络超时或链接错误")
                        button.isEnabled = true
                    }else if self.aUser.nation == "EN"{
                        SVProgressHUD.showError(withStatus: "Network Timeout or Link Error")
                        button.isEnabled = true
                    }
                    SVProgressHUD.dismiss(withDelay: 2)
                    return
                }
            }
        })
    }else{ 
        if model.count == 0{ 
            if self.aUser.nation == "CN"{
                 self.alter(title: "无网络", "抱歉无法检测")
                button.isEnabled = true
            }else if self.aUser.nation == "EN"{
                 self.alter(title: "No Network", "Sorry! Unable to Check")
                button.isEnabled = true
            }
        }else{
            let release = ReleaseViewController()
            release.flightId = flightId
            self.navigationController?.pushViewController(release, animated: true)
            button.isEnabled = true
        }
    }
}

在这个日志中我找到了FightPlanViewController.dispatchClick(_ :),我猜它可能会在此崩溃,但我用ipad来测试它,但我找不到原因。你能帮我吗 ?非常感谢

1 个答案:

答案 0 :(得分:-1)

在Fabric页面的顶部,它将显示文件和应用程序崩溃的行。 见例:

enter image description here