I got a lot of crash reports on my current app using the following code in my AppDelegate:
- (void)prepareFrameworks
{
if([MFMessageComposeViewController canSendText])
(void)[[MFMessageComposeViewController alloc] init];
if([MFMailComposeViewController canSendMail])
(void)[[MFMailComposeViewController alloc] init];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
(void)[[SLComposeViewController alloc] init];
}
I'm running the code to reduce the load time of the ComposeViewController on activation.
One of the stacktraces:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xe15f851f
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3ab570ec objc_retain + 11
1 libsystem_blocks.dylib 0x3b07fd97 _Block_object_assign + 386
2 libsystem_blocks.dylib 0x3b07f9e9 _Block_copy_internal + 444
3 UIKit 0x3346f987 +[_UIAsyncInvocation invocationWithBlock:] + 74
4 UIKit 0x33457b87 +[_UIRemoteViewControllerConnectionRequest requestViewController:fromServiceWithBundleIdentifier:serializedAppearanceCustomizations:legacyAppearance:useXPCObjects:exportedHostingObject:serviceViewControllerDeputyInterface:connectionHandler:] + 914
5 UIKit 0x3345a129 +[_UIRemoteViewController requestViewController:fromServiceWithBundleIdentifier:connectionHandler:] + 468
6 MessageUI 0x31f0d37f +[MFMailComposeRemoteViewController requestViewControllerWithConnectionHandler:] + 62
7 MessageUI 0x31f0a79f -[MFMailComposeInternalViewController initWithNibName:bundle:] + 126
8 MessageUI 0x31ef2281 -[MFMailComposeViewController initWithURL:] + 216
9 MY APP 0x000cb881 -[AppDelegate prepareFrameworks] (AppDelegate.m:262)
10 MY APP 0x000cad61 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:128)
11 UIKit 0x32fae2ff -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 274
12 UIKit 0x32fadd4f -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1390
13 UIKit 0x32fa8353 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 714
14 UIKit 0x32f4341f -[UIApplication handleEvent:withNewEvent:] + 3130
15 UIKit 0x32f42721 -[UIApplication sendEvent:] + 72
16 UIKit 0x32fa7b3d _UIApplicationHandleEvent + 664
17 GraphicsServices 0x353de70d _PurpleEventCallback + 608
18 GraphicsServices 0x353de2f7 PurpleEventCallback + 34
19 CoreFoundation 0x307959df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20 CoreFoundation 0x3079597b __CFRunLoopDoSource1 + 346
21 CoreFoundation 0x3079414f __CFRunLoopRun + 1398
22 CoreFoundation 0x306fec27 CFRunLoopRunSpecific + 522
23 CoreFoundation 0x306fea0b CFRunLoopRunInMode + 106
24 UIKit 0x32fa6dd9 -[UIApplication _run] + 760
25 UIKit 0x32fa2049 UIApplicationMain + 1136
26 MY APP 0x000cac27 main (main.m:16)
Related
My app has many random crashes recently. Fabric shows the crash rate is about 1%. The crash session number and the crash user number is very close, which means it's very random.
The crash shows several different callstacks on Fabric, here are three of them.
==========1===============
#0. Crashed: com.apple.main-thread
0 QuartzCore 0x188715730 CALayerGetSuperlayer + 20
1 UIKit 0x188dd6fa0 -[UIView(Hierarchy) superview] + 44
2 UIKit 0x188dd7a88 -[UIView nextResponder] + 108
3 UIKit 0x188e9d99c -[UIResponder _containsResponder:] + 56
4 UIKit 0x188ecfc80 -[UITransitionView transition:fromView:toView:removeFromView:] + 576
5 UIKit 0x188f13238 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 1536
6 UIKit 0x188f12aec -[UITabBarController _setSelectedViewController:] + 360
7 UIKit 0x188fda30c -[UITabBarController _tabBarItemClicked:] + 336
8 UIKit 0x188e11398 -[UIApplication sendAction:to:from:forEvent:] + 96
9 UIKit 0x188fda160 -[UITabBar _sendAction:withEvent:] + 468
10 UIKit 0x188e11398 -[UIApplication sendAction:to:from:forEvent:] + 96
11 UIKit 0x188dfa474 -[UIControl _sendActionsForEvents:withEvent:] + 612
12 UIKit 0x188fd9d98 -[UITabBar(Static) _buttonUp:] + 128
13 UIKit 0x188e11398 -[UIApplication sendAction:to:from:forEvent:] + 96
14 UIKit 0x188dfa474 -[UIControl _sendActionsForEvents:withEvent:] + 612
15 UIKit 0x188e10d34 -[UIControl touchesEnded:withEvent:] + 592
16 UIKit 0x188dcff54 _UIGestureRecognizerUpdate + 8536
17 CoreFoundation 0x18431c2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
18 CoreFoundation 0x184319230 __CFRunLoopDoObservers + 360
19 CoreFoundation 0x184319610 __CFRunLoopRun + 836
20 CoreFoundation 0x1842452d4 CFRunLoopRunSpecific + 396
21 GraphicsServices 0x18dc9b6fc GSEventRunModal + 168
22 UIKit 0x188e42f40 UIApplicationMain + 1488
======================2=======================
#0. Crashed: com.apple.main-thread
0 QuartzCore 0x18e7ca1d0 CALayerGetSuperlayer + 20
1 UIKit 0x191e4e9d4 -[UIView(UIKitManual) superview] + 128
2 UIKit 0x1915d3a5c -[UIView nextResponder] + 120
3 UIKit 0x19197d620 -[UIResponder _canChangeFirstResponder:toResponder:] + 64
4 UIKit 0x19165c01c -[UIResponder becomeFirstResponder] + 224
5 UIKit 0x19169b118 -[UINavigationController navigationTransitionView:didStartTransition:] + 760
6 UIKit 0x1917758ac -[UINavigationController _startCustomTransition:] + 3852
7 UIKit 0x19168f7bc -[UINavigationController _startDeferredTransitionIfNeeded:] + 676
8 UIKit 0x19168f424 -[UINavigationController __viewWillLayoutSubviews] + 64
9 UIKit 0x19168f388 -[UILayoutContainerView layoutSubviews] + 188
10 UIKit 0x1915d5cc0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200
11 QuartzCore 0x18e7c6274 -[CALayer layoutSublayers] + 148
12 QuartzCore 0x18e7bade8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
13 QuartzCore 0x18e7baca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
14 QuartzCore 0x18e73634c CA::Context::commit_transaction(CA::Transaction*) + 252
15 QuartzCore 0x18e75d3ac CA::Transaction::commit() + 504
16 QuartzCore 0x18e75de78 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
17 CoreFoundation 0x18b4549a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
18 CoreFoundation 0x18b452630 __CFRunLoopDoObservers + 372
19 CoreFoundation 0x18b452a7c __CFRunLoopRun + 956
20 CoreFoundation 0x18b382da4 CFRunLoopRunSpecific + 424
21 GraphicsServices 0x18cded074 GSEventRunModal + 100
22 UIKit 0x19163dc9c UIApplicationMain + 208
=========3========
#0. Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18fe4c1a0 objc_retain + 16
1 UIKit 0x1974fba5c -[UIView nextResponder] + 120
2 UIKit 0x1978a45ec -[UIResponder _resignIfContainsFirstResponder] + 156
3 UIKit 0x1974fb76c -[UIView(Hierarchy) _willMoveToWindow:] + 568
4 UIKit 0x197507d88 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 424
5 UIKit 0x197773000 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke_2 + 1556
6 UIKit 0x19750e964 +[UIView(Animation) performWithoutAnimation:] + 104
7 UIKit 0x1976e0950 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 260
8 UIKit 0x1977fd388 +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 220
9 UIKit 0x1976e0450 -[_UINavigationParallaxTransition animateTransition:] + 1060
10 UIKit 0x19769d818 -[UINavigationController _startCustomTransition:] + 3704
11 UIKit 0x1975b77bc -[UINavigationController _startDeferredTransitionIfNeeded:] + 676
12 UIKit 0x1975b7424 -[UINavigationController __viewWillLayoutSubviews] + 64
13 UIKit 0x1975b7388 -[UILayoutContainerView layoutSubviews] + 188
14 UIKit 0x1974fdcc0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1200
15 QuartzCore 0x1946ee274 -[CALayer layoutSublayers] + 148
16 QuartzCore 0x1946e2de8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
17 QuartzCore 0x1946e2ca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
18 QuartzCore 0x19465e34c CA::Context::commit_transaction(CA::Transaction*) + 252
19 QuartzCore 0x1946853ac CA::Transaction::commit() + 504
20 UIKit 0x1974f3308 _afterCACommitHandler + 256
21 CoreFoundation 0x19137c9a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
22 CoreFoundation 0x19137a630 __CFRunLoopDoObservers + 372
23 CoreFoundation 0x19137aa7c __CFRunLoopRun + 956
24 CoreFoundation 0x1912aada4 CFRunLoopRunSpecific + 424
25 GraphicsServices 0x192d15074 GSEventRunModal + 100
26 UIKit 0x197565c9c UIApplicationMain + 208
I have no idea which page or what action caused this crash, and I can't reproduce this either.
Also tried Xcode analytics, zombie, memory instrument, with no luck.
Please let me know if you have any comments.
I'm looking into a crash report in Fabric, and I have no idea what might have caused it. The stack trace is not particularly helpful, however it looks the app was preparing to be suspended in the background. Here is the crash message:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445
Here's the stack trace:
Crashed: com.apple.main-thread
0 QuartzCore 0x18680fdf0 CALayerGetLayer + 12
1 QuartzCore 0x186810540 CA::Context::invalidate() + 68
2 QuartzCore 0x1868104cc -[CAContextImpl dealloc] + 64
3 UIKit 0x188f04bc4 -[UIWindow _destroyContext] + 324
4 UIKit 0x188f049e4 +[UIWindow _prepareWindowsForAppSuspend] + 172
5 UIKit 0x188f0491c -[UIApplication _destroyContextsAndNotifySpringBoard] + 28
6 UIKit 0x189124244 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke_2 + 240
7 UIKit 0x1891280f0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke2283 + 148
8 FrontBoardServices 0x1856c9fc0 -[FBSSceneSnapshotAction _finishAllRequests] + 80
9 FrontBoardServices 0x1856c9d38 -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:] + 224
10 UIKit 0x189127ee0 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke + 272
11 UIKit 0x1891274e0 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] + 900
12 UIKit 0x189127d7c -[UIApplication _performSnapshotsWithAction:forScene:completion:] + 560
13 UIKit 0x189127ad0 -[UIApplication _handleSnapshotAction:forScene:completion:] + 156
14 UIKit 0x1891243dc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2031 + 272
15 UIKit 0x189123ffc __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke2017 + 1040
16 UIKit 0x189126fd8 _runAfterCACommitDeferredBlocks + 292
17 UIKit 0x189134990 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
18 UIKit 0x188e664a4 _afterCACommitHandler + 96
19 CoreFoundation 0x183ce07b0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
20 CoreFoundation 0x183cde554 __CFRunLoopDoObservers + 372
21 CoreFoundation 0x183cde984 __CFRunLoopRun + 928
22 CoreFoundation 0x183c08d10 CFRunLoopRunSpecific + 384
23 GraphicsServices 0x1854f0088 GSEventRunModal + 180
24 UIKit 0x188eddf70 UIApplicationMain + 204
25 HDWR 0x1000706dc main (AppDelegate.swift:37)
26 libdispatch.dylib 0x1837a68b8 (Missing)
Any idea how I can get to the bottom of this?
Does this seem like it might be a bug in UIKit or QuartzCore, or is it more likely to be a bug in our own code?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x444444444444445
i think you are using nil object which is not insalized
I have this app in the app store, which according to Crashalitics, its %92-%95 stable. I made a similar app for Android and its around 98% stable. I am trying to get the stability up - but I don't see how. All the bugs I am seeing in the IOS version are not touching my code.
I see random bugs, that are not reproducible, and when they do are very random. Each happens 1-10 times, but I have a list of ... ~30 different items.
The app is pretty simple - a mostly linear storyboard (a few jumps, but no loops). The only project I am using which is not Apple's code is InAppSettingsKit, and most of the app is just maps which shows some items. The project is using ARC and currently compiled using XCode6 (but XCode5 showed the same symptoms).
How can I find these crashes? Is this in an inherent problem of IOS7-8? I do see some apps just closing up when I use the IPhone, and friends to tell me that IOS is not that stable, but ... I just think I am doing something wrong.
IOS8 70% IOS7 30%
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x36444f66 objc_msgSend + 5
1 UIKit 0x2c160b35 -[UIScrollView(UIScrollViewInternal) _delegateScrollViewAnimationEnded] + 52
2 UIKit 0x2c160ac1 -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 184
3 UIKit 0x2c20a5e5 -[UIAnimator stopAnimation:] + 476
4 UIKit 0x2c209fb9 -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 304
5 UIKit 0x2c209e85 -[UIAnimator(Static) _LCDHeartbeatCallback:] + 52
6 QuartzCore 0x2bae4aeb CA::Display::DisplayLinkItem::dispatch() + 98
7 QuartzCore 0x2bae4953 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
8 IOMobileFramebuffer 0x303c482f IOMobileFramebufferVsyncNotifyFunc + 90
9 IOKit 0x29af01ed IODispatchCalloutFromCFMessage + 256
10 CoreFoundation 0x28b7c3a5 __CFMachPortPerform + 132
11 CoreFoundation 0x28b8c7f3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
12 CoreFoundation 0x28b8c78f __CFRunLoopDoSource1 + 346
13 CoreFoundation 0x28b8adb1 __CFRunLoopRun + 1608
14 CoreFoundation 0x28ad7b31 CFRunLoopRunSpecific + 476
15 CoreFoundation 0x28ad7943 CFRunLoopRunInMode + 106
16 GraphicsServices 0x2feb7051 GSEventRunModal + 136
17 UIKit 0x2c0cd6f1 UIApplicationMain + 1440
18 --------------- 0x000c8833 main (main.m:16)
IOS7 - 8 times
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2e23ef83 __exceptionPreprocess + 130
1 libobjc.A.dylib 0x389efccf objc_exception_throw + 38
2 CoreFoundation 0x2e242917 -[NSObject(NSObject) doesNotRecognizeSelector:] + 202
3 CoreFoundation 0x2e241203 ___forwarding___ + 706
4 CoreFoundation 0x2e190768 _CF_forwarding_prep_0 + 24
5 VectorKit 0x35ec6911 -[VKMapCanvas initShouldRasterize:contentScale:inBackground:] + 476
6 VectorKit 0x35ec620f -[VKMapView initWithGlobe:shouldRasterize:inBackground:] + 230
7 MapKit 0x2f3d980b -[MKBasicMapView initWithFrame:andGlobe:shouldRasterize:] + 322
8 MapKit 0x2f40cd77 -[MKMapView _commonInitAndEnableLoading:fromIB:gestureRecognizerHostView:showsAttribution:] + 878
9 MapKit 0x2f40d86b -[MKMapView initWithCoder:] + 134
10 UIKit 0x30e70169 UINibDecoderDecodeObjectForValue + 740
11 UIKit 0x30e6fe7f -[UINibDecoder decodeObjectForKey:] + 90
12 UIKit 0x30dcb5ff -[UIRuntimeConnection initWithCoder:] + 150
13 UIKit 0x30e70169 UINibDecoderDecodeObjectForValue + 740
14 UIKit 0x30e70109 UINibDecoderDecodeObjectForValue + 644
15 UIKit 0x30e6fe7f -[UINibDecoder decodeObjectForKey:] + 90
16 UIKit 0x30dcadd1 -[UINib instantiateWithOwner:options:] + 888
17 UIKit 0x30d2360b -[UIViewController _loadViewFromNibNamed:bundle:] + 234
18 UIKit 0x30b7fbcd -[UIViewController loadView] + 92
19 UIKit 0x30a602ed -[UIViewController loadViewIfRequired] + 72
20 UIKit 0x30a60269 -[UIViewController view] + 24
21 UIKit 0x30b0a14b -[UINavigationController _startTransition:fromViewController:toViewController:] + 198
22 UIKit 0x30b09dfd -[UINavigationController _startDeferredTransitionIfNeeded:] + 572
23 UIKit 0x30b09b6d -[UINavigationController __viewWillLayoutSubviews] + 44
24 UIKit 0x30b09b05 -[UILayoutContainerView layoutSubviews] + 184
25 UIKit 0x30a5bd59 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 380
26 QuartzCore 0x306d962b -[CALayer layoutSublayers] + 142
27 QuartzCore 0x306d4e3b CA::Layer::layout_if_needed(CA::Transaction*) + 350
28 QuartzCore 0x30703cdd -[CALayer layoutIfNeeded] + 140
29 UIKit 0x30ad8163 -[UIViewController window:setupWithInterfaceOrientation:] + 242
30 UIKit 0x30ad6783 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3498
31 UIKit 0x30ad59d3 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 46
32 UIKit 0x30ad595b -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 94
33 UIKit 0x30ad58f3 -[UIWindow _setRotatableViewOrientation:duration:force:] + 42
34 UIKit 0x30acdf69 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 108
35 UIKit 0x30a62107 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 382
36 UIKit 0x30ad5641 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 696
37 UIKit 0x30ad5105 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 164
38 UIKit 0x30a67045 -[UIWindow addRootViewControllerViewIfPossible] + 460
39 UIKit 0x30a64827 -[UIWindow _setHidden:forced:] + 302
40 UIKit 0x30ace33d -[UIWindow makeKeyAndVisible] + 60
41 UIKit 0x30acafad -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1820
42 UIKit 0x30ac556b -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 714
43 UIKit 0x30a616e9 -[UIApplication handleEvent:withNewEvent:] + 3540
44 UIKit 0x30a60851 -[UIApplication sendEvent:] + 72
45 UIKit 0x30ac4ca9 _UIApplicationHandleEvent + 616
46 GraphicsServices 0x33079aed _PurpleEventCallback + 608
47 GraphicsServices 0x330796d7 PurpleEventCallback + 34
48 CoreFoundation 0x2e209a67 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
49 CoreFoundation 0x2e209a03 __CFRunLoopDoSource1 + 346
50 CoreFoundation 0x2e2081d7 __CFRunLoopRun + 1398
51 CoreFoundation 0x2e172ebf CFRunLoopRunSpecific + 522
52 CoreFoundation 0x2e172ca3 CFRunLoopRunInMode + 106
53 UIKit 0x30ac3ed1 -[UIApplication _run] + 760
54 UIKit 0x30abf14d UIApplicationMain + 1136
55 --------------- 0x000ef833 main (main.m:16)
56 libdyld.dylib 0x38efcab7 start + 2
Another (IOS 6.1.6)
vThread : Fatal Exception: NSGenericException
0 CoreFoundation 0x31eaf2a3 __exceptionPreprocess + 162
1 libobjc.A.dylib 0x39b0b97f objc_exception_throw + 30
2 UIKit 0x3404d30f -[UIStoryboardPushSegue perform] + 1118
3 UIKit 0x33da20c5 -[UIApplication sendAction:to:from:forEvent:] + 72
4 UIKit 0x33da214d -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 120
5 UIKit 0x33da20c5 -[UIApplication sendAction:to:from:forEvent:] + 72
6 UIKit 0x33da2077 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
7 UIKit 0x33da2055 -[UIControl sendAction:to:forEvent:] + 44
8 UIKit 0x33da190b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 502
9 UIKit 0x33da1e01 -[UIControl touchesEnded:withEvent:] + 488
10 UIKit 0x33cca5f1 -[UIWindow _sendTouchesForEvent:] + 524
11 UIKit 0x33cb7801 -[UIApplication sendEvent:] + 380
12 UIKit 0x33cb711b _UIApplicationHandleEvent + 6154
13 GraphicsServices 0x359735a3 _PurpleEventCallback + 590
14 GraphicsServices 0x359731d3 PurpleEventCallback + 34
15 CoreFoundation 0x31e84173 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
16 CoreFoundation 0x31e84117 __CFRunLoopDoSource1 + 138
17 CoreFoundation 0x31e82f99 __CFRunLoopRun + 1384
18 CoreFoundation 0x31df5ebd CFRunLoopRunSpecific + 356
19 CoreFoundation 0x31df5d49 CFRunLoopRunInMode + 104
20 GraphicsServices 0x359722eb GSEventRunModal + 74
21 UIKit 0x33d0b301 UIApplicationMain + 1120
22 --------------- 0x00116833 main (main.m:16)
23 libdyld.dylib 0x39f42b20 start
my application keeps crashing because of the below error. I tried debugging it but am not able to understand why is it caused and how to debug and remove this..
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x335cef46 objc_msgSend + 5
1 UIKit 0x29307c2b -[UIApplication sendAction:to:from:forEvent:] + 70
2 UIKit 0x29307bd1 -[UIControl sendAction:to:forEvent:] + 44
3 UIKit 0x292f2863 -[UIControl _sendActionsForEvents:withEvent:] + 582
4 UIKit 0x2930763d -[UIControl touchesEnded:withEvent:] + 588
5 UIKit 0x29307317 -[UIWindow _sendTouchesForEvent:] + 522
6 UIKit 0x29300be1 -[UIWindow sendEvent:] + 544
7 UIKit 0x292d73dd -[UIApplication sendEvent:] + 196
8 UIKit 0x2954ac29 _UIApplicationHandleEventFromQueueEvent + 13888
9 UIKit 0x292d5e39 _UIApplicationHandleEventQueue + 1296
10 CoreFoundation 0x25dde377 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
11 CoreFoundation 0x25ddd787 __CFRunLoopDoSources0 + 218
12 CoreFoundation 0x25ddbded __CFRunLoopRun + 772
13 CoreFoundation 0x25d2a211 CFRunLoopRunSpecific + 476
14 CoreFoundation 0x25d2a023 CFRunLoopRunInMode + 106
15 GraphicsServices 0x2d1230a9 GSEventRunModal + 136
16 UIKit 0x293361d1 UIApplicationMain + 1440
17 Application 0x000ffefb main (main.m:17)
I am getting abnormal termination (crash) with the App which I am working with when I am changing the device orientation. I am unable to reproduce it so often (it's not happening always when I am rotating, let's say the chance would be some where around 0.01%), but it's a serious problem. I am attaching an important part of a crash report.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x6563616e
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3233a5b0 objc_msgSend + 16
1 UIKit 0x36297b82 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1546
2 UIKit 0x3628301e -[UITableViewRowData rectForFooterInSection:] + 310
3 UIKit 0x3628358c -[UITableViewRowData heightForTable] + 48
4 UIKit 0x36283400 -[UITableView(_UITableViewPrivate) _updateContentSize] + 324
5 UIKit 0x362cc8b4 -[UITableView _rectChangedWithNewSize:oldSize:] + 252
6 UIKit 0x362cc544 -[UITableView setFrame:] + 220
7 UIKit 0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644
8 UIKit 0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262
9 UIKit 0x3644eb2a -[UIScrollView _resizeWithOldSuperviewSize:] + 38
10 CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
11 CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
12 CoreFoundation 0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
13 UIKit 0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
14 UIKit 0x36263ba2 -[UIView(Geometry) setFrame:] + 414
15 UIKit 0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644
16 UIKit 0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262
17 CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
18 CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
19 CoreFoundation 0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
20 UIKit 0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
21 UIKit 0x36263ba2 -[UIView(Geometry) setFrame:] + 414
22 UIKit 0x362a6dc0 -[UIViewControllerWrapperView setFrame:] + 48
23 UIKit 0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644
24 UIKit 0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262
25 CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
26 CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
27 CoreFoundation 0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
28 UIKit 0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
29 UIKit 0x36263ba2 -[UIView(Geometry) setFrame:] + 414
30 UIKit 0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644
31 UIKit 0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262
32 CoreFoundation 0x35b63aec __NSArrayChunkIterate + 360
33 CoreFoundation 0x35b5ca74 __NSArrayEnumerate + 608
34 CoreFoundation 0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
35 UIKit 0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
36 UIKit 0x362c64ae -[UIView(Geometry) setBounds:] + 430
37 UIKit 0x3634ff32 -[UILayoutContainerView setBounds:] + 58
38 UIKit 0x363edd88 -[UIViewController window:willAnimateRotationToInterfaceOrientation:duration:] + 460
39 UIKit 0x3630e2b0 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3616
40 UIKit 0x3630d482 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42
41 UIKit 0x3630d40c -[UIWindow _setRotatableViewOrientation:duration:force:] + 64
42 UIKit 0x3644317c __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100
43 UIKit 0x362cb676 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214
44 UIKit 0x362d4d20 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 176
45 CoreFoundation 0x35ab9034 _CFXNotificationPost + 1424
46 Foundation 0x3721bd8c -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
47 UIKit 0x36268c60 -[UIDevice setOrientation:animated:] + 292
48 UIKit 0x362633d6 -[UIApplication handleEvent:withNewEvent:] + 2954
49 UIKit 0x362626c8 -[UIApplication sendEvent:] + 68
50 UIKit 0x36262116 _UIApplicationHandleEvent + 6150
51 GraphicsServices 0x318885a0 _PurpleEventCallback + 588
52 GraphicsServices 0x318881ce PurpleEventCallback + 30
53 CoreFoundation 0x35b3d170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
54 CoreFoundation 0x35b3d112 __CFRunLoopDoSource1 + 134
55 CoreFoundation 0x35b3bf94 __CFRunLoopRun + 1380
56 CoreFoundation 0x35aaeeb8 CFRunLoopRunSpecific + 352
57 CoreFoundation 0x35aaed44 CFRunLoopRunInMode + 100
58 GraphicsServices 0x318872e6 GSEventRunModal + 70
59 UIKit 0x362b62f4 UIApplicationMain + 1116
Neither thread activities are involved nor ViewControllers are customized. Moreover, I am using ARC.
I would like to know either the exact cause of reason or the possibilities which would lead to a crash while autorotation is taking place.
Thanks in advance...
I think app sends a message to an deallocated object. Yes, sometimes it happens even if when you use ARC. To debug it you need to run your app with Instruments (Zombies) and try to reproduce the bug.
Enabling Zombies and debugging the App with Instruments (Zombies) has really helped to locate the error. But to fix the bug or avoid the same mistake in the future is really important.
In my code, I had an implementation something like this...
- (void)someMethod {
[self.navigationController pushViewController:[DestinationViewController new] animated:YES];
}
there we are not holding the DestinationViewController's strong reference directly. But the change...
#property (strong, nonatomic) DestinationViewController *dvc;
// ....
- (void)someMethod {
self.dvc = [DestinationViewController new];
[self.navigationController pushViewController:self.dvc animated:YES];
}
has helped to avoid the bug. I can't really explane why...??? but I hope changing the device orientation releses DestinationViewController but which can be avoided by holding the strong reference.