Several users are seeing a crash that occurs when configureCell is called for a UICollectionView. This seems to occur specifically for cells that add SwiftUI views using UIHostedConfiguration.
0 libsystem_kernel.dylib 0xc1d4 __pthread_kill + 8
1 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268
2 libsystem_c.dylib 0x77ad8 abort + 128
3 libswiftCore.dylib 0x3cc1a4 swift::fatalError(unsigned int, char const*, ...) + 134
4 libswiftCore.dylib 0x3cc1c4 swift::warningv(unsigned int, char const*, char*) + 30
5 libswiftCore.dylib 0x3cc810 swift_beginAccess + 538
6 libswiftCore.dylib 0x3cc864 swift_beginAccess + 84
7 SwiftUI 0x947a0 _UIHostingView._rootView.getter + 92
8 SwiftUI 0x94668 _UIHostingView.makeRootView() + 432
9 SwiftUI 0x943b8 _UIHostingView.updateRootView() + 264
10 SwiftUICore 0xa0d000 closure #1 in ViewRendererHost.updateGraph() + 204
11 SwiftUICore 0x1f1308 partial apply for thunk for @escaping @callee_guaranteed () -> () + 28
12 AttributeGraph 0x144a8 AGGraphWithUpdate + 84
13 SwiftUICore 0x4a5f60 @objc closure #1 in closure #1 in closure #1 in static Update.syncMain(_:) + 84
14 SwiftUICore 0x3620 wait_for_lock + 112
15 SwiftUICore 0x3588 _MovableLockLock + 68
16 SwiftUICore 0x5bb6d4 _ViewList_ReleaseElements.deinit + 64
17 SwiftUICore 0x5bb838 _ViewList_ReleaseElements.__deallocating_deinit + 16
18 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56
19 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160
20 SwiftUICore 0x7cf7bc assignWithTake for _ViewList_View + 52
21 SwiftUICore 0x18dbe0 assignWithTake for ExclusiveGesture + 76
22 SwiftUI 0x13aff8 outlined assign with take of ModifiedContent<TableRowView, CollectionViewCellModifier> + 100
23 SwiftUI 0x1394fc specialized PlatformListCell<>.defaultConfigureContent(_:transaction:) + 296
24 SwiftUI 0xb8308 CollectionViewListDataSource.configureCell(_:transaction:context:) + 1200
25 SwiftUI 0xb8e20 ShadowListDataSource.configureCell(_:transaction:context:) + 1336
26 SwiftUI 0xb670c closure #1 in UICollectionViewListCoordinatorBase.updateListContents(_:) + 452
27 SwiftUI 0xead7b4 partial apply for closure #1 in ListCoreDataSource.visitRowAt<A>(_:visitor:) + 32
28 SwiftUI 0xb6160 partial apply for closure #1 in ListCoreDataSource.visitRowAt<A>(_:visitor:) + 16
29 SwiftUI 0x171e1c Optional.map<A, B>(_:) + 516
30 SwiftUI 0xb98d8 ListCoreDataSource.visitRowAt<A>(_:visitor:) + 1064
31 SwiftUI 0x33b3c ListCoreDataSource.visitContent<A>(atRow:visitor:) + 536
32 SwiftUI 0xb5478 UICollectionViewListCoordinatorBase.updateListContents(_:) + 1696
33 SwiftUI 0x942dac closure #1 in performUpdates #1 <A, B>() in UICollectionViewListCoordinatorBase.update(_:to:transaction:performDiff:) + 416
34 SwiftUI 0x3261cc thunk for @escaping @callee_guaranteed (@unowned Bool) -> () + 48
35 SwiftUI 0x94cf88 closure #1 in UpdateCoalescingCollectionView.performBatchUpdates(_:completion:) + 308
36 SwiftUI 0x3261cc thunk for @escaping @callee_guaranteed (@unowned Bool) -> () + 48
37 UIKitCore 0x2b9bbc -[UICollectionView _updateAnimationDidStop:finished:] + 1240
38 UIKitCore 0xa02c38 __118-[UICollectionView _startViewAnimationsWithContext:oldVisibleViews:viewAnimator:viewAnimationsCompletedDispatchGroup:]_block_invoke + 36
39 UIKitCore 0x7d788 __47-[UICollectionViewAnimation startWithAnimator:]_block_invoke_3 + 272
40 UIKitCore 0x7bfb0 __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 36
41 UIKitCore 0x7be94 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 624
42 UIKitCore 0x7abb0 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 436
43 UIKitCore 0x86f38 -[UIViewAnimationState animationDidStop:finished:] + 192
44 QuartzCore 0x4e3cc run_animation_callbacks(void*) + 132
45 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
46 libdispatch.dylib 0x129e0 _dispatch_main_queue_drain + 980
47 libdispatch.dylib 0x125fc _dispatch_main_queue_callback_4CF + 44
48 CoreFoundation 0x56204 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
49 CoreFoundation 0x53440 __CFRunLoopRun + 1996
50 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
51 GraphicsServices 0x11c4 GSEventRunModal + 164
52 UIKitCore 0x3d2eb0 -[UIApplication _run] + 816
53 UIKitCore 0x4815b4 UIApplicationMain + 340
The crashes started occurring in October and only for iOS 18 users (all versions from 18.0.0 to 18.2.0).
We have several cell types that use SwiftUI views and I haven't been able to isolate the issue to any particular cell type.
I have tried setting contentConfiguration = nil in prepareForReuse but this didn't help.
Has there been a change in UICollectionView/UIHostingConfiguration in iOS 18? Any ideas on how this can be further investigated or resolved?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Several users are seeing a crash in a new app version that introduces the use of a UITabBarController. We haven't been able to isolate the crash to a specific user flow, device, or OS version.
Fatal Exception: NSInternalInconsistencyException
Inconsistency in UITabBar items and view controllers detected. No view controller matches the UITabBarItem '<UITabBarItem: 0x130623160> title='Today' image=<UIImage:0x3001893b0 named(RootTab-resources: today) {36, 32} renderingMode=automatic(original)> selected'.
0 CoreFoundation 0x83f20 __exceptionPreprocess
1 libobjc.A.dylib 0x16018 objc_exception_throw
2 Foundation 0x6de868 _userInfoForFileAndLine
3 UIKitCore 0x85c9d8 -[UITabBarController _viewControllerForTabBarItem:]
4 UIKitCore 0x85ca80 -[UITabBarController _tabBarItemClicked:]
5 UIKitCore 0x3fb31c -[UIApplication sendAction:to:from:forEvent:]
6 UIKitCore 0x785d18 -[UITabBar _sendAction:withEvent:]
7 UIKitCore 0x3fb31c -[UIApplication sendAction:to:from:forEvent:]
8 UIKitCore 0x3fb1f4 -[UIControl sendAction:to:forEvent:]
9 UIKitCore 0x3fb044 -[UIControl _sendActionsForEvents:withEvent:]
10 UIKitCore 0x787054 -[UITabBar _buttonUp:]
11 UIKitCore 0x3fb31c -[UIApplication sendAction:to:from:forEvent:]
12 UIKitCore 0x3fb1f4 -[UIControl sendAction:to:forEvent:]
13 UIKitCore 0x3fb044 -[UIControl _sendActionsForEvents:withEvent:]
14 UIKitCore 0x913894 -[UIControl touchesEnded:withEvent:]
15 UIKitCore 0x33beac -[UIWindow _sendTouchesForEvent:]
16 UIKitCore 0x33b954 -[UIWindow sendEvent:]
17 UIKitCore 0x1bc9e0 -[UIApplication sendEvent:]
18 UIKitCore 0x1be1d4 __dispatchPreprocessedEventFromEventQueue
19 UIKitCore 0x1c6ecc __processEventQueue
20 UIKitCore 0xb984c updateCycleEntry
21 UIKitCore 0xb776c _UIUpdateSequenceRun
22 UIKitCore 0xb73b0 schedulerStepScheduledMainSection
23 UIKitCore 0xb8254 runloopSourceCallback
24 CoreFoundation 0x56834 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
25 CoreFoundation 0x567c8 __CFRunLoopDoSource0
26 CoreFoundation 0x54298 __CFRunLoopDoSources0
27 CoreFoundation 0x53484 __CFRunLoopRun
28 CoreFoundation 0x52cd8 CFRunLoopRunSpecific
29 GraphicsServices 0x11a8 GSEventRunModal
30 UIKitCore 0x40a90c -[UIApplication _run]
31 UIKitCore 0x4be9d0 UIApplicationMain
32 Coach 0x62a44 main + 14 (main.m:14)
33 ??? 0x1bcfd9e4c (Missing)
I have only found 2 references to this exception online and neither of them have a resolution:
https://stackoverflow.com/questions/77536249/embed-flutterviewcontroller-to-native-swift-tabbar
https://github-com.translate.goog/ChenYilong/CYLTabBarController/issues/608?_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc
Any ideas on how this can be further investigated or resolved?
Topic:
UI Frameworks
SubTopic:
UIKit
I've started seeing several users getting an app crash that I've been unable to find the root cause for so far. I've tried running the app in release build with address sanitizer and zombie objects checks enabled but have been unable to reproduce it. It only occurs for iOS 17 users. Any ideas on how I can troubleshoot this?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0xed4 _platform_memmove + 52
1 QuartzCore 0x137120 CA::Render::InterpolatedFunction::encode(CA::Render::Encoder*) const + 248
2 QuartzCore 0x136f40 CA::Render::GradientLayer::encode(CA::Render::Encoder*) const + 44
3 QuartzCore 0x2e384 CA::Render::Layer::encode(CA::Render::Encoder*) const + 284
4 QuartzCore 0x2e224 CA::Render::encode_set_object(CA::Render::Encoder*, unsigned long, unsigned int, CA::Render::Object*, unsigned int) + 196
5 QuartzCore 0x2b654 invocation function for block in CA::Context::commit_transaction(CA::Transaction*, double, double*) + 244
6 QuartzCore 0x2b4fc CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 368
7 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
8 QuartzCore 0x2b4bc CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 304
9 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
10 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
11 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
12 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
13 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
14 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
15 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
16 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
17 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
18 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
19 QuartzCore 0x6fc60 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 11192
20 QuartzCore 0x66574 CA::Transaction::commit() + 648
21 UIKitCore 0x31b5ec __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 36
22 CoreFoundation 0x373a8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
23 CoreFoundation 0x35b9c __CFRunLoopDoBlocks + 356
24 CoreFoundation 0x33a9c __CFRunLoopRun + 848
25 CoreFoundation 0x33668 CFRunLoopRunSpecific + 608
26 GraphicsServices 0x35ec GSEventRunModal + 164
27 UIKitCore 0x22c2b4 -[UIApplication _run] + 888
28 UIKitCore 0x22b8f0 UIApplicationMain + 340
29 Coach 0x799d8 main + 14 (main.m:14)
30 ??? 0x1abefadcc (Missing)