Crash when contentOffset is being updated - ios

let bottomOffset = bottomView.contentOffset.y
let currentOffset = overlayScrollView?.contentOffset.y ?? CGFloat(0)
let totalOffset = (bottomOffset + currentOffset) > 0 ? (bottomOffset + currentOffset) : 0
bottomView.contentOffset.y = 0
overlayScrollView?.contentOffset.y = totalOffset
I am facing several crashes of type EXC_BAD_ACCESS KERN_PROTECTION_FAILURE in app on this line
overlayScrollView?.contentOffset.y = totalOffset
Initially, I thought this is happening because KVO is not being handled properly, that might be message is being sent to deallocated object and observer is not removed.
Moved to new KVO keyPathBased APIs which removed overhead of removing observer. But still this issue is happening. This issue is not reproducible at all on my end.
0 QuartzCore 0x1a42bb938 CA::Layer::writable_state(CA::Transaction*) + 490
1 QuartzCore 0x1a42bba74 CA::Layer::end_change(CA::Transaction*, unsigned int, objc_object*, objc_object*) + 32
2 QuartzCore 0x1a42c4a04 CA::Layer::set_position(CA::Vec2<double> const&, bool) + 312
3 QuartzCore 0x1a42b2dbc -[CALayer setPosition:] + 48
4 QuartzCore 0x1a42b3450 -[CALayer setFrame:] + 424
5 UIKitCore 0x1a3e28df0 -[UIView(Geometry) setFrame:] + 472
6 UIKitCore 0x1a3dcf4b4 -[UIScrollView _layoutHorizontalScrollIndicatorWithBounds:effectiveInset:contentOffset:fraction:additionalInset:cornerAdjust:showing:recalcSize:verticalIndicatorFrame:] + 1320
7 UIKitCore 0x1a3dce89c -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 1288
8 UIKitCore 0x1a3dbabfc -[UIScrollView setContentOffset:] + 1208
9 UIKitCore 0x1a3b46ed4 -[UITableView setContentOffset:] + 284
10 Foundation 0x1a236dbd8 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 560
11 Foundation 0x1a22b2600 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 68
12 Foundation 0x1a2369614 _NSSetPointValueAndNotify + 300
13 App 0x10488393c partial apply for closure #2 in PageBaseViewController.updatePanView(view:index:) + 540 (PageBaseViewController.swift:540)
14 App 0x1048822d8 partial apply for thunk for #escaping #callee_guaranteed (#guaranteed ZScrollView, #in_guaranteed NSKeyValueObservedChange<CGPoint>) -> () + 4369375960 (<compiler-generated>:4369375960)
15 libswiftFoundation.dylib 0x1a48d6a50 closure #1 in _KeyValueCodingAndObserving.observe<A>(_:options:changeHandler:) + 320
16 libswiftFoundation.dylib 0x1a48d9cc4 specialized NSKeyValueObservation.Helper._swizzle_me_observeValue(forKeyPath:of:change:context:) + 1268
17 libswiftFoundation.dylib 0x1a48d6494 #objc NSKeyValueObservation.Helper._swizzle_me_observeValue(forKeyPath:of:change:context:) + 192
18 Foundation 0x1a236bd70 NSKeyValueNotifyObserver + 288
19 Foundation 0x1a236e188 NSKeyValueDidChange + 324
20 Foundation 0x1a236dc14 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 620
21 Foundation 0x1a22b2600 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 68
22 Foundation 0x1a2369614 _NSSetPointValueAndNotify + 300
23 UIKitCore 0x1a3b386b0 -[UITableView _restoreOrAdjustContentOffsetWithRowCount:initialContentInsetTop:] + 352
24 UIKitCore 0x1a3b27a50 -[UITableView _updateVisibleCellsNow:] + 3552
25 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
26 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
27 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
28 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
29 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
30 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
31 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
32 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
33 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
34 UIKitCore 0x1a3b27a78 -[UITableView _updateVisibleCellsNow:] + 3592
35 UIKitCore 0x1a3b44938 -[UITableView layoutSubviews] + 356
36 UIKitCore 0x1a3e44910 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2544
37 QuartzCore 0x1a42b96dc -[CALayer layoutSublayers] + 288
38 QuartzCore 0x1a42bfe64 CA::Layer::layout_if_needed(CA::Transaction*) + 544
39 QuartzCore 0x1a42cb424 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140
40 QuartzCore 0x1a4213c20 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 500
41 QuartzCore 0x1a423e970 CA::Transaction::commit() + 668
42 UIKitCore 0x1a39752c0 _afterCACommitHandler + 140
43 CoreFoundation 0x1a102d418 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
44 CoreFoundation 0x1a1027a48 __CFRunLoopDoObservers + 588
45 CoreFoundation 0x1a1027fe4 __CFRunLoopRun + 1012
46 CoreFoundation 0x1a10276a8 CFRunLoopRunSpecific + 572
47 GraphicsServices 0x1b76d7570 GSEventRunModal + 160
48 UIKitCore 0x1a3945370 -[UIApplication _run] + 1052
49 UIKitCore 0x1a394a8ec UIApplicationMain + 164
50 App 0x10460b944 main + 15 (main.m:15)
51 libdyld.dylib 0x1a0d06140 start + 4

Related

-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256

Over the last week, I've noticed a lot of -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256 crashes on iPhone 14 Pro devices running iOS 16.1.1.
The tableView where this problem originates has a constant number of rows and sections, so the datasource is never modified.
The crashes are also being reported to Crashlytics and Sentry, but never make it into the Apple Organizer.
Any idea what's going on? How can I resolve this issue?
Crashed: com.apple.main-thread
0 App 0x90e74 SettingsViewController.tableView(_:cellForRowAt:) + 4374285940 (SettingsViewController.swift:4374285940)
1 App 0x91210 #objc SettingsViewController.tableView(_:cellForRowAt:) + 4374286864 (<compiler-generated>:4374286864)
2 UIKitCore 0x14beec -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1256
3 UIKitCore 0x11f844 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 596
4 UIKitCore 0x59350 -[UITableView _updateVisibleCellsNow:] + 1088
5 UIKitCore 0x58e44 -[UITableView layoutSubviews] + 148
6 UIKitCore 0x5020 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980
7 QuartzCore 0x99ec CA::Layer::layout_if_needed(CA::Transaction*) + 500
8 UIKitCore 0xd21dc -[UIView(Hierarchy) layoutBelowIfNeeded] + 292
9 UIKitCore 0x3dc0c -[UINavigationController _layoutViewController:] + 816
10 UIKitCore 0x3d8d8 -[UINavigationController _layoutTopViewControllerLookForNested:] + 436
11 UIKitCore 0x1506dc -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 892
12 UIKitCore 0x150324 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 296
13 UIKitCore 0x14f8e4 -[UINavigationTransitionView _cleanupTransition] + 536
14 UIKitCore 0x14f634 +[UIView(UIViewAnimationWithBlocks) conditionallyAnimate:withAnimation:layout:completion:] + 136
15 UIKitCore 0x1a8c0c -[UINavigationTransitionView transition:fromView:toView:] + 1612
16 UIKitCore 0x1a8270 -[UINavigationController _startTransition:fromViewController:toViewController:] + 2104
17 UIKitCore 0x1a6fb4 -[UINavigationController _startDeferredTransitionIfNeeded:] + 608
18 UIKitCore 0x1a6604 -[UINavigationController __viewWillLayoutSubviews] + 96
19 UIKitCore 0x1a6568 -[UILayoutContainerView layoutSubviews] + 172
20 UIKitCore 0x5020 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980
21 QuartzCore 0x99ec CA::Layer::layout_if_needed(CA::Transaction*) + 500
22 QuartzCore 0x1d0a0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148
23 QuartzCore 0x2e5b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456
24 QuartzCore 0x635ec CA::Transaction::commit() + 652
25 QuartzCore 0x4c8cc CA::Transaction::flush_as_runloop_observer(bool) + 88
26 UIKitCore 0x504b44 _UIApplicationFlushCATransaction + 52
27 UIKitCore 0x652740 _UIUpdateSequenceRun + 84
28 UIKitCore 0xc99fd0 schedulerStepScheduledMainSection + 172
29 UIKitCore 0xc9919c runloopSourceCallback + 92
30 CoreFoundation 0xd5f54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
31 CoreFoundation 0xe232c __CFRunLoopDoSource0 + 176
32 CoreFoundation 0x66210 __CFRunLoopDoSources0 + 244
33 CoreFoundation 0x7bba8 __CFRunLoopRun + 836
34 CoreFoundation 0x80ed4 CFRunLoopRunSpecific + 612
35 GraphicsServices 0x1368 GSEventRunModal + 164
36 UIKitCore 0x3a23d0 -[UIApplication _run] + 888
37 UIKitCore 0x3a2034 UIApplicationMain + 340
38 App 0x8020 main + 41 (AppDelegate.swift:41)
39 ??? 0x1aa7e0960 (Missing)
I discovered that there was a forced unwrapping deep inside my codebase. I would encourage you to search for any forced unwrapping.

App Crashes when reloadData() gets called in a custom SelfSizedTableView

I’m having a crash happens when reloadData() gets called in a custom SelfSizedTableView ,
any idea why? and how to resolve it?
SelfSizedTableView:
import UIKit
open class SelfSizedTableView: UITableView {
open override func reloadData() {
super.reloadData()
self.invalidateIntrinsicContentSize()
self.layoutIfNeeded()
}
open override var intrinsicContentSize: CGSize {
setNeedsLayout()
layoutIfNeeded()
return CGSize(
width: contentSize.width,
height: contentSize.height
)
}
}
Stacktrace:
Crashed: com.apple.main-thread
0 CoreAutoLayout 0x17d38 object_table_insert_and_return_old_value_if_replaced + 96
1 CoreAutoLayout 0x8324 NSISObjectTableInsert + 72
2 CoreAutoLayout 0x80b0 -[NSISEngine startObservingChangesForVariable:] + 76
3 UIKitCore 0x373e2c _UILayoutItemSetUpVariableObservation + 144
4 UIKitCore 0x2aae18 _UILayoutItemCreateAndObserveVariableWithValueRestriction + 104
5 UIKitCore 0x518fc4 -[UIView nsli_boundsWidthVariable] + 48
6 UIKitCore 0x34b7e8 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:onBehalfOfLayoutGuide:] + 2860
7 UIKitCore 0x566e50 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:] + 316
8 CoreAutoLayout 0xbb50 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 76
9 CoreAutoLayout 0xdee8 -[NSLayoutConstraint _addToEngine:mutuallyExclusiveConstraints:] + 136
10 UIKitCore 0x1cd270 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 368
11 CoreAutoLayout 0x7bac -[NSISEngine withBehaviors:performModifications:] + 80
12 UIKitCore 0x1badd0 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 528
13 UIKitCore 0x3980f4 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 188
14 UIKitCore 0x1cd1b8 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 184
15 CoreAutoLayout 0x7bac -[NSISEngine withBehaviors:performModifications:] + 80
16 UIKitCore 0x1badd0 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 528
17 UIKitCore 0x3980f4 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 188
18 UIKitCore 0x1cd1b8 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 184
19 CoreAutoLayout 0x7bac -[NSISEngine withBehaviors:performModifications:] + 80
20 UIKitCore 0x1badd0 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 528
21 UIKitCore 0x3980f4 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 188
22 UIKitCore 0x45ae68 -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 208
23 UIKitCore 0x1da868 -[UIView _layoutEngine_windowDidChange] + 120
24 UIKitCore 0x29ebbc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 276
25 UIKitCore 0x29ee48 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 928
26 UIKitCore 0x1cb998 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 136
27 CoreAutoLayout 0x7bac -[NSISEngine withBehaviors:performModifications:] + 80
28 UIKitCore 0x2576e4 -[UIView(Hierarchy) _postMovedFromSuperview:] + 780
29 UIKitCore 0x179ca4 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2148
30 UIKitCore 0x38ec30 -[UITableView _addSubview:positioned:relativeTo:] + 104
31 UIKitCore 0x168d68 -[UIScrollView _addContentSubview:atBack:] + 376
32 UIKitCore 0x18d4e8 -[UITableView _addContentSubview:atBack:] + 248
33 UIKitCore 0x189e70 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 1744
34 UIKitCore 0x1632d0 +[UIView(Animation) performWithoutAnimation:] + 96
35 UIKitCore 0x3f4664 -[UITableView _configureCellForDisplay:forIndexPath:] + 244
36 UIKitCore 0x27010c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1916
37 UIKitCore 0x45a858 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 700
38 UIKitCore 0x293f04 -[UITableView _updateVisibleCellsNow:] + 1464
39 UIKitCore 0x16c484 -[UITableView layoutSubviews] + 436
40 UIKitCore 0x17c1d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2556
41 QuartzCore 0x3d520 CA::Layer::layout_if_needed(CA::Transaction*) + 528
42 UIKitCore 0x1dd8b0 -[UIView(Hierarchy) layoutBelowIfNeeded] + 556
43 Drops 0x78e68 SelfSizedTableView.reloadData() + 15 (SelfSizedTableView.swift:15)
44 Drops 0x78eb8 #objc SelfSizedTableView.reloadData() + 4365668024 (<compiler-generated>:4365668024)
45 UIKitCore 0x16c300 -[UITableView layoutSubviews] + 48
46 UIKitCore 0x17c1d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2556
47 QuartzCore 0x3d520 CA::Layer::layout_if_needed(CA::Transaction*) + 528
48 UIKitCore 0x1dd8b0 -[UIView(Hierarchy) layoutBelowIfNeeded] + 556
49 Drops 0x78f6c SelfSizedTableView.intrinsicContentSize.getter + 19 (SelfSizedTableView.swift:19)
50 Drops 0x78ef4 #objc SelfSizedTableView.intrinsicContentSize.getter + 4365668084 (<compiler-generated>:4365668084)
51 UIKitCore 0x19cae8 -[UIView _generateContentSizeConstraints] + 56
52 UIKitCore 0x24beac -[UIView _updateContentSizeConstraints] + 268
53 UIKitCore 0x2f6440 -[UIView(AdditionalLayoutSupport) _updateSystemConstraints] + 124
54 UIKitCore 0x35aaac -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 480
55 UIKitCore 0x17f5a0 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 996
56 UIKitCore 0x17f480 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 708
57 UIKitCore 0x17f480 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 708
58 CoreAutoLayout 0x7bac -[NSISEngine withBehaviors:performModifications:] + 80
59 UIKitCore 0x4f6720 -[UIView(AdditionalLayoutSupport) _recursiveUpdateConstraintsIfNeededCollectingViews:forSecondPass:] + 120
60 UIKitCore 0x17f480 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 708
61 UIKitCore 0x1e494c __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 84
62 UIKitCore 0x25c954 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 160
63 UIKitCore 0x314fd8 -[UIView(AdditionalLayoutSupport) _systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:hasIntentionallyCollapsedHeight:] + 224
64 UIKitCore 0x272668 -[UITableViewCell systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 656
65 UIKitCore 0x331148 -[UITableView _heightForCell:atIndexPath:] + 400
66 UIKitCore 0x18a120 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 2432
67 UIKitCore 0x1632d0 +[UIView(Animation) performWithoutAnimation:] + 96
68 UIKitCore 0x3f4664 -[UITableView _configureCellForDisplay:forIndexPath:] + 244
69 UIKitCore 0x27010c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1916
70 UIKitCore 0x44a10c -[UITableView _createPreparedCellForRowAtIndexPath:willDisplay:] + 88
71 UIKitCore 0x534d90 -[UITableView _heightForRowAtIndexPath:] + 152
72 UIKitCore 0x1cab54 -[UISectionRowData heightForRow:inSection:canGuess:] + 208
73 UIKitCore 0x16ee8c -[UITableViewRowData heightForRow:inSection:canGuess:adjustForReorderedRow:] + 252
74 UIKitCore 0x237c54 -[UITableViewRowData rectForRow:inSection:heightCanBeGuessed:] + 332
75 UIKitCore 0x16c890 -[UITableViewRowData rectForGlobalRow:heightCanBeGuessed:] + 108
76 UIKitCore 0x277eb0 -[UITableView _prefetchCellAtGlobalRow:aboveVisibleRange:] + 264
77 UIKitCore 0x1c52f4 __48-[UITableView _configureCellPrefetchingHandlers]_block_invoke + 56
78 UIKitCore 0x170804 -[_UITableViewPrefetchContext updateVisibleIndexRange:withContentOffset:] + 2392
79 UIKitCore 0x42db08 -[UITableView _updateCycleIdleUntil:] + 188
80 UIKitCore 0x17e2b8 ___UIUpdateCycleNotifyIdle_block_invoke + 704
81 libdispatch.dylib 0x63094 _dispatch_call_block_and_release + 24
82 libdispatch.dylib 0x64094 _dispatch_client_callout + 16
83 libdispatch.dylib 0x45858 _dispatch_main_queue_drain + 888
84 libdispatch.dylib 0x454d0 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 36
85 CoreFoundation 0x4e0d4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
86 CoreFoundation 0xb5f8 __CFRunLoopRun + 2544
87 CoreFoundation 0x1e250 CFRunLoopRunSpecific + 572
88 GraphicsServices 0x1988 GSEventRunModal + 160
89 UIKitCore 0x4e5a94 -[UIApplication _run] + 1080
90 UIKitCore 0x27efd4 UIApplicationMain + 336
91 libswiftUIKit.dylib 0x27ee4 UIApplicationMain(_:_:_:_:) + 100
92 Drops 0x1249a0 static UIApplicationDelegate.main() + 4366371232 (<compiler-generated>:4366371232)
93 Drops 0x124928 static AppDelegate.$main() + 25 (<compiler-generated>:25)
94 Drops 0x1263e8 main + 26 (AppDelegate.swift:26)
95 ??? 0x1036b44d0 (Missing)
Update your tableView in main thread. Ui should be always executed in main thread
DispatchQueue.main.async {
self.invalidateIntrinsicContentSize()
self.layoutIfNeeded()
}

Crash when open three time 'NSInternalInconsistencyException', reason: 'Expression 0 + 0.0291667*0 + 0.00277778*369 unable to find variable UIWindow:

This crash happens in a UINavigationController for three times (present and dismiss consequently for 2 times after the first open).
I made a debug by using breakpoints and I figured that it happens in the presented ViewController after the viewWillAppear finish and before the viewWillLayoutSubviews.
However, it didn't stop between my lines of code so I can't detect the cause of the error.
Happens in IOS 12 ONLY (Works fine in IOS 13)
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expression 0 + 0.0291667*0 + 0.00277778*369 unable to find variable UIWindow:0x7fb745603f60.minX{id: 21963} in engine 0x0'
*** First throw call stack:
(
0 CoreFoundation 0x000000011709929b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000116635735 objc_exception_throw + 48
2 CoreFoundation 0x0000000117099022 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000112f5bc10 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166
4 Foundation 0x000000011317221b -[NSISLinearExpression addVariable:coefficient:] + 341
5 UIKitCore 0x000000011ccb8166 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:onBehalfOfLayoutGuide:] + 3120
6 UIKitCore 0x000000011ccb7527 -[UIView(AdditionalLayoutSupport) nsli_lowerAttribute:intoExpression:withCoefficient:forConstraint:] + 289
7 Foundation 0x000000011317e0d3 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 96
8 Foundation 0x000000011317a3e8 -[NSLayoutConstraint _containerGeometryDidChange] + 117
9 UIKitCore 0x000000011cca33fa _UIViewEnumerateConstraints + 710
10 UIKitCore 0x000000011ccb10bc __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 315
11 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
12 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
13 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
14 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
15 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
16 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
17 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
18 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
19 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
20 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
21 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
22 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
23 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
24 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
25 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
26 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
27 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
28 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
29 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
30 UIKitCore 0x000000011d1d6075 -[UIScrollView _switchToLayoutEngine:] + 106
31 UIKitCore 0x000000011ccb1056 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 213
32 Foundation 0x000000011316555a -[NSISEngine withBehaviors:performModifications:] + 110
33 UIKitCore 0x000000011ccb0f5a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 572
34 UIKitCore 0x000000011ccb0ce6 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 217
35 UIKitCore 0x000000011ccafd4d -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 209
36 UIKitCore 0x000000011cca1712 -[UIView(UIConstraintBasedLayout) _layoutEngine_windowDidChange] + 130
37 UIKitCore 0x000000011d4da793 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 170
38 UIKitCore 0x000000011d4da9ab -[UIView(Internal) _didMoveFromWindow:toWindow:] + 706
39 UIKitCore 0x000000011d4cd091 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151
40 UIKitCore 0x000000011d4ccf70 -[UIView(Hierarchy) _postMovedFromSuperview:] + 804
41 UIKitCore 0x000000011d4dd9a5 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1951
42 UIKitCore 0x000000011d0d17f1 -[UINavigationTransitionView transition:fromView:toView:] + 627
43 UIKitCore 0x000000011d0b63a6 -[UINavigationController _startTransition:fromViewController:toViewController:] + 3189
44 UIKitCore 0x000000011d0b6857 -[UINavigationController _startDeferredTransitionIfNeeded:] + 896
45 UIKitCore 0x000000011d0b7bac -[UINavigationController __viewWillLayoutSubviews] + 150
46 UIKitCore 0x000000011d04363f -[UILayoutContainerView layoutSubviews] + 217
47 UIKitCore 0x000000011d4e4015 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1441
48 QuartzCore 0x0000000114fb6d3d -[CALayer layoutSublayers] + 175
49 QuartzCore 0x0000000114fbbbf7 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395
50 QuartzCore 0x0000000114f34aa6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342
51 QuartzCore 0x0000000114f6bc2a _ZN2CA11Transaction6commitEv + 576
52 UIKitCore 0x000000011cdf48f5 _afterCACommitHandler + 268
53 CoreFoundation 0x0000000116ffc037 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
54 CoreFoundation 0x0000000116ff64ce __CFRunLoopDoObservers + 430
55 CoreFoundation 0x0000000116ff6b61 __CFRunLoopRun + 1537
56 CoreFoundation 0x0000000116ff6221 CFRunLoopRunSpecific + 625
57 GraphicsServices 0x000000011c65e1dd GSEventRunModal + 62
58 UIKitCore 0x000000011cdcb115 UIApplicationMain + 140
59 Almtaar 0x000000010d43a1ab main + 75
60 libdyld.dylib 0x0000000118e83551 start + 1
61 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

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

Foundation crash report, no clue

I have a crash report from crashlytics about a crash happening several times, but I don't know from where to start with that one.
The only thing I am able to see form my app is the AppDelegate, and it looks like something is going wrong with an array but where should I look?
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x39720f46 objc_msgSend + 5
1 Foundation 0x2bcec8e7 -[NSMutableRLEArray replaceObjectsInRange:withObject:length:] + 370
2 Foundation 0x2bd06b6b -[NSConcreteMutableAttributedString addAttribute:value:range:] + 266
3 UIFoundation 0x36792d07 -[NSStringDrawingTextStorage addAttribute:value:range:] + 50
4 UIFoundation 0x3677ced7 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixFontAttributeInRange:] + 1738
5 UIFoundation 0x3677c71b -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixAttributesInRange:] + 186
6 UIFoundation 0x36797c59 -[NSTextStorage invalidateAttributesInRange:] + 108
7 UIFoundation 0x36792b27 -[NSStringDrawingTextStorage processEditing] + 66
8 UIFoundation 0x36797995 -[NSTextStorage edited:range:changeInLength:] + 312
9 UIFoundation 0x367970fb -[NSConcreteNotifyingMutableAttributedString edited:range:changeInLength:] + 50
10 Foundation 0x2bcf2529 -[NSConcreteMutableAttributedString replaceCharactersInRange:withAttributedString:] + 328
11 UIFoundation 0x3679278d -[NSStringDrawingTextStorage textContainerForAttributedString:containerSize:lineFragmentPadding:] + 72
12 UIFoundation 0x3678ba7d __NSStringDrawingEngine + 7520
13 UIFoundation 0x367905bb -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 914
14 UIKit 0x2ea2726b -[UILabel _updateScaledMetricsForRect:] + 618
15 UIKit 0x2e700b51 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 448
16 UIKit 0x2e7684c9 -[UILabel drawTextInRect:] + 488
17 UIKit 0x2e7682d9 -[UILabel drawRect:] + 84
18 UIKit 0x2e76825d -[UIView(CALayerDelegate) drawLayer:inContext:] + 400
19 QuartzCore 0x2e12e33d -[CALayer drawInContext:] + 228
20 UIKit 0x2eb74689 -[_UILabelContentLayer drawInContext:] + 140
21 QuartzCore 0x2e11765b CABackingStoreUpdate_ + 2070
22 QuartzCore 0x2e1fccb9 ___ZN2CA5Layer8display_Ev_block_invoke + 52
23 QuartzCore 0x2e116e39 x_blame_allocations + 88
24 QuartzCore 0x2e116ad1 CA::Layer::display_() + 1160
25 QuartzCore 0x2e0fa729 CA::Layer::display_if_needed(CA::Transaction*) + 200
26 QuartzCore 0x2e0fa3ed CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24
27 QuartzCore 0x2e0f9d81 CA::Context::commit_transaction(CA::Transaction*) + 224
28 QuartzCore 0x2e0f9b6f CA::Transaction::commit() + 434
29 QuartzCore 0x2e14d6e1 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 524
30 IOMobileFramebuffer 0x33050c07 IOMobileFramebufferVsyncNotifyFunc + 90
31 IOKit 0x2bfea001 IODispatchCalloutFromCFMessage + 256
32 CoreFoundation 0x2b02624d __CFMachPortPerform + 132
33 CoreFoundation 0x2b0367cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
34 CoreFoundation 0x2b036767 __CFRunLoopDoSource1 + 346
35 CoreFoundation 0x2b034d69 __CFRunLoopRun + 1608
36 CoreFoundation 0x2af81201 CFRunLoopRunSpecific + 476
37 CoreFoundation 0x2af81013 CFRunLoopRunInMode + 106
38 GraphicsServices 0x32a52201 GSEventRunModal + 136
39 UIKit 0x2e74da09 UIApplicationMain + 1440
40 MyApp 0x00264ee4 main (AppDelegate.swift:16)
41 libdyld.dylib 0x39cc6aaf start + 2
Any idea how to go further with that one?

Resources