How can I debug this crash log - ios

I get this crash log from my device log after that my app is crashed. Before crash I clicked on cancel button from search bar inside UITableView.
How can I understand what and where is the problem ?
how can I debug this kind of log from production device?
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3b74b1fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x3b7b2a4e pthread_kill + 54
2 libsystem_c.dylib 0x3b6fc028 abort + 72
3 libc++abi.dylib 0x3ab4a98a abort_message + 70
4 libc++abi.dylib 0x3ab636e2 default_terminate_handler() + 250
5 libobjc.A.dylib 0x3b19b936 _objc_terminate() + 190
6 libc++abi.dylib 0x3ab611b0 std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x3ab60d12 __cxa_rethrow + 98
8 libobjc.A.dylib 0x3b19b80a objc_exception_rethrow + 38
9 CoreFoundation 0x30d724e2 CFRunLoopRunSpecific + 638
10 CoreFoundation 0x30d7224e CFRunLoopRunInMode + 102
11 GraphicsServices 0x35aac2e6 GSEventRunModal + 134
12 UIKit 0x33627840 UIApplicationMain + 1132
13 MYAPPNAME 0x000ffc44 0xfa000 + 23620
14 libdyld.dylib 0x3b694ab4 start + 0
------- EDITED ------
i get Last Exception Backtrace:
0 CoreFoundation 0x30e3ee7e __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3b19b6c2 objc_exception_throw + 34
2 CoreFoundation 0x30e3ed50 +[NSException raise:format:arguments:] + 100
3 Foundation 0x317e70aa -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 86
4 UIKit 0x33796348 -[UITableView _endCellAnimationsWithContext:] + 7940
5 MYAPPNAME 0x00233972 0xfa000 + 1284466
6 MYAPPNAME 0x00232e3c 0xfa000 + 1281596
7 MYAPPNAME 0x00232fd8 0xfa000 + 1282008
8 MYAPPNAME 0x002319d4 0xfa000 + 1276372
9 Foundation 0x3181933a __NSFireDelayedPerform + 410
10 CoreFoundation 0x30e09e7a
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 10
11 CoreFoundation 0x30e09a96 __CFRunLoopDoTimer + 790
12 CoreFoundation 0x30e07e1e __CFRunLoopRun + 1214
13 CoreFoundation 0x30d7246c CFRunLoopRunSpecific + 520
14 CoreFoundation 0x30d7224e CFRunLoopRunInMode + 102
15 GraphicsServices 0x35aac2e6 GSEventRunModal + 134
16 UIKit 0x33627840 UIApplicationMain + 1132
17 MYAPPNAME 0x000ffc44 0xfa000 + 23620
18 libdyld.dylib 0x3b694ab2 tlv_initializer + 2

The crash happened because of an unhandled exception.
While symbolicating the crash report with the Xcode organizer usually helps, it doesn't help in this case, since stack frame 13 will only show something like main (main.m:14).
If the crash report doesn't contain an Last Exception Backtrace section, the report is basically meaningless.
Try to reproduce the crash while running the app with the debugger or integrate a 3rd party crash report solution that is able to provide the Last Exception Backtrace and also the Application Information section which gives you the detailed exception error.
There are many 3rd party solutions out there, I won't recommend any, since I would be biased :)
Update: As you now provided the Last Exception Backtrace it shows that there is an Assertion triggered when a tableview animation is ending. Once you symbolicates the crash report you'll see which lines of code in your app are causing this.

Related

Abnormal main.m crash

In my iOS app, I keep getting crash reports like this one.
0 libsystem_kernel.dylib 0x000000018d805014 __pthread_kill + 4
1 libsystem_c.dylib 0x000000018d7799c4 abort + 136
2 libc++abi.dylib 0x000000018d2451b0 abort_message + 128
3 libc++abi.dylib 0x000000018d25ec04 default_terminate_handler() + 300
4 libobjc.A.dylib 0x000000018d26c820 objc_terminate() + 120
5 libc++abi.dylib 0x000000018d25b5d4 std::__terminate() + 12
6 libc++abi.dylib 0x000000018d25b640 std::terminate() + 56
7 libdispatch.dylib 0x000000018d6c29b4 _dispatch_client_callout + 32
8 libdispatch.dylib 0x000000018d6c75e8 _dispatch_main_queue_callback_4CF + 992
9 CoreFoundation 0x000000018e7b90c0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x000000018e7b6cdc __CFRunLoopRun + 1568
11 CoreFoundation 0x000000018e6e6d94 CFRunLoopRunSpecific + 420
12 GraphicsServices 0x0000000190150074 GSEventRunModal + 96
13 UIKit 0x000000019499f44c UIApplicationMain + 204
! 14 MyAppNameHere 0x000000010007b090 main (main.m:33)
15 libdyld.dylib 0x000000018d6f559c start + 0
The strange thing is that none of this exists within my code except for the main.m. All other threads in my application don't have anything related to either. This crash appears to only happen for a fraction of a percent of my users, so I am not sure where to even start looking.
The question as it is formulated right now is not answerable, because it is missing necessary information. See e.g. this tutorial for an explanation of how to obtain a real backtrace and how to obtain a "crash reason". Without following the recommended steps for debugging crashes every crash of an iOS-app looks exactly the same as the crash you just provided.
In order to get a real/useful backtrace, you need to set an exception breakpoint in Xcode.

How to debug a main.m iOS app crash

I have integrated Crashlytics in my iOS app which is currently live on the App Store. In my latest update, I am seeing a lot of crashes with the stack trace as below.
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x30f6ef46 objc_msgSend + 5
1 UIKit 0x26665f07 -[UINavigationController viewWillAppear:] + 406
2 UIKit 0x265d5b1f -[UIViewController _setViewAppearState:isAnimating:] + 438
3 CoreFoundation 0x22fcf46d __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 48
4 CoreFoundation 0x22fc84c3 -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 234
5 UIKit 0x265d5c9b -[UIViewController _setViewAppearState:isAnimating:] + 818
6 UIKit 0x2688c799 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 584
7 UIKit 0x26639bd9 _applyBlockToCFArrayCopiedToStack + 308
8 UIKit 0x265b5dd7 _afterCACommitHandler + 458
9 CoreFoundation 0x23069ffd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
10 CoreFoundation 0x230676bb __CFRunLoopDoObservers + 278
11 CoreFoundation 0x23067ac3 __CFRunLoopRun + 914
12 CoreFoundation 0x22fb53b1 CFRunLoopRunSpecific + 476
13 CoreFoundation 0x22fb51c3 CFRunLoopRunInMode + 106
14 GraphicsServices 0x2a5a2201 GSEventRunModal + 136
15 UIKit 0x2661f43d UIApplicationMain + 1440
16 MyApp 0x00123553 main (main.m:16)
I recently added interstitial ads in my app and I believe the crash is related to that. But how can I get more information from this stack trace or from crashlytics to understand what is really going wrong?
Have you tried enabling Exception Breakpoints?
1) Inside Xcode, switch to the Breakpoints Navigator (left menu, seventh icon from left to right, it looks just like a breakpoint)
2) Click the + symbol in the lower left corner and choose "Add Exception Breakpoint"
3) Run and crash.
You should now be able to see what really caused the crash.

ios 8 + LiveSDK authentication crashes my app

I have an app in the store that use LiveSDK API to log the user into OneDrive. The last release was pushed before iOS8 came out, but it works without problem with iOS8
Now I want to push an update (unrelated to OneDrive features) and I am using xcode 6.1.1 but testing the app I noticed that every time the user is authenticated into OneDrive the app will crash as soon as return from a segue or flipside view to the Main View.
I was able to isolate the issue to this line added in viewDidLoad:
self.liveClient = [[LiveConnectClient alloc] initWithClientId:APP_CLIENT_ID
delegate:self
userState:#"initialize"];
and I really followed the basic instructions on how to login that can be found here:
http://msdn.microsoft.com/en-us/library/dn631822.aspx#sign_the_user_in
The steps to reproduce the issue (on both thee device and the simulator) are the following:
a) app starts
b) click to the cloud service login button that will trigger a flipsideviewcontroller
c) log into OneDrive with the code provided by MS
d) go back to the main controller
e) CRASH!
The trace is the following:
#########################################################
*** First throw call stack:
(
0 CoreFoundation 0x028dd1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x026598e5 objc_exception_throw + 44
2 CoreFoundation 0x0297a243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x028cd50b ___forwarding___ + 1019
4 CoreFoundation 0x028cd0ee _CF_forwarding_prep_0 + 14
5 CloudFella 0x0015c867 -[LiveConnectClientCore dealloc] + 48
6 libobjc.A.dylib 0x0266a692 _ZN11objc_object17sidetable_releaseEb + 268
7 libobjc.A.dylib 0x0266baeb -[NSObject release] + 25
8 CloudFella 0x00158af1 -[LiveConnectClient dealloc] + 44
9 libobjc.A.dylib 0x0266a692 _ZN11objc_object17sidetable_releaseEb + 268
10 libobjc.A.dylib 0x02669e81 objc_release + 49
11 libobjc.A.dylib 0x02669e3e objc_storeStrong + 39
12 CloudFella 0x00157b9d -[CFFlipsideViewController .cxx_destruct] + 249
13 libobjc.A.dylib 0x026582d4 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 128
14 libobjc.A.dylib 0x0265824f object_cxxDestruct + 20
15 libobjc.A.dylib 0x0266327a objc_destructInstance + 48
16 libobjc.A.dylib 0x026632ab object_dispose + 20
17 UIKit 0x01433d1a -[UIViewController dealloc] + 1854
18 UIKit 0x01430915 -[UIViewController release] + 89
19 libobjc.A.dylib 0x02669e97 objc_release + 71
20 libobjc.A.dylib 0x02656bf0 objc_setProperty_nonatomic + 48
21 UIKit 0x01a6167d -[_UIViewControllerOneToOneTransitionContext _setFromViewController:] + 47
22 UIKit 0x01a61490 -[_UIViewControllerOneToOneTransitionContext dealloc] + 43
23 libobjc.A.dylib 0x0266a692 _ZN11objc_object17sidetable_releaseEb + 268
24 libobjc.A.dylib 0x0266baeb -[NSObject release] + 25
25 UIKit 0x01a60834 -[_UIViewControllerTransitionContext completeTransition:] + 135
26 UIKit 0x01a7a5b1 -[UIViewControllerBuiltinTransitionViewAnimator transitionViewDidComplete:fromView:toView:removeFromView:] + 50
27 UIKit 0x01416137 -[UITransitionView notifyDidCompleteTransition:] + 345
28 UIKit 0x01415e61 -[UITransitionView _didCompleteTransition:] + 1333
29 UIKit 0x014181b7 -[UITransitionView _transitionDidStop:finished:] + 107
30 UIKit 0x013666dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
31 UIKit 0x013669c8 -[UIViewAnimationState animationDidStop:finished:] + 80
32 QuartzCore 0x00fd6bb4 _ZN2CA5Layer23run_animation_callbacksEPv + 304
33 libdispatch.dylib 0x0326b4d0 _dispatch_client_callout + 14
34 libdispatch.dylib 0x03259726 _dispatch_main_queue_callback_4CF + 340
35 CoreFoundation 0x0294243e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
36 CoreFoundation 0x028835cb __CFRunLoopRun + 1963
37 CoreFoundation 0x028829d3 CFRunLoopRunSpecific + 467
38 CoreFoundation 0x028827eb CFRunLoopRunInMode + 123
39 GraphicsServices 0x0301f5ee GSEventRunModal + 192
40 GraphicsServices 0x0301f42b GSEventRun + 104
41 UIKit 0x01316f9b UIApplicationMain + 1225
42 CloudFella 0x000eeea6 main + 94
43 libdyld.dylib 0x034af6d9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
#
If I log into the other cloud services available in my app (Google drive , dropbox, evernote) I got no issues at all.
The problem is happening with both the old LiveSDK API (the one included in the current good release out in the store) and the newest build (2 months old) added to the app to solve some validation issues described here: https://github.com/liveservices/LiveSDK-for-iOS/issues/43
I suspect that going from Xcode 5 to xcode 6 something changed in the building parameters that is causing the issue, however I am not sure where the issue is and how to workaround.
As test I forced building the app for 32 bit architectures only but it crashed as well: this was expected as the LiveSDK API is compatible with 64 bit arch, but certainly wanted to try... .
Any help is greatly appreciated.
Thanks,
dom
Turns out this may be indeed a bug on the liveSDK.
Opened the following issue:
https://github.com/liveservices/LiveSDK-for-iOS/issues/53
and another API user (https://github.com/sylverb) that ran into the same issue gave me a good workaround until the bug is fixed:
"It was crashing because of "[authRefreshRequest cancel];" in the release method of LiveConnectClientCore.m . I had a temporary fix by adding "self" at this line in refreshSessionWithDelegate method (also in LiveConnectClientCore.m) :
self.authRefreshRequest = [[[LiveAuthRefreshRequest alloc] initWithClientId:_clientId
scope:_scopes
refreshToken:refreshToken
delegate:delegate
userState:userState
clientStub:self]
autorelease];
"
Closing the post as solved because a workaround is provided and I added a link to the open bug opened for any other user that wants to follow up on this issue.

Mysterious iOS crash with tiny stack trace

I have one user, and only one user, that regularly gets the following crash:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000192e7a984 objc_object::release() + 8
1 libobjc.A.dylib 0x0000000192e79474 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 524
2 CoreFoundation 0x0000000186855b38 _CFAutoreleasePoolPop + 28
3 CoreFoundation 0x0000000186915124 __CFRunLoopRun + 1460
4 CoreFoundation 0x0000000186855dd0 CFRunLoopRunSpecific + 452
5 GraphicsServices 0x000000018c53dc0c GSEventRunModal + 168
6 UIKit 0x0000000189986fc4 UIApplicationMain + 1156
7 MyApp 0x00000001001a92d0 main (main.m:17)
8 libdyld.dylib 0x0000000193453aa0 start + 4
This is the entire crash, and I have no clue what causes it.
The user has a pretty standard phone, but it only started happening when they got a replacement iPhone 5 earlier this year. Given that timeline and the fact they are the only one with the crash, might the phone itself be at fault?
Is there anywhere I could look for more information to default this information?

In iOS, what caused this crash?

I got a crash in my iOS app, but their has only a few messages, some like this.
Application received signal SIGABRT
(null)
(
0 CoreFoundation 0x359c68a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x37d6d259 objc_exception_throw + 32
2 CoreFoundation 0x359c6789 +[NSException raise:format:] + 0
3 CoreFoundation 0x359c67ab +[NSException raise:format:] + 34
4 myapp 0x00241bf9 _ZNSt11_Deque_baseIsSaIsEE15_M_create_nodesEPPsS3_ + 1432772
5 libsystem_c.dylib 0x32dd27e3 _sigtramp + 38
6 libsystem_c.dylib 0x32dc820f pthread_kill + 54
7 libsystem_c.dylib 0x32dc129f abort + 94
8 libc++abi.dylib 0x35d7ef6b abort_message + 46
9 libc++abi.dylib 0x35d7c3f1 _ZL19safe_handler_callerPFvvE + 120
10 libc++abi.dylib 0x35d7c451 _ZdlPv + 0
11 libc++abi.dylib 0x35d7d825 __cxa_current_exception_type + 0
12 libobjc.A.dylib 0x37d6d2a9 objc_exception_rethrow + 12
13 CoreFoundation 0x3591c50d CFRunLoopRunSpecific + 404
14 CoreFoundation 0x3591c36d CFRunLoopRunInMode + 104
15 GraphicsServices 0x375b8439 GSEventRunModal + 136
16 UIKit 0x33428cd5 UIApplicationMain + 1080
17 myapp 0x000d4293 _mh_execute_header + 41619
18 myapp 0x000ccd20 _mh_execute_header + 11552
)
I can't find what caused this crash, but it is the most frequently appears in my app. I am very anxious, does any one know something about it? Thanks a lot.
If you are able to reproduce this crash either by performing a certain task or just using the app long enough you could attach the debugger and set a breakpoint for [NSException raise]. This way you can figure out in what part of your application stuff is messed up, I used this in the past to figure out where a NSArray went out of bounds.. ( and I have like a dozen or more spread around all source files )
Secondly you should probably 'symbolicate' the crash report so you can follow the stack trace.. so you can figure out what method/class in your code is messing stuff up.
For see a crash callback, try add in your project this great feature:
CrashKit
This is a exception catcher

Resources