Understanding an iOS stacktrace - ios

I'm kinda new to debugging iOS exceptions.
On the fabric.io site I can see that a few users has seen this crash.
Can anyone please help me get started?
Crashed: com.apple.main-thread
0 gismoapp 0x114760 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
1 gismoapp 0x1144a0 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
2 gismoapp 0x11102c #objc WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift)
3 UIKit 0x261b4609 -[UIScrollView(UIScrollViewInternal) _scrollViewWillBeginDragging] + 232
4 UIKit 0x261b3a9d -[UIScrollView _updatePanGesture] + 284
5 UIKit 0x265685db _UIGestureRecognizerSendTargetActions + 142
6 UIKit 0x261a08e3 _UIGestureRecognizerSendActions + 170
7 UIKit 0x26030d15 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1004
8 UIKit 0x2656993f ___UIGestureRecognizerUpdate_block_invoke898 + 62
9 UIKit 0x25ff1587 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 298
10 UIKit 0x25fedaf9 _UIGestureRecognizerUpdate + 2920
11 UIKit 0x2602ec01 -[UIWindow _sendGesturesForEvent:] + 904
12 UIKit 0x2602e3b3 -[UIWindow sendEvent:] + 622
13 UIKit 0x25ffec85 -[UIApplication sendEvent:] + 204
14 UIKit 0x25ffd229 _UIApplicationHandleEventQueue + 5016
15 CoreFoundation 0x219efa67 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
16 CoreFoundation 0x219ef657 __CFRunLoopDoSources0 + 454
17 CoreFoundation 0x219ed9bf __CFRunLoopRun + 806
18 CoreFoundation 0x2193c289 CFRunLoopRunSpecific + 516
19 CoreFoundation 0x2193c07d CFRunLoopRunInMode + 108
20 GraphicsServices 0x22f58af9 GSEventRunModal + 160
21 UIKit 0x260672c5 UIApplicationMain + 144
22 gismoapp 0xb7084 main (AppDelegate.swift:14)
23 libdispatch.dylib 0x215e8873 (Missing)
The code in question:
func scrollViewWillBeginDragging(scrollView: UIScrollView){
if let lastSyncDate = Settings.lastSyncedDate {
// This is line 428 in WeekPlanController
self.refreshControl.attributedTitle = NSAttributedString(string: "last synced \(lastSyncDate.relativeTimeToString()) ago")
}
}

Related

specialized UIViewController calling some method crashing iOS Swift

I am unable to replicate this issue, how to replicate the following fabric crash ?
Is there a way to open this crash in xcode (Importing crash into xcode)
Crashed: com.apple.main-thread
0 ABCC 0x10092d0c4 specialized ABCViewController.signInBtnPressed(UIButton) -> ()(ABCViewController.swift:178)
1 ABCC 0x10092a520 #objc ABCViewController.unwind(UIStoryboardSegue) -> () + 3152641510
2 UIKit 0x18aced64c -[UIApplication sendAction:to:from:forEvent:] + 86
3 UIKit 0x18ae0e870 -[UIControl sendAction:to:forEvent:] + 52
4 UIKit 0x18acf3700 -[UIControl _sendActionsForEvents:withEvent:] + 120
5 UIKit 0x18ae291a8 -[UIControl touchesEnded:withEvent:] + 492
6 UIKit 0x18b2ceee8 _UIGestureEnvironmentSortAndSendDelayedTouches + 4340
7 UIKit 0x18b2cbc60 _UIGestureEnvironmentUpdate + 1236
8 UIKit 0x18ad664d8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
9 UIKit 0x18ad66010 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
10 UIKit 0x18ad65874 -[UIWindow sendEvent:] + 3132
11 UIKit 0x18ad641d0 -[UIApplication sendEvent:] + 340
12 UIKit 0x18b545d1c __dispatchPreprocessedEventFromEventQueue + 2340
13 UIKit 0x18b5482c8 __handleEventQueueInternal + 4744
14 CoreFoundation 0x180f27404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
15 CoreFoundation 0x180f26c2c __CFRunLoopDoSources0 + 276
16 CoreFoundation 0x180f2479c __CFRunLoopRun + 1204
17 CoreFoundation 0x180e44da8 CFRunLoopRunSpecific + 552
18 GraphicsServices 0x182e2a020 GSEventRunModal + 100
19 UIKit 0x18ae64758 UIApplicationMain + 236
20 ABCC 0x1007b28c4 main (main.m:20)
21 libdyld.dylib 0x1808d5fc0 start + 4
Here is the code for the action that is crashing.
#IBAction func signInBtnPressed(_ sender: UIButton) {
sender.isUserInteractionEnabled = false
guard let employees = UserService.shared.employees, let name = employees.names?[sender.tag] else {
sender.isUserInteractionEnabled = true // crashing here
return
}
// perform task
sender.isUserInteractionEnabled = true
}

Crashed: com.apple.main-thread log

I'm getting the below error from crashlytics and I'm having a really hard time trying to decipher it. I've tried to look into the connectButtonTapped method but don't see anything wrong at all. Maybe this isn't even where it's happening.. any ideas?
#0. Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x180643014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18070b450 pthread_kill + 112
2 libsystem_c.dylib 0x1805b7400 abort + 140
3 libswiftCore.dylib 0x100af3d1c swift_deletedMethodError (__hidden#19885_:285)
4 libswiftCore.dylib 0x100ad5e04 _hidden#19211_ (__hidden#19255_:184)
5 libswiftCore.dylib 0x100ad5e7c swift_dynamicCastClass (__hidden#19255_:270)
6 libswiftCore.dylib 0x100ad5f0c swift_dynamicCastClassUnconditional (__hidden#19255_:294)
7 TestApp. 0x10010a464 specialized vcMeet.connectButtonTapped(sender : vMeetButtonSection) -> () (vcMeet.swift)
8 TestApp 0x100107524 #objc vcMeet.connectButtonTapped(sender : vMeetButtonSection) -> () (vcMeet.swift)
9 TestApp 0x1001075f4 protocol witness for vMeetButtonSectionResponderDelegate.connectButtonTapped(sender : vMeetButtonSection) -> () in conformance vcMeet (vcMeet.swift)
10 HighThere 0x1001380c0 #objc vMeetButtonSection.connectTapped() -> () (vMeetButtonSection.swift)
11 UIKit 0x18755fd30 -[UIApplication sendAction:to:from:forEvent:] + 96
12 UIKit 0x18755fcb0 -[UIControl sendAction:to:forEvent:] + 80
13 UIKit 0x18754a128 -[UIControl _sendActionsForEvents:withEvent:] + 452
14 UIKit 0x18755f59c -[UIControl touchesEnded:withEvent:] + 584
15 UIKit 0x18755f0c4 -[UIWindow _sendTouchesForEvent:] + 2484
16 UIKit 0x18755a328 -[UIWindow sendEvent:] + 2988
17 UIKit 0x18752ada0 -[UIApplication sendEvent:] + 340
18 UIKit 0x187d1475c __dispatchPreprocessedEventFromEventQueue + 2736
19 UIKit 0x187d0e130 __handleEventQueue + 784
20 CoreFoundation 0x181622b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
21 CoreFoundation 0x1816224a4 __CFRunLoopDoSources0 + 524
22 CoreFoundation 0x1816200a4 __CFRunLoopRun + 804
23 CoreFoundation 0x18154e2b8 CFRunLoopRunSpecific + 444
24 GraphicsServices 0x183002198 GSEventRunModal + 180
25 UIKit 0x1875957fc -[UIApplication _run] + 684
26 UIKit 0x187590534 UIApplicationMain + 208
27 TestApp 0x10005a8b4 main (tbcSettings.swift:17)
28 libdispatch.dylib 0x1805315b8 (Missing)

Click on button in table cell crash at IBAction ios

I am having three buttons in table view cell when click on button it is crashed strangely in line I am attaching code and crash report please suggest a solution.
Code for button click:
#IBAction func ibaReject(sender: UIButton) {
let notification = notifications[sender.tag]
let notificationHandler = NotificationHandlerFactory.getNotificationHandler(notification)
notificationHandler?.handleNegativeAction(notification,viewController: self)
}
Crash report from crashlytics:
Crashed: com.apple.main-thread
0 Quickride 0x1000c589c specialized NotificationViewController.ibaReject(UIButton) -> () (NotificationViewController.swift)
1 Quickride 0x1000c2d28 #objc NotificationViewController.ibaReject(UIButton) -> () (NotificationViewController.swift)
2 UIKit 0x18d31e7b0 -[UIApplication sendAction:to:from:forEvent:] + 96
3 UIKit 0x18d31e730 -[UIControl sendAction:to:forEvent:] + 80
4 UIKit 0x18d308be4 -[UIControl _sendActionsForEvents:withEvent:] + 452
5 UIKit 0x18d31e01c -[UIControl touchesEnded:withEvent:] + 584
6 UIKit 0x18d31db44 -[UIWindow _sendTouchesForEvent:] + 2484
7 UIKit 0x18d318d8c -[UIWindow sendEvent:] + 2988
8 UIKit 0x18d2e9858 -[UIApplication sendEvent:] + 340
9 UIKit 0x18dad6cb8 __dispatchPreprocessedEventFromEventQueue + 2736
10 UIKit 0x18dad0720 __handleEventQueue + 784
11 CoreFoundation 0x18744e278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
12 CoreFoundation 0x18744dbc0 __CFRunLoopDoSources0 + 524
13 CoreFoundation 0x18744b7c0 __CFRunLoopRun + 804
14 CoreFoundation 0x18737a048 CFRunLoopRunSpecific + 444
15 GraphicsServices 0x188dfd198 GSEventRunModal + 180
16 UIKit 0x18d354628 -[UIApplication _run] + 684
17 UIKit 0x18d34f360 UIApplicationMain + 208
18 Quickride 0x1002d4018 main (AppDelegate.swift:23)
19 libdispatch.dylib 0x18635c5b8 (Missing)

Understanding Swift stacktrace in Crashlytics

So, as a novice IOS developer I find it hard to determine what cases this exception.
Case: the IOS app has a UIScrollView that allows the user to drag down to sync with a web service - just like the build in mail app.
Once in a while a user in the wild will encounter an app crash. In crashlytics i see:
Crashed: com.apple.main-thread: EXC_BREAKPOINT 0x00000000e7ffdefe
0 myApp 0xba760 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
1 myApp 0xba4a0 specialized WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift:428)
2 myApp 0xb702c #objc WeekPlanController.scrollViewWillBeginDragging(UIScrollView) -> () (WeekPlanController.swift)
3 UIKit 0x2cee4ad3 -[UIScrollView _updatePanGesture] + 282
4 UIKit 0x2ced206b _UIGestureRecognizerSendActions + 294
5 UIKit 0x2cd810f9 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 668
6 UIKit 0x2d19af9b ___UIGestureRecognizerUpdate_block_invoke661 + 46
7 UIKit 0x2cd4a181 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 216
8 UIKit 0x2cd4805f _UIGestureRecognizerUpdate + 2926
9 UIKit 0x2cd7f4d9 -[UIWindow _sendGesturesForEvent:] + 784
10 UIKit 0x2cd7eddd -[UIWindow sendEvent:] + 524
11 UIKit 0x2cd54fe5 -[UIApplication sendEvent:] + 196
12 UIKit 0x2cfcb8fb _UIApplicationHandleEventFromQueueEvent + 14414
13 UIKit 0x2cd539f9 _UIApplicationHandleEventQueue + 1352
14 CoreFoundation 0x296c5faf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
15 CoreFoundation 0x296c53bf __CFRunLoopDoSources0 + 218
16 CoreFoundation 0x296c3a25 __CFRunLoopRun + 772
17 CoreFoundation 0x29610201 CFRunLoopRunSpecific + 476
18 CoreFoundation 0x29610013 CFRunLoopRunInMode + 106
19 GraphicsServices 0x30eef201 GSEventRunModal + 136
20 UIKit 0x2cdb4a59 UIApplicationMain + 1440
21 myApp 0x5d084 main (AppDelegate.swift:14)
22 libdyld.dylib 0x37f3daaf start + 2
This is the code from the controller:
func scrollViewWillBeginDragging(scrollView: UIScrollView){
if Settings.isSyncActive {
if let lastSyncDate = Settings.lastSyncedDate { // ln 427
self.refreshControl.attributedTitle = NSAttributedString(string: "Last sync \(lastSyncDate.relativeTimeToString()) ago") // ln 428
} // ln 429
else{
self.refreshControl.attributedTitle = NSAttributedString(string: "")
}
}
}
Any hint or tips are appreciated

How to detect crash from the following code?

Im trying to find crash from following code / snippet.
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 6771342288 objc_msgSend + 16
1 Foundation 6488040888 vars_index_with_insert + 396
2 Foundation 6488046624 -[NSISLinearExpression setCoefficient:forVariable:] + 372
3 Foundation 6488038164 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 432
4 Foundation 6488033112 -[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 136
5 Foundation 6488032176 -[NSLayoutConstraint _setSymbolicConstant:constant:] + 420
6 UIKit 6558145124 -[UIWindow(AdditionalLayoutSupport) _windowInternalConstraints_sizeDidChange] + 220
7 UIKit 6553937808 -[UIWindow _setFrame:sendTraitNotifications:] + 436
8 UIKit 6553925712 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1072 + 264
9 UIKit 6556461676 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 56
10 UIKit 6551262980 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 508
11 UIKit 6551360196 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 68
12 UIKit 6556461540 -[_UIWindowRotationAnimationController animateTransition:] + 388
13 UIKit 6553920912 -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 800
14 UIKit 6553924620 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1260
15 UIKit 6553926412 -[UIWindow _setRotatableClient:toOrientation:applyTransformToWindow:updateStatusBar:duration:force:isRotating:] + 360
16 UIKit 6551563312 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 144
17 UIKit 6551529112 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 128
18 UIKit 6551053184 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
19 UIKit 6551051872 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 332
20 CoreFoundation 6472590020 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
21 CoreFoundation 6471791696 _CFXNotificationPost + 2060
22 Foundation 6487714432 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
23 UIKit 6551051060 -[UIDevice setOrientation:animated:] + 360
24 UIKit 6551050224 -[UIApplication handleEvent:withNewEvent:] + 1632
25 UIKit 6551048320 -[UIApplication sendEvent:] + 104
26 UIKit 6551491268 _UIApplicationHandleEvent + 700
27 GraphicsServices 6633656724 _PurpleEventCallback + 712
28 GraphicsServices 6633655428 PurpleEventCallback + 44
29 CoreFoundation 6472661588 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
30 CoreFoundation 6472661428 __CFRunLoopDoSource1 + 436
31 CoreFoundation 6472653108 __CFRunLoopRun + 1640
32 CoreFoundation 6471783124 CFRunLoopRunSpecific + 396
33 GraphicsServices 6633649916 GSEventRunModal + 168
34 UIKit 6551465792 UIApplicationMain + 1488
35 project_name 4298267384 main + 108 (main.m:18)
36 libdyld.dylib 6778251784 start + 4
go to "Breakpoint navigator" and click on "+" button on bottom-left and select "Add Exception Breakpoint...".
This kind of breakpoint capture all exception, so you can navigate on stack error on left side and figure out what happened.

Resources