0

The error message is as follows

 libswiftCore.dylib _T0s18_fatalErrorMessages5NeverOs12StaticStringV_A2E4fileSu4lines6UInt32V5flagstFTfq4nnddn_n + 120
    1 libswiftCore.dylib    _T0s18_fatalErrorMessages5NeverOs12StaticStringV_A2E4fileSu4lines6UInt32V5flagstFTfq4nnddn_n + 120
    2 libswiftCore.dylib    _T0SS13CharacterViewVs14_IndexableBasessACP9formIndexy0F0Qzz5after_tFTW + 1264
    3 libswiftCore.dylib    _T0s23_BidirectionalIndexablePsE5index5IndexQzAE_0D8DistanceQz8offsetBytF + 5540
    4 CoreKit   globalinit_33_58A9E157F2B934163FC3AB30F93D5434_func0 + 8324
    5 Union viewDidLoad (MineViewController.swift:0)
    6 Union viewDidLoad (MineViewController.swift:0)
    7 UIKit -[UIViewController loadViewIfRequired] + 1020
    8 UIKit -[UIViewController view] + 28
    9 UIKit -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 736
    10 UIKit    -[UITabBarController transitionFromViewController:toViewController:] + 68
    11 UIKit    -[UITabBarController _setSelectedViewController:] + 400
    12 UIKit    -[UITabBarController setSelectedViewController:] + 112
    13 UIKit    -[UITabBarController _tabBarItemClicked:] + 612
    14 UIKit    -[UIApplication sendAction:to:from:forEvent:] + 96
    15 UIKit    -[UITabBar _sendAction:withEvent:] + 528
    16 UIKit    -[UIApplication sendAction:to:from:forEvent:] + 96
    17 UIKit    -[UIControl sendAction:to:forEvent:] + 80
    18 UIKit    -[UIControl _sendActionsForEvents:withEvent:] + 440
    19 UIKit    -[UITabBar _buttonUp:] + 120
    20 UIKit    -[UIApplication sendAction:to:from:forEvent:] + 96
    21 UIKit    -[UIControl sendAction:to:forEvent:] + 80
    22 UIKit    -[UIControl _sendActionsForEvents:withEvent:] + 440
    23 UIKit    -[UIControl touchesEnded:withEvent:] + 572
    24 UIKit    __UIGestureEnvironmentSortAndSendDelayedTouches + 4340
    25 UIKit    __UIGestureEnvironmentUpdate + 1236
    26 CoreFoundation   ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    27 CoreFoundation   ___CFRunLoopDoObservers + 412
    28 CoreFoundation   ___CFRunLoopRun + 1436
    29 CoreFoundation   CFRunLoopRunSpecific + 552
    30 GraphicsServices GSEventRunModal + 100
    31 UIKit    UIApplicationMain + 236
    32 Union    main (AppDelegate.swift:16)
    33 libdyld.dylib    _start + 4

MineViewController code is as follows

override func viewDidLoad() {
    navigationBarStyle = .none
    super.viewDidLoad()
    menuCollectionView.delegate = self
    menuCollectionView.dataSource = self
    dataArray = []
    dataArray = [
        [Key.Menu.menuIconUri:"exam_results_search",Key.Menu.menuName:"日常考核",Key.Menu.menuUri:"DailyAssessmentController"],
        [Key.Menu.menuIconUri:"workload_report",Key.Menu.menuName:"装维人员工作量统计报表",Key.Menu.menuUri:"FittedPersonReportController"],
        [Key.Menu.menuIconUri:"repair_rate_report",Key.Menu.menuName:"修障及时率统计报表",Key.Menu.menuUri:"RepairedTimelyRateController"],
        [Key.Menu.menuIconUri:"performance_rate_report",Key.Menu.menuName:"装机履约率统计报表",Key.Menu.menuUri:"InstalledComplianceRateController"],
        [Key.Menu.menuIconUri:"performance_rate_report",Key.Menu.menuName:"装维代理",Key.Menu.menuUri:"InstallSafeguardDelegateVC"],//装维代理控制器 2018-3-12
        [Key.Menu.menuIconUri:"performance_rate_report",Key.Menu.menuName:"出勤安排",Key.Menu.menuUri:"AttendanceArrangementController"]
       ]
    positionLabel.text = AppDomain.defaultJob[Key.Job.jobName].stringValue
    let mobileStr = AppDomain.mobile
    let securitStr = mobileStr?.subStr(start: 3, length: 4)
    let showMobile = mobileStr?.replacingOccurrences(of: securitStr!, with: "****")
    phoneLabel.text = showMobile
    // Do any additional setup after loading the view.
}

I typically wouldn't want to ask SO for help understanding my crash report, but (a) I can learn a lot about reading crash reports from the experts here, and (b), I realize that I don't understand as much about navigation flow as I hoped (this part is specific to the crash report below I think).

So I'm hoping that someone has come across the same issue and can help me understand why my app is crashing.

It only crashes sometimes, which is beyond me as to why it is intermittent. However, when it does crash, it crashes at the same place, with the same stack trace (shown below).

From reading the crash report below, does anyone have any advice as to why my app is crashing??? And why it might be inconsistent?

Thank you all, below is my other sub-thread error message

#1 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cf144 _pthread_wqthread
#2 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cf144 _pthread_wqthread
#3 Thread
0 libsystem_kernel.dylib    0x00000001858bd150 __psynch_cvwait
1 libsystem_pthread.dylib   0x00000001859d6fd0 __pthread_cond_wait$VARIANT$armv81
2 Union 0x00000001031a2508 CNEvent::Wait(int)
3 Union 0x0000000103109f18 CNELogRecordThread::Run(void*)
4 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
5 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#4 com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib    0x000000018589cbc4 mach_msg_trap
1 libsystem_kernel.dylib    0x000000018589ca3c mach_msg
2 CoreFoundation    0x0000000185d4bce4 ___CFRunLoopServiceMachPort
3 CoreFoundation    0x0000000185d498b0 ___CFRunLoopRun
4 CoreFoundation    0x0000000185c6a2d8 CFRunLoopRunSpecific
5 Foundation    0x00000001866926e4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation    0x00000001866b1afc -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKit 0x000000018fd6202c -[UIEventFetcher threadMain]
8 Foundation    0x0000000186793860 ___NSThread__start__
9 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
10 libsystem_pthread.dylib  0x00000001859d01f8 __pthread_body
#5 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cefb0 _pthread_wqthread
#6 com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib    0x000000018589cbc4 mach_msg_trap
1 libsystem_kernel.dylib    0x000000018589ca3c mach_msg
2 CoreFoundation    0x0000000185d4bce4 ___CFRunLoopServiceMachPort
3 CoreFoundation    0x0000000185d498b0 ___CFRunLoopRun
4 CoreFoundation    0x0000000185c6a2d8 CFRunLoopRunSpecific
5 CFNetwork 0x00000001863d3b40 +[NSURLConnection(Loader) _resourceLoadLoop:]
6 Foundation    0x0000000186793860 ___NSThread__start__
7 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
8 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#7 com.apple.CoreMotion.MotionThread
0 libsystem_kernel.dylib    0x000000018589cbc4 mach_msg_trap
1 libsystem_kernel.dylib    0x000000018589ca3c mach_msg
2 CoreFoundation    0x0000000185d4bce4 ___CFRunLoopServiceMachPort
3 CoreFoundation    0x0000000185d498b0 ___CFRunLoopRun
4 CoreFoundation    0x0000000185c6a2d8 CFRunLoopRunSpecific
5 CoreFoundation    0x0000000185cb912c CFRunLoopRun
6 CoreMotion    0x000000018b04e088 CLStartStopAdvertisingBeacon
7 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
8 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#8 Thread
0 libsystem_kernel.dylib    0x00000001858bd150 __psynch_cvwait
1 libsystem_pthread.dylib   0x00000001859d6fd0 __pthread_cond_wait$VARIANT$armv81
2 Union 0x0000000102a67884 _baidu_vi::CVEvent::Wait(unsigned int)
3 Union 0x0000000102a67d8c _baidu_vi::CVThreadEvent::Wait()
4 Union 0x0000000102a66724 _baidu_vi::CVSocketMan::SocketThreadProc(void*)
5 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
6 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#9 AFNetworking
0 libsystem_kernel.dylib    0x000000018589cbc4 mach_msg_trap
1 libsystem_kernel.dylib    0x000000018589ca3c mach_msg
2 CoreFoundation    0x0000000185d4bce4 ___CFRunLoopServiceMachPort
3 CoreFoundation    0x0000000185d498b0 ___CFRunLoopRun
4 CoreFoundation    0x0000000185c6a2d8 CFRunLoopRunSpecific
5 Foundation    0x00000001866926e4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation    0x00000001866e462c -[NSRunLoop(NSRunLoop) run]
7 Union 0x00000001037fe074 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:164)
8 Foundation    0x0000000186793860 ___NSThread__start__
9 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
10 libsystem_pthread.dylib  0x00000001859d01f8 __pthread_body
#10 Thread
0 libsystem_kernel.dylib    0x000000018589cbc4 mach_msg_trap
1 libsystem_kernel.dylib    0x000000018589ca3c mach_msg
2 CoreFoundation    0x0000000185d4bce4 ___CFRunLoopServiceMachPort
3 CoreFoundation    0x0000000185d498b0 ___CFRunLoopRun
4 CoreFoundation    0x0000000185c6a2d8 CFRunLoopRunSpecific
5 Union 0x00000001022b84a0 +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4800)
6 Foundation    0x0000000186793860 ___NSThread__start__
7 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
8 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#11 com.apple.CFSocket.private
0 libsystem_kernel.dylib    0x00000001858bd570 __select
1 CoreFoundation    0x0000000185d5421c ___CFSocketManager
2 libsystem_pthread.dylib   0x00000001859d032c __pthread_body
3 libsystem_pthread.dylib   0x00000001859d01f8 __pthread_body
#12 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cf144 _pthread_wqthread
#13 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cf144 _pthread_wqthread
#14 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cefb0 _pthread_wqthread
#15 Thread
0 libsystem_kernel.dylib    0x00000001858bddbc __workq_kernreturn
1 libsystem_pthread.dylib   0x00000001859cf144 _pthread_wqthread
cool
  • 1
  • 1
  • can you add exception breakpoint and find the exact place causing the crash ? – Vinodh Jun 28 '18 at 13:12
  • there might be line starting with "terminating app due to uncaught exception" can you post that too – ketaki Damale Jun 28 '18 at 13:26
  • What is the `subStr(start:, length:)` method over `mobileStr`? – Alejandro Iván Jun 28 '18 at 16:01
  • What the line `5 Union viewDidLoad (MineViewController.swift:0)` is telling you is that this method is loaded when the thread crashes, but it's not crashing because of anything inside the method (otherwise you'd have a line number inside of viewDidLoad). My two guesses are that either MineViewController is being set to nil during one of your transitions, or the crash is actually coming from a different thread (possibly a memory management problem in a closure). We'd need the full crash report to diagnose further. @Vinodh advice is also good here. – Nima Yousefi Jun 28 '18 at 17:44
  • @NimaYousefi Thank you, I posted all the child thread information, can you help me to see what the problem is? – cool Jun 29 '18 at 02:05
  • @Vinodh I posted all the child thread information, can you help me find out what the problem is? Thanks – cool Jun 29 '18 at 02:06
  • please try this post to enable exception break point https://stackoverflow.com/questions/17802662/exception-breakpoint-in-xcode. – Vinodh Jun 29 '18 at 05:15

0 Answers0