Crash at _CFAutoreleasePoolPop - ios

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.

Related

-[WKSyntheticTapGestureRecognizer setState:] crash

We have encountered the crash : -[WKSyntheticTapGestureRecognizer setState:] in our app.I am also attaching crash report for the reference:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1540 objc_msgSend + 32
1 WebKit 0x4a6bd8 -[WKSyntheticTapGestureRecognizer setState:] + 100
2 UIKitCore 0x2bb320 -[UITapRecognizer tooSlow:] + 76
3 Foundation 0x365fc __NSFireDelayedPerform + 460
4 CoreFoundation 0xae318 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
5 CoreFoundation 0x32cf0 __CFRunLoopDoTimer + 1076
6 CoreFoundation 0x2d4ec __CFRunLoopDoTimers + 328
7 CoreFoundation 0xbd08 __CFRunLoopRun + 1944
8 CoreFoundation 0x1f468 CFRunLoopRunSpecific + 600
9 GraphicsServices 0x138c GSEventRunModal + 164
10 UIKitCore 0x51a088 -[UIApplication _run] + 1100
11 UIKitCore 0x298958 UIApplicationMain + 2092
12 Adoddle Field Plus 0x1238f0 main + 17 (main.mm:17)
13 ??? 0x10817daa4 (Missing)
KERN_INVALID_ADDRESS at 0x0000000000000010
Like WKSyntheticTapGesturestabilizer has been released and is still accessing its member variables

How to identify the state of an iOS App while crash occurs

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.

Random crashes on iOS App Google Tag Manager implementation

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

iOS: Bad access is cxx_descruct

I have a problem with an app crashing for a few users, I have no idea whats causing it and all I got is this stacktrace from crashlytics:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000194e5016c objc_release + 12
1 learnchinese 0x00000001000a95a0 -[WGRLanguageLabel .cxx_destruct] (WGRLanguageLabel.m:34)
2 libobjc.A.dylib 0x0000000194e36b1c object_cxxDestructFromClass(objc_object*, objc_class*) + 148
3 libobjc.A.dylib 0x0000000194e43f38 objc_destructInstance + 92
4 libobjc.A.dylib 0x0000000194e43f90 object_dispose + 28
5 UIKit 0x0000000187f8771c -[UIResponder dealloc] + 116
6 UIKit 0x0000000187c3dc38 -[UIView dealloc] + 1000
7 learnchinese 0x00000001000a5460 -[WGRLanguageLabel dealloc] (WGRLanguageLabel.m:39)
8 CoreFoundation 0x00000001830a10f8 CFRelease + 524
9 CoreFoundation 0x00000001830ad6b8 -[__NSArrayM dealloc] + 152
10 libobjc.A.dylib 0x0000000194e51724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
11 CoreFoundation 0x00000001830a4d14 _CFAutoreleasePoolPop + 28
12 UIKit 0x0000000187c34584 _wrapRunLoopWithAutoreleasePoolHandler + 76
13 CoreFoundation 0x000000018317bff0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
14 CoreFoundation 0x0000000183178f7c __CFRunLoopDoObservers + 360
15 CoreFoundation 0x000000018317935c __CFRunLoopRun + 836
16 CoreFoundation 0x00000001830a4f74 CFRunLoopRunSpecific + 396
17 GraphicsServices 0x000000018cb076fc GSEventRunModal + 168
18 UIKit 0x0000000187ca6d94 UIApplicationMain + 1488
19 learnchinese 0x00000001001679ec main (main.m:13)
20 libdyld.dylib 0x00000001954e2a08 start + 4
It looks like WGRLanguageLabel has been released when auto release pool try to release it again.
Here is the dealloc method in WGRLanguageLabel:
#implementation WGRLanguageLabel
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
...
#end

Debug/reproduce EXC_BAD_ACCESS crash in CA::release_objects

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.

Resources