Xcode 8.1 release APP crash libobjc.A.dylib objc_msgSend - ios

APP in Xcode8.1 directly installed on the phone to run on all versions are not any problems, posted .ipa to the Third-party platforms installed,in iOS9.3 the following does not have any problem, but when I submitted to AppStore and testfight installed to the phone in iOS9.3 The following version will be an exception flashback, any one encountered the same problem Yeah, solving, I have not encountered in the use of Xcode7 published this problem.
Could anyone advise how I may be able to track this down?
I am getting the crash shown below in Crashlytics.
0 libobjc.A.dylib objc_msgSend + 28
1 libobjc.A.dylib (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 508
2 FrontBoardServices -[FBSSerialQueue _performNext] + 192
3 FrontBoardServices -[FBSSerialQueue _performNextFromRunLoopSource] + 56
4 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
5 CoreFoundation ___CFRunLoopDoSources0 + 540
6 CoreFoundation ___CFRunLoopRun + 724
7 CoreFoundation CFRunLoopRunSpecific + 384
8 UIKit -[UIApplication _run] + 460
9 UIKit UIApplicationMain + 204
10 huxijia main (main.m:14)
11 libdyld.dylib _start + 4
0 libobjc.A.dylib
objc_msgSend + 28
1 CoreFoundation
CFEqual + 340
2 CoreFoundation
___NSCacheKeyEqual + 12
3 libcache.dylib
__entry_get_optionally_checking_collisions + 164
4 libcache.dylib
cache_get_and_retain + 132
5 CoreFoundation
-[NSCache objectForKey:] + 68
6 CoreUI
-[CUIStructuredThemeStore _canGetRenditionWithKey:isFPO:lookForSubstitutions:] + 360
7 CoreUI
-[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:] + 1416
8 CoreUI
-[CUICatalog namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 148
9 UIKit
___98-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 424
10 UIKit
-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 212
11 UIKit
-[_UIAssetManager imageNamed:withTrait:] + 528
12 UIKit
__UIImageWithNameAndTraitCollection + 96
13 UIKit
+[UIImage(UIImagePrivate) _kitImageNamed:withTrait:] + 36
14 UIKit
_CreateScrollIndicator + 260
15 UIKit
-[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 200
16 UIKit
-[UIScrollView setContentOffset:] + 524
17 UIKit
-[UITableView setContentOffset:] + 300
18 UIKit
-[UIPickerTableView _setContentOffset:notify:] + 100
19 UIKit
-[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60
0 libobjc.A.dylib
objc_msgSend + 28
1 libcache.dylib
__entry_get_optionally_checking_collisions + 52
2 libcache.dylib
__entry_table_resize + 308
3 libcache.dylib
cache_set_and_retain + 852
4 CoreFoundation
-[NSCache setObject:forKey:cost:] + 268
5 CoreUI
-[CUIStructuredThemeStore _canGetRenditionWithKey:isFPO:lookForSubstitutions:] + 860
6 CoreUI
-[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:] + 924
7 CoreUI
-[CUICatalog namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 148
8 UIKit
___98-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 424
9 UIKit
-[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 260
10 UIKit
-[UIImageAsset imageWithTraitCollection:] + 404
11 UIKit
-[UIImageView _resolveImageForTrait:] + 460
12 UIKit
-[UIImageView _didMoveFromWindow:toWindow:] + 212
13 UIKit
-[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
14 UIKit
-[UIActivityIndicatorView _didMoveFromWindow:toWindow:] + 196
15 UIKit
-[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
16 UIKit
-[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
17 UIKit
-[UIView(Internal) _didMoveFromWindow:toWindow:] + 760
18 UIKit
___45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 152
19 UIKit
-[UIView(Hierarchy) _postMovedFromSuperview:] + 504

Crashes in ObjC runtime and/or autorelease operations are almost always a dangling pointer.
I highly doubt this is related to the environment. More like, there's just a code path/edge case that you aren't seeing during normal development. I'd start with NSZombies, which can be really helpful.
I'd also recommend looking through your Crashlytics crashes for strange unrecognized selector crashes, or other things in runtime code. They could all potentially be related to the same underlying root cause.

Related

my app crash in uikit ,only happen on IPhone X and above exception name NSInternalInconsistencyException

Failed to load bounding path bitmap data from the asset manager for asset name: BoundingPathBitmap-1125x2436-375x812-3.00x
The crash happen on the viewcontroller contain UIScrollView When open it,and only happens with the iPhone X and above
We develop app UI use storyboard
0 CoreFoundation ___exceptionPreprocess + 228
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation +[_CFXNotificationTokenRegistration keyCallbacks]
3 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4 UIKitCore -[_UIScreenBezierBoundingPathUtilities _loadBitmapForScreen:type:] + 1124
5 UIKitCore -[_UIScreenBezierBoundingPathUtilities initWithScreen:] + 144
6 UIKitCore +[_UIScreenBoundingPathUtilities boundingPathUtilitiesForScreen:] + 108
7 UIKitCore -[UIScreen _boundingPathUtilities] + 56
8 UIKitCore -[UIWindow _boundingPath] + 168
9 UIKitCore -[UIView(UIViewBoundingPathSupportInternal) _effectiveBoundingPathAndBoundingPathView:] + 256
10 UIKitCore -[UIView(UIViewBoundingPathSupport) _inscribedRectInBoundingPathByInsettingRect:onEdges:withOptions:] + 88
11 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForTrailingEdgeAccessoryWithBoundingPathEdgesToUse:safeAreaInsets:bounds:scale:accessoryWidth:additionalInsetFromEdge:] + 180
12 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForAccessoryOnEdge:hasCustomClientInsets:accessorySize:additionalInsetFromEdge:] + 1388
13 UIKitCore -[UIScrollView(UIScrollViewInternal) _effectiveVerticalScrollIndicatorInsets] + 152
14 UIKitCore -[UIScrollView _layoutVerticalScrollIndicatorWithBounds:effectiveInset:contentOffset:fraction:additionalInset:cornerAdjust:showing:recalcSize:] + 252
15 UIKitCore -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 1040
16 UIKitCore -[UIScrollView _updateForChangedScrollIndicatorRelatedInsets] + 132
17 UIKitCore __UIScrollViewAdjustForOverlayInsetsChangeIfNecessary + 512
18 UIKitCore -[UIScrollView(UIScrollViewInternal) setSafeAreaInsets:] + 312
19 UIKitCore -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 1288
20 UIKitCore -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 124
21 UIKitCore -[UIScrollView(_UIOldConstraintBasedLayoutSupport) _resizeWithOldSuperviewSize:] + 52
22 CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 464
23 UIKitCore -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
24 UIKitCore -[UIView(AdditionalLayoutSupport) _is_layout] + 152
25 UIKitCore -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 988
26 UIKitCore -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1380
27 QuartzCore 0x00000001ca79e000 + 1309564
28 QuartzCore 0x00000001ca79e000 + 1329972
29 QuartzCore 0x00000001ca79e000 + 669080
30 QuartzCore 0x00000001ca79e000 + 859848
31 QuartzCore 0x00000001ca79e000 + 863536
32 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
33 CoreFoundation ___CFRunLoopDoObservers + 412
34 CoreFoundation ___CFRunLoopRun + 1264
35 CoreFoundation CFRunLoopRunSpecific + 436
36 GraphicsServices GSEventRunModal + 100
37 UIKitCore UIApplicationMain + 212
38 live main (main.mm:23)
39 libdyld.dylib 0x00000001c5d2a000 + 2996
hope someone could give me some advice, thanks
The same crash also happened in my app.
When I turned off the 'Show Horizontal Indicator' and 'Show Vertical Indicator' on the storyboard, the crash no longer occurred.
It just happened with my app .. Fixed ,
Delete the app and restart Simulator ..
^ command + shift + K to clean build folder

app crashing in ipa file only,not crashed when installed with xcode to device

I am stuck in a very weird situation.When i create an IPA and install it in to any device, its crashing at one fixed point.But when i install directly from xcode to device, it works perfectly fine and no crashes.Tried almost every possible solution available, deleting the build folder, cleaning, removing files and adding them again etc..
Below is the crash log for refernce. Any help would be appreciated THanks
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 0x185e681c0 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x1848a055c objc_exception_throw + 56
2 CoreFoundation 0x185e68108 +[NSException raise:format:] + 116
3 Foundation 0x1868565ac -[NSString rangeOfString:options:range:locale:] + 352
4 Foundation 0x186949f5c -[NSString containsString:] + 68
5 TM iSwift 0x100157528 -[KossexViewController tableView:heightForHeaderInSection:] (KossexViewController.m:1373)
6 UIKit 0x18bd90b20 -[UITableView _delegateWantsHeaderForSection:] + 528
7 UIKit 0x18bd8f7b0 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 208
8 UIKit 0x18c180b7c -[UITableViewRowData _ensureSectionOffsetIsValidForSection:] + 348
9 UIKit 0x18bd8f61c -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 576
10 UIKit 0x18bd8f380 -[UITableViewRowData heightForTable] + 60
11 UIKit 0x18bd8f1b4 -[UITableView _updateContentSize] + 220
12 UIKit 0x18bfed6f0 -[UITableView _rebuildGeometry] + 44
13 UIKit 0x18bd94b64 -[UITableView didMoveToWindow] + 140
14 UIKit 0x18bcadc1c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1544
15 UIKit 0x18bcd1714 -[UIScrollView _didMoveFromWindow:toWindow:] + 92
16 UIKit 0x18bcacd90 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 156
17 UIKit 0x18bcacbe8 -[UIView(Hierarchy) _postMovedFromSuperview:] + 792
18 UIKit 0x18bcb8ad0 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1788
19 UIKit 0x18bcb83bc -[UIView(Hierarchy) addSubview:] + 828
20 TM iSwift 0x100152428 __34-[KossexViewController createBody]_block_invoke (KossexViewController.m:397)
21 libdispatch.dylib 0x184cf1200 _dispatch_call_block_and_release + 24
22 libdispatch.dylib 0x184cf11c0 _dispatch_client_callout + 16
23 libdispatch.dylib 0x184cf5d6c _dispatch_main_queue_callback_4CF + 1000
24 CoreFoundation 0x185e15f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
25 CoreFoundation 0x185e13b18 __CFRunLoopRun + 1660
26 CoreFoundation 0x185d42048 CFRunLoopRunSpecific + 444
27 GraphicsServices 0x1877c5198 GSEventRunModal + 180
28 UIKit 0x18bd1c628 -[UIApplication _run] + 684
29 UIKit 0x18bd17360 UIApplicationMain + 208
30 TM iSwift 0x1001384c0 main (main.m:18)
31 libdyld.dylib 0x184d245b8 start + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000184e36014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000184efd460 pthread_kill + 112
2 libsystem_c.dylib 0x0000000184daa3f4 abort + 140
3 libc++abi.dylib 0x00000001848752d4 __cxa_bad_cast + 0
4 libc++abi.dylib 0x0000000184892cc0 default_unexpected_handler() + 0
5 libobjc.A.dylib 0x00000001848a0844 _objc_terminate() + 124
6 libc++abi.dylib 0x000000018488f66c std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x000000018488ef84 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8 libobjc.A.dylib 0x00000001848a0690 _objc_exception_destructor(void*) + 0
9 CoreFoundation 0x0000000185e68108 -[NSException initWithCoder:] + 0
10 Foundation 0x00000001868565ac -[NSString rangeOfString:options:range:locale:] + 352
11 Foundation 0x0000000186949f5c -[NSString containsString:] + 68
12 TM iSwift 0x0000000100157528 -[KossexViewController tableView:heightForHeaderInSection:] (KossexViewController.m:1373)
13 UIKit 0x000000018bd90b20 -[UITableView _delegateWantsHeaderForSection:] + 528
14 UIKit 0x000000018bd8f7b0 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 208
15 UIKit 0x000000018c180b7c -[UITableViewRowData _ensureSectionOffsetIsValidForSection:] + 348
16 UIKit 0x000000018bd8f61c -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 576
17 UIKit 0x000000018bd8f380 -[UITableViewRowData heightForTable] + 60
18 UIKit 0x000000018bd8f1b4 -[UITableView _updateContentSize] + 220
19 UIKit 0x000000018bfed6f0 -[UITableView _rebuildGeometry] + 44
20 UIKit 0x000000018bd94b64 -[UITableView didMoveToWindow] + 140
21 UIKit 0x000000018bcadc1c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1544
22 UIKit 0x000000018bcd1714 -[UIScrollView _didMoveFromWindow:toWindow:] + 92
23 UIKit 0x000000018bcacd90 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 156
24 UIKit 0x000000018bcacbe8 -[UIView(Hierarchy) _postMovedFromSuperview:] + 792
25 UIKit 0x000000018bcb8ad0 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1788
26 UIKit 0x000000018bcb83bc -[UIView(Hierarchy) addSubview:] + 828
27 TM iSwift 0x0000000100152428 __34-[KossexViewController createBody]_block_invoke (KossexViewController.m:397)
28 libdispatch.dylib 0x0000000184cf1200 _dispatch_call_block_and_release + 24
29 libdispatch.dylib 0x0000000184cf11c0 _dispatch_client_callout + 16
30 libdispatch.dylib 0x0000000184cf5d6c _dispatch_main_queue_callback_4CF + 1000
31 CoreFoundation 0x0000000185e15f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
32 CoreFoundation 0x0000000185e13b18 __CFRunLoopRun + 1660
33 CoreFoundation 0x0000000185d42048 CFRunLoopRunSpecific + 444
34 GraphicsServices 0x00000001877c5198 GSEventRunModal + 180
35 UIKit 0x000000018bd1c628 -[UIApplication _run] + 684
36 UIKit 0x000000018bd17360 UIApplicationMain + 208
37 TM iSwift 0x00000001001384c0 main (main.m:18)
38 libdyld.dylib 0x0000000184d245b8 start + 4
please see on these lines
(i) [KossexViewController tableView:heightForHeaderInSection:] (KossexViewController.m:1373
(ii) [KossexViewController createBody]_block_invoke (KossexViewController.m:397
if everythink is perfect then edit your scheme from debug to release mode.

App crashes at gpus_ReturnNotPermittedKillClient

I am seeing new crashes specific to app running on iOS 8. Couldn't figure out what the issue is, couldn't reproduce the issue. Happens at App StartUp, and App doesn't call OpenGL ES functions directly.
InitialViewController viewDidAppear method line # 92 I initiate a segue from storyboard by: [self performSegueWithIdentifier:segueIdentifier sender:self]; where self is InitialViewController class.
Stacktrace:
Thread: Unknown Name (Crashed)
0 libGPUSupportMercury.dylib 0x28c5c8fe gpus_ReturnNotPermittedKillClient + 10
1 libGPUSupportMercury.dylib 0x28c5d249 gldCreateContext + 206
2 GLEngine 0x248a093b gliCreateContextWithShared + 600
3 OpenGLES 0x2497cab3 -[EAGLContext initWithAPI:properties:] + 404
4 CoreImage 0x225ecb8b ___ZN2CI11can_use_gpuEv_block_invoke + 140
5 libdispatch.dylib 0x2fbb98b7 _dispatch_client_callout + 20
6 libdispatch.dylib 0x2fbba4fb dispatch_once_f + 60
7 CoreImage 0x225ecafb _ZN2CI11can_use_gpuEv + 96
8 CoreImage 0x2256ac79 +[CIContext contextWithOptions:] + 186
9 CoreUI 0x27bdc837 CreateSharedCIContext + 76
10 libsystem_pthread.dylib 0x2fd1ddcf __pthread_once_handler + 48
11 libsystem_platform.dylib 0x2fd16867 _os_once + 40
12 libsystem_pthread.dylib 0x2fd1bf8b pthread_once + 48
13 CoreUI 0x27bdc7d9 +[CUIShapeEffectStack sharedCIContext] + 26
14 CoreUI 0x27be3af7 -[CUICatalog imageByStylingImage:stylePresetName:styleConfiguration:foregroundColor:scale:] + 80
15 UIKit 0x256c89db -[UIImage _imageWithStylePresets:withTintColor:] + 540
16 UIKit 0x25456875 -[UIImageView _setImageViewContents:] + 1074
17 UIKit 0x25455fb5 +[UIView(Animation) performWithoutAnimation:] + 70
18 UIKit 0x25747db9 -[UIImageView _updateImageViewForOldImage:newImage:] + 674
19 UIKit 0x254559c7 -[UIImageView setImage:] + 264
20 UIKit 0x254f01b1 -[UINavigationBar _updateBackIndicatorImage] + 346
21 UIKit 0x254d4143 -[UINavigationBar layoutSubviews] + 2480
22 UIKit 0x25446b37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 512
23 QuartzCore 0x24e6eccd -[CALayer layoutSublayers] + 134
24 QuartzCore 0x24e6a6b5 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 358
25 UIKit 0x25459183 -[UIView(Hierarchy) layoutBelowIfNeeded] + 136
26 UIKit 0x25455fb5 +[UIView(Animation) performWithoutAnimation:] + 70
27 UIKit 0x254d2fc5 -[UINavigationController _positionNavigationBarHidden:edge:initialOffset:] + 786
28 UIKit 0x254d2c63 -[UINavigationController _positionNavigationBarHidden:edge:] + 200
29 UIKit 0x254cf875 -[UINavigationController loadView] + 246
30 UIKit 0x254493d9 -[UIViewController loadViewIfRequired] + 66
31 UIKit 0x2544935d -[UIViewController view] + 22
32 UIKit 0x254f1faf -[UIViewController shouldAutorotate] + 24
33 UIKit 0x2552bbd7 -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:] + 248
34 UIKit 0x2552a2b9 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:] + 2118
35 UIKit 0x2572be1f -[UIViewController _windowControllerBasedPresentViewController:withTransition:completion:] + 4896
36 UIKit 0x2572c4ab __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 256
37 UIKit 0x25529243 -[UIViewController presentViewController:animated:completion:] + 192
38 UIKit 0x2572c63f -[UIViewController presentModalViewController:animated:] + 28
39 MyAppName 0x00082901 -[InitialViewController viewDidAppear:] (InitialViewController.m:92)
40 UIKit 0x2545ed5f -[UIViewController _setViewAppearState:isAnimating:] + 500
41 UIKit 0x254c322f -[UIViewController _executeAfterAppearanceBlock] + 52
42 UIKit 0x254c31bd _applyBlockToCFArrayCopiedToStack + 306
43 UIKit 0x2543f127 _afterCACommitHandler + 484
44 CoreFoundation 0x21f725cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
45 CoreFoundation 0x21f6fc8b __CFRunLoopDoObservers + 276
46 CoreFoundation 0x21f70093 __CFRunLoopRun + 912
47 CoreFoundation 0x21ebe621 CFRunLoopRunSpecific + 474
48 CoreFoundation 0x21ebe433 CFRunLoopRunInMode + 104
49 GraphicsServices 0x2926c0a9 GSEventRunModal + 134
50 UIKit 0x254a8809 UIApplicationMain + 1438
51 MyAppName 0x00074329 main (main.m:36)
52 libdyld.dylib 0x2fbd9aaf start + 0
Can someone please help me find what the root cause for this issue is.
Application will be terminated if it attempts to execute OpenGL ES commands in the background.
https://developer.apple.com/library/ios/qa/qa1766/_index.html

Random crash on setting UITabBarButton label attributed text (Tab Title)

I am not able to reproduce this crash but received this kind of crashes multiple times from production build. In my app tab bar is loaded from storyboard only and tab bar is always hidden all the time.
Does it's main cause is low memory? Any guess, how to solve or reproduce this kind of problems
Hardware Model: iPad2,4
OS Version: iPhone OS 7.0.4 (11B554a)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x393f71fc
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray replaceObjectsInRange:withObject:length:: Out of bounds'
Last Exception Backtrace:
0 CoreFoundation 0x2e766f4b __exceptionPreprocess + 131
1 libobjc.A.dylib 0x38e386af objc_exception_throw + 38
2 CoreFoundation 0x2e766e8d +[NSException raise:format:] + 104
3 Foundation 0x2f089aff -[NSMutableRLEArray replaceObjectsInRange:withObject:length:] + 122
4 Foundation 0x2f088efb -[NSConcreteMutableAttributedString initWithString:attributes:] + 310
5 UIKit 0x30ee8ed7 -[NSAttributedString(UILabelAdditions) _ui_synthesizeAttributedSubstringFromRange:usingDefaultAttributes:] + 86
6 UIKit 0x30ee8c9f -[UILabel _synthesizedAttributedText] + 1010
7 UIKit 0x30ee8307 -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 222
8 UIKit 0x30ee8213 -[UILabel textRectForBounds:limitedToNumberOfLines:] + 54
9 UIKit 0x30ee80fb -[UILabel _intrinsicSizeWithinSize:] + 162
10 UIKit 0x30ee8049 -[UILabel sizeThatFits:] + 32
11 UIKit 0x30ee7f37 -[UIView(Geometry) sizeToFit] + 126
12 UIKit 0x31002be1 -[UITabBarButton initWithImage:selectedImage:label:withInsets:] + 388
13 UIKit 0x31001a1f -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 1170
14 UIKit 0x31001583 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 38
15 UIKit 0x30ffd859 -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 160
16 UIKit 0x31004c43 -[UITabBar(Static) _configureItems:] + 406
17 UIKit 0x310042db -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1234
18 UIKit 0x3100133f -[UITabBar setItems:animated:] + 1358
19 UIKit 0x31000d29 -[UITabBarController _rebuildTabBarItemsAnimated:] + 800
20 UIKit 0x310051f9 -[UITabBarController _setSelectedViewController:] + 76
21 UIKit 0x30eeb6e5 +[UIView(Animation) performWithoutAnimation:] + 72
22 UIKit 0x31008bf7 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 218
23 UIKit 0x31008077 -[UITabBarController viewWillAppear:] + 134
24 UIKit 0x30ef40eb -[UIViewController _setViewAppearState:isAnimating:] + 346
25 CoreFoundation 0x2e6aff65 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 52
26 CoreFoundation 0x2e6a994d -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 220
27 UIKit 0x30ef4265 -[UIViewController _setViewAppearState:isAnimating:] + 724
28 UIKit 0x3106a4bf -[UINavigationController _startCustomTransition:] + 846
29 UIKit 0x30f88273 -[UINavigationController _startDeferredTransitionIfNeeded:] + 418
30 UIKit 0x30f8807d -[UINavigationController __viewWillLayoutSubviews] + 44
31 UIKit 0x30f88015 -[UILayoutContainerView layoutSubviews] + 184
32 UIKit 0x30ed9da3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 346
33 QuartzCore 0x30b60c6b -[CALayer layoutSublayers] + 142
34 QuartzCore 0x30b5c47b CA::Layer::layout_if_needed(CA::Transaction*) + 350
35 QuartzCore 0x30b5c30d CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
36 QuartzCore 0x30b5bd1f CA::Context::commit_transaction(CA::Transaction*) + 230
37 QuartzCore 0x30b5bb2f CA::Transaction::commit() + 314
38 QuartzCore 0x30b5585d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
39 CoreFoundation 0x2e7321cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
40 CoreFoundation 0x2e72fb71 __CFRunLoopDoObservers + 284
41 CoreFoundation 0x2e72feb3 __CFRunLoopRun + 730
42 CoreFoundation 0x2e69ac27 CFRunLoopRunSpecific + 522
43 CoreFoundation 0x2e69aa0b CFRunLoopRunInMode + 106
44 GraphicsServices 0x3336e283 GSEventRunModal + 138
45 UIKit 0x30f3e049 UIApplicationMain + 1136
46 MyApp main (in MyApp) (main.m:16)
47 libdyld.dylib 0x39340ab7 start + 2
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x393f71fc __pthread_kill + 8
1 libsystem_c.dylib 0x393a7ffd abort + 77
2 MyApp uncaught_exception_handler (in MyApp) + 27
3 CoreFoundation 0x2e76724f __handleUncaughtException + 579
4 libobjc.A.dylib 0x38e3890f _objc_terminate() + 175
5 libc++abi.dylib 0x386ed1c7 std::__terminate(void (*)()) + 79
6 libc++abi.dylib 0x386ecd2d __cxa_increment_exception_refcount + 1
7 libobjc.A.dylib 0x38e387f7 objc_exception_rethrow + 43
8 CoreFoundation 0x2e69ac9d CFRunLoopRunSpecific + 641
9 CoreFoundation 0x2e69aa0b CFRunLoopRunInMode + 106
10 GraphicsServices 0x3336e283 GSEventRunModal + 138
11 UIKit 0x30f3e049 UIApplicationMain + 1136
12 MyApp main (in MyApp) (main.m:16)
From you crash log, line 5
5 UIKit 0x30ee8ed7 -[NSAttributedString(UILabelAdditions) _ui_synthesizeAttributedSubstringFromRange:usingDefaultAttributes:] + 86
seems like you generate your attribute string based on
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)aRange
Maybe set a break point at that code, and check if your string length is larger than or equal to the range.

Unable to find root cause of random crash on tabbar

I have a side panel view (like side drawer) in my iPad app which contains tabbar having 2 tabs. This view is beyond the ipad visible screen and become visible once we pull it from left side. This get initialize always on app launch. It crashes randomly on iOS 7.0.3 and 7.0.4 mostly on iPad 4 models. I can't reproduce it in debug mode while debugger is attached and reproducing frequency is 1% or less on release build.
It will not an iOS issue but any guess or anybody faced and solved similar problem?
Crash report:
Hardware Model: iPad3,4
Code Type: ARM (Native)
OS Version: iOS 7.0.4 (11B554a)
Crash report:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 12
Thread 0:
0 libsystem_kernel.dylib 0x38d7ebb4 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x38df349c _os_lock_handoff_lock_slow + 48
2 libsystem_malloc.dylib 0x38db90f8 szone_free_definite_size + 328
3 libRIP.A.dylib 0x2e4ffb72 ripc_ReleaseClipState + 34
4 libRIP.A.dylib 0x2e503438 ripc_EndLayer + 80
5 CoreGraphics 0x2e1c25e8 CGContextEndTransparencyLayer + 36
6 UIKit 0x309e4d2a -[UIImage(TabBarItemImages) _tabBarItemImageWithTintColor:selected:metrics:style:forScreenScale:] + 902
7 UIKit 0x309e5070 -[UIImage(TabBarItemImages) _unselectedTabBarItemImageWithTintColor:metrics:style:forScreenScale:] + 36
8 UIKit 0x309e4748 -[UITabBarItem(Static) _updateImageWithTintColor:isSelected:getImageOffset:] + 552
9 UIKit 0x309e414c -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 956
10 UIKit 0x309e3d82 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 34
11 UIKit 0x309e0028 -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 156
12 UIKit 0x309e74ca -[UITabBar(Static) _configureItems:] + 402
13 UIKit 0x309e6b7e -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1270
14 UIKit 0x309e3b38 -[UITabBar setItems:animated:] + 1352
15 UIKit 0x309e3522 -[UITabBarController _rebuildTabBarItemsAnimated:] + 798
16 UIKit 0x309e7a74 -[UITabBarController _setSelectedViewController:] + 72
17 UIKit 0x308cdcf2 +[UIView(Animation) performWithoutAnimation:] + 70
18 UIKit 0x309eb470 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 216
19 UIKit 0x309ea8e6 -[UITabBarController viewWillAppear:] + 130
20 UIKit 0x308d66fa -[UIViewController _setViewAppearState:isAnimating:] + 342
21 CoreFoundation 0x2e080800 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 48
22 CoreFoundation 0x2e07a21a -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 218
23 UIKit 0x308d6876 -[UIViewController _setViewAppearState:isAnimating:] + 722
24 UIKit 0x30a4ccfa -[UINavigationController _startCustomTransition:] + 842
25 UIKit 0x3096aa12 -[UINavigationController _startDeferredTransitionIfNeeded:] + 414
26 UIKit 0x3096a81c -[UINavigationController __viewWillLayoutSubviews] + 40
27 UIKit 0x3096a7b4 -[UILayoutContainerView layoutSubviews] + 180
28 UIKit 0x308bc34e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 342
29 QuartzCore 0x3054293e -[CALayer layoutSublayers] + 138
30 QuartzCore 0x3053e162 CA::Layer::layout_if_needed(CA::Transaction*) + 346
31 QuartzCore 0x3053dff4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
32 QuartzCore 0x3053da08 CA::Context::commit_transaction(CA::Transaction*) + 224
33 QuartzCore 0x3053d81a CA::Transaction::commit() + 310
34 QuartzCore 0x30537548 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
35 CoreFoundation 0x2e102f66 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
36 CoreFoundation 0x2e1008f2 __CFRunLoopDoObservers + 282
37 CoreFoundation 0x2e100c3e __CFRunLoopRun + 734
38 CoreFoundation 0x2e06b46c CFRunLoopRunSpecific + 520
39 CoreFoundation 0x2e06b24e CFRunLoopRunInMode + 102
40 GraphicsServices 0x32d722e6 GSEventRunModal + 134
41 UIKit 0x30920840 UIApplicationMain + 1132
42 MyApp 0x0006b5f2 0x64000 + 30194
43 libdyld.dylib 0x38cdaab4 start + 0
Thread 12 Crashed:
0 libsystem_kernel.dylib 0x38d911fc __pthread_kill + 8
1 libsystem_pthread.dylib 0x38df8a4e pthread_kill + 54
2 libsystem_c.dylib 0x38d42082 __abort + 74
3 libsystem_c.dylib 0x38d42034 abort + 84
4 libsystem_malloc.dylib 0x38dbf758 szone_error + 312
5 libsystem_malloc.dylib 0x38dbf9d4 free_list_checksum_botch + 24
6 libsystem_malloc.dylib 0x38dba1a4 tiny_free_list_remove_ptr + 76
7 libsystem_malloc.dylib 0x38db9770 szone_free_definite_size + 1984
8 libsystem_blocks.dylib 0x38cf7ac2 _Block_release + 214
9 libdispatch.dylib 0x38ccae76 _dispatch_queue_drain + 370
10 libdispatch.dylib 0x38cc7f8e _dispatch_queue_invoke + 38
11 libdispatch.dylib 0x38ccb742 _dispatch_root_queue_drain + 74
12 libdispatch.dylib 0x38ccb9c0 _dispatch_worker_thread2 + 52
13 libsystem_pthread.dylib 0x38df5dfc _pthread_wqthread + 296
14 libsystem_pthread.dylib 0x38df5cc0 start_wqthread + 4
Another random crash in similar case:
Thread 0 Crashed:
0 CoreFoundation 0x311e9728 -[__NSDictionaryM objectForKey:] + 100
1 UIKit 0x33a3e855 -[UILabel _setFont:] + 209
2 UIKit 0x33b5a411 -[UITabBarButton initWithImage:selectedImage:label:withInsets:] + 293
3 UIKit 0x33b59223 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:withTint:idiom:] + 1171
4 UIKit 0x33b58d87 -[UITabBarItem(Static) _createViewForTabBar:showingBadge:idiom:] + 39
5 UIKit 0x33b5502d -[UITabBarItem(Static) _updateViewForIdiom:positionItems:] + 161
6 UIKit 0x33b5c4cf -[UITabBar(Static) _configureItems:] + 407
7 UIKit 0x33b5bb83 -[UITabBar(Static) _positionTabBarButtons:ignoringItem:] + 1275
8 UIKit 0x33b58b3d -[UITabBar setItems:animated:] + 1357
9 UIKit 0x33b58527 -[UITabBarController _rebuildTabBarItemsAnimated:] + 803
10 UIKit 0x33b5ca79 -[UITabBarController _setSelectedViewController:] + 77
11 UIKit 0x33a42cf5 +[UIView(Animation) performWithoutAnimation:] + 73
12 UIKit 0x33b60475 -[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 221
13 UIKit 0x33b5f8eb -[UITabBarController viewWillAppear:] + 135
14 UIKit 0x33a4b6ff -[UIViewController _setViewAppearState:isAnimating:] + 347
15 CoreFoundation 0x311f5803 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 51
16 CoreFoundation 0x311ef21d -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 221
17 UIKit 0x33a4b87b -[UIViewController _setViewAppearState:isAnimating:] + 727
18 UIKit 0x33bc1cff -[UINavigationController _startCustomTransition:] + 847
19 UIKit 0x33adfa17 -[UINavigationController _startDeferredTransitionIfNeeded:] + 419
20 UIKit 0x33adf821 -[UINavigationController __viewWillLayoutSubviews] + 45
21 UIKit 0x33adf7b9 -[UILayoutContainerView layoutSubviews] + 185
22 UIKit 0x33a31353 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 347
23 QuartzCore 0x336b7943 -[CALayer layoutSublayers] + 143
24 QuartzCore 0x336b3167 CA::Layer::layout_if_needed(CA::Transaction*) + 351
25 QuartzCore 0x336b2ff9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 17
26 QuartzCore 0x336b2a0d CA::Context::commit_transaction(CA::Transaction*) + 229
27 QuartzCore 0x336b281f CA::Transaction::commit() + 315
28 QuartzCore 0x336ac54d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 57
29 CoreFoundation 0x31277f69 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
30 CoreFoundation 0x312758f7 __CFRunLoopDoObservers + 287
31 CoreFoundation 0x31275c43 __CFRunLoopRun + 739
32 CoreFoundation 0x311e0471 CFRunLoopRunSpecific + 525
33 CoreFoundation 0x311e0253 CFRunLoopRunInMode + 107
34 GraphicsServices 0x35ee12eb GSEventRunModal + 139
35 UIKit 0x33a95845 UIApplicationMain + 1137
36 SofTestM 0x000545f7 0x4d000 + 30199
The second crash is at time of setting font at
UITabBar-->UITabBarButton->UILabel (of UITabBarButton) _setFont:
I feel this random crashes might be due to memory leaks in your application.Pardon me if i am wrong.
In your logs it is seen that you use CoreGraphics.Releasing Core Graphics( even if you have ARC) is a bit tricky as it is not 100% memory leaf proof .That is it at times takes a while to get released.
So suppose you are using core graphic objects whithin a loop then it is certain that your ipad memory will go out of bounds.

Resources