With following crash log stack. Can I say that App was in Foreground state when crash occurred. because I can see UIKit calls.. What should one look to identified various state of App. like Suspended / Background / Foreground
**
#0
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000f158936c
**
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3a72c626 objc_msgSend + 5
1 CoreFoundation 0x2feae16b +[__NSArrayI __new:::] + 58
2 CoreFoundation 0x2feab945 -[__NSPlaceholderArray initWithObjects:count:] + 172
3 CoreFoundation 0x2feb5341 +[NSArray arrayWithObjects:count:] + 44
4 CoreFoundation 0x2feeb1bb -[NSDictionary allKeys] + 174
5 UIKit 0x3292430f -[UITouchesEvent _cloneEvent] + 342
6 UIKit 0x32786df9 _UIGestureRecognizerUpdate + 5240
7 CoreFoundation 0x2ff3d255 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
8 CoreFoundation 0x2ff3abf9 __CFRunLoopDoObservers + 284
9 CoreFoundation 0x2ff3af3b __CFRunLoopRun + 730
10 CoreFoundation 0x2fea5ebf CFRunLoopRunSpecific + 522
11 CoreFoundation 0x2fea5ca3 CFRunLoopRunInMode + 106
12 GraphicsServices 0x34dab663 GSEventRunModal + 138
13 UIKit 0x327f214d UIApplicationMain + 1136
14 MyApp 0xff6bf main (main.m:16)
15 libdyld.dylib 0x3ac2fab7 start + 2
com.apple.main-thread is the main thread which loads up the UI of the ViewController.
Since the crash is on the main thread then the app is to be running in foreground.
I hope it helps.
Related
I'm getting a rare crash in my iOS app when resuming from the background. I see -[NSObject doesNotRecognizeSelector:] in the exception backtrace but there is little more information. Any idea where I might start looking?
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x18f7291b8 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18e16055c objc_exception_throw + 55
2 CoreFoundation 0x18f730268 -[NSObject+ 1274472 (NSObject) doesNotRecognizeSelector:] + 139
3 CoreFoundation 0x18f72d270 ___forwarding___ + 915
4 CoreFoundation 0x18f62680c _CF_forwarding_prep_0 + 91
5 CoreFoundation 0x18f6d6b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
6 CoreFoundation 0x18f6d6434 __CFRunLoopDoSources0 + 411
7 CoreFoundation 0x18f6d40a4 __CFRunLoopRun + 803
8 CoreFoundation 0x18f6022b8 CFRunLoopRunSpecific + 443
9 GraphicsServices 0x1910b6198 GSEventRunModal + 179
10 UIKit 0x1956427fc -[UIApplication _run] + 683
11 UIKit 0x19563d534 UIApplicationMain + 207
12 MyApp 0x100040d04 0x10003c000 + 19716
13 libdyld.dylib 0x18e5e55b8 start + 3
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018e6f7014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018e7bf450 pthread_kill + 112
2 libsystem_c.dylib 0x000000018e66b400 abort + 140
3 libc++abi.dylib 0x000000018e1352d4 __cxa_bad_cast + 0
4 libc++abi.dylib 0x000000018e152cc0 default_unexpected_handler+ 126144 () + 0
5 libobjc.A.dylib 0x000000018e160844 _objc_terminate+ 34884 () + 124
6 libc++abi.dylib 0x000000018e14f66c std::__terminate(void (*)+ 112236 ()) + 16
7 libc++abi.dylib 0x000000018e14f234 __cxa_rethrow + 144
8 libobjc.A.dylib 0x000000018e16071c objc_exception_rethrow + 44
9 CoreFoundation 0x000000018f60232c CFRunLoopRunSpecific + 560
10 GraphicsServices 0x00000001910b6198 GSEventRunModal + 180
11 UIKit 0x00000001956427fc -[UIApplication _run] + 684
12 UIKit 0x000000019563d534 UIApplicationMain + 208
13 MyApp 0x0000000100040d04 0x10003c000 + 19716
14 libdyld.dylib 0x000000018e5e55b8 start + 4
It seems that you are calling a method that dosen't belong to an object. It means your object on which you are calling a method is NSObject type and a method that you are calling is not availabel on NSObject. This used to happen when we are doing type casting.
For eg.
NSObject *obj = [NSObject new];
[(UIView *)obj setBackgroundColor:[UIColor whiteColor]]; // it will crash for unrecognize selector call
So the solution is to check the object using isKindOfClass: and then call a method thats belongs to it.
I got a crash from Fabric,the stack is below:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 6806634868 objc_release + 20
1 libsystem_blocks.dylib 6813456656 _Block_release + 256
2 libobjc.A.dylib 6806640420 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
3 CoreFoundation 6529519172 _CFAutoreleasePoolPop + 28
4 UIKit 6605817924 _wrapRunLoopWithAutoreleasePoolHandler + 76
5 CoreFoundation 6530394704 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
6 CoreFoundation 6530382300 __CFRunLoopDoObservers + 360
7 CoreFoundation 6530383292 __CFRunLoopRun + 836
8 CoreFoundation 6529519780 CFRunLoopRunSpecific + 396
9 GraphicsServices 6682260900 GSEventRunModal + 168
10 UIKit 6606283712 UIApplicationMain + 1488
11 Spec 4297532060 main (main.m:15)
12 libdyld.dylib 6813280776 start + 4
I don't know why it would be _Block_release after (anonymous namespace)::AutoreleasePoolPage::pop(void*). Is it possible that a block was added to autoreleasepool?if possible, why the block crashed at release and it not crashed at invoke?
Ok,I had resolve this bug.The reason for the crash was that I had hook the function objectAtIndex for NSMutableArray.And If user switch from background,the app would get a crash -[UIKeyboardLayoutStar release]: message sent to deallocated.
So remove the hook code will resolve this bug.
I hope someone can help me with this issue.
I'm implementing Google Tag Manager in an iOS App. 99% works well, but some times App crashes with the following execptions in:
-[GAIReachabilityChecker reachabilityFlagsChanged:]
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3426bae6 objc_msgSend + 5
1 SuppApp 0x001d3c11 -[GAIReachabilityChecker reachabilityFlagsChanged:] + 2481169
2 SystemConfiguration 0x26b1544d reachPerformAndUnlock + 256
3 CoreFoundation 0x22a0a827 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
4 CoreFoundation 0x22a0a417 __CFRunLoopDoSources0 + 454
5 CoreFoundation 0x22a0877f __CFRunLoopRun + 806
6 CoreFoundation 0x2295b1e9 CFRunLoopRunSpecific + 516
7 CoreFoundation 0x2295afdd CFRunLoopRunInMode + 108
8 GraphicsServices 0x2ba76af9 GSEventRunModal + 160
9 UIKit 0x26bc017d UIApplicationMain + 144
10 SuppApp 0x00061cef main (main.m:16)
11 libdyld.dylib 0x34989873 start + 2
-[GAIDefaultLogger info:]
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x34e8bac6 objc_msgSend + 5
1 SuppApp 0x0020fb3d -[GAIDefaultLogger info:] + 2149181
2 SuppApp 0x00219c11 -[GAIReachabilityChecker reachabilityFlagsChanged:] + 2190353
3 SystemConfiguration 0x27715431 reachPerformAndUnlock + 256
4 CoreFoundation 0x23658c3f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
5 CoreFoundation 0x2365882d __CFRunLoopDoSources0 + 452
6 CoreFoundation 0x23656b9b __CFRunLoopRun + 794
7 CoreFoundation 0x235aa249 CFRunLoopRunSpecific + 520
8 CoreFoundation 0x235aa035 CFRunLoopRunInMode + 108
9 GraphicsServices 0x2c661ad1 GSEventRunModal + 160
10 UIKit 0x277bf899 UIApplicationMain + 144
11 SuppApp 0x000a7cef main (main.m:16)
12 libdyld.dylib 0x355ca873 start + 2
Any idea?
Thanks
It is not your fault. This crash caused by google analytics library. And seems like not only you got these crashes:
https://code.google.com/p/analytics-issues/issues/detail?id=578
I use Crashlytics to track crashes and I am seeing some crashes with the stack trace below:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xf8560b1c
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x37a20b66 objc_msgSend + 5
1 CoreFoundation 0x2d5f8e8d CFRelease + 560
2 QuartzCore 0x2fad2965 CA::release_objects(X::List<void const*>*) + 16
3 QuartzCore 0x2fad7dcf -[CAAnimation dealloc] + 54
4 libobjc.A.dylib 0x37a30b0b objc_object::sidetable_release(bool) + 174
5 CoreFoundation 0x2d5f8e8d CFRelease + 560
6 QuartzCore 0x2fada419 CA::Layer::run_animation_callbacks(void*) + 240
7 libdispatch.dylib 0x37f0a0af _dispatch_client_callout + 22
8 libdispatch.dylib 0x37f0c9a9 _dispatch_main_queue_callback_4CF + 268
9 CoreFoundation 0x2d6935b1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x2d691e7d __CFRunLoopRun + 1308
11 CoreFoundation 0x2d5fc471 CFRunLoopRunSpecific + 524
12 CoreFoundation 0x2d5fc253 CFRunLoopRunInMode + 106
13 GraphicsServices 0x323362eb GSEventRunModal + 138
14 UIKit 0x2feb1845 UIApplicationMain + 1136
It looks like CFRelease is being called on some object twice. The problem is I have no idea which animation is causing the crash. The logs aren't very helpful as the crash happens in different places. How do I go about debugging/reproducing this crash or at the very least logging something so that I know what object is being released twice.
I got a crash log from an app that is already in App Store. The weird part of the crash log is that a class method appears twice in the backtrace of the crashed thread, as if the class method recursively called itself. I said weird because that class method is quite simple and it doesn't make a recursive call inside method body. Here is the part from the crash log:
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3b788350 __pthread_kill + 8
1 libsystem_c.dylib 0x3b6fefb2 pthread_kill + 54
2 libsystem_c.dylib 0x3b73b366 abort + 90
3 btg2 0x0172a358 ___lldb_unnamed_function128645$$btg2 + 280
4 btg2 0x0171af34 ___lldb_unnamed_function128478$$btg2 + 256
5 libsystem_c.dylib 0x3b708d38 _sigtramp + 40
6 btg2 0x0129fd7c +[PHAPIRequest expectedSignatureValueForResponse:nonce:secret:] (PHAPIRequest.m:129)
7 btg2 0x0129fd7c +[PHAPIRequest expectedSignatureValueForResponse:nonce:secret:] (PHAPIRequest.m:129)
8 btg2 0x012a1ee4 -[PHAPIRequest connectionDidFinishLoadingWithRequest:response:data:context:] (PHAPIRequest.m:501)
9 btg2 0x012aee04 -[PHConnectionManager connectionDidFinishLoading:] (PHConnectionManager.m:234)
10 Foundation 0x33d46912 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 14
11 Foundation 0x33c86764 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 196
12 Foundation 0x33c86680 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
13 CFNetwork 0x330e764c ___delegate_didFinishLoading_block_invoke_0 + 24
14 CFNetwork 0x330e6d30 ___withDelegateAsync_block_invoke_0 + 52
15 CFNetwork 0x3310f010 ___performAsync_block_invoke_068 + 16
16 CoreFoundation 0x33350aca CFArrayApplyFunction + 174
17 CFNetwork 0x3310f46e RunloopBlockContext::perform() + 70
18 CFNetwork 0x3307345e MultiplexerSource::perform() + 186
19 CoreFoundation 0x333df8f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
20 CoreFoundation 0x333df158 __CFRunLoopDoSources0 + 208
21 CoreFoundation 0x333ddf2a __CFRunLoopRun + 642
22 CoreFoundation 0x33351238 CFRunLoopRunSpecific + 352
23 CoreFoundation 0x333510c4 CFRunLoopRunInMode + 100
24 GraphicsServices 0x36f0c336 GSEventRunModal + 70
25 UIKit 0x3526d2b4 UIApplicationMain + 1116
26 btg2 0x0007da00 main (main.mm:21)
27 btg2 0x0007a504 ___lldb_unnamed_function1$$btg2 + 36
Does any one have a reasoning why +[PHAPIRequest expectedSignatureValueForResponse:nonce:secret:] appears twice in the backtrace or may be knows the reason of the crash? Appreciate your help!