SwiftUI app crashes using iOS 16 EXC_BREAKPOINT, difficulty understanding crash report

Hi Everyone,

Our app crashes on iOS 16, but we are having a hard time trying to interpret the crash report. Please find the report below.

Does anyone know what this could be? Many thanks in advance. :)

Kind regards, Floris

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000199f2d20c
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [6538]

Triggered by Thread:  0


Kernel Triage:
VM - pmap_enter retried due to resource shortage


Thread 0 name:
Thread 0 Crashed:
0   libswiftCore.dylib            	0x0000000199f2d20c _assertionFailure(_:_:file:line:flags:) + 312 (AssertCommon.swift:143)
1   SwiftUI                       	0x00000001a3af292c specialized PlatformListViewBase<>.hostSizeThatFits(width:) + 648
2   SwiftUI                       	0x00000001a4c95418 specialized PlatformListViewBase<>.hostPreferredLayoutAttributes(fitting:insets:) + 188
3   SwiftUI                       	0x00000001a42d3f40 @objc ListCollectionViewCell.preferredLayoutAttributesFitting(_:) + 48 (<compiler-generated>:0)
4   UIKitCore                     	0x00000001a22999ac -[UICollectionReusableView _preferredLayoutAttributesFittingAttributes:] + 144 (UICollectionViewCell.m:562)
5   UIKitCore                     	0x00000001a2326700 -[UICollectionViewListCell _preferredLayoutAttributesFittingAttributes:] + 240 (UICollectionViewListCell.m:579)
6   UIKitCore                     	0x00000001a21f9818 -[UICollectionView _checkForPreferredAttributesInView:originalAttributes:] + 160 (UICollectionView.m:3017)
7   UIKitCore                     	0x00000001a238afbc -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:] + 804 (UICollectionView.m:3462)
8   UIKitCore                     	0x00000001a28d4804 -[UICollectionView _updatePreferredAttributesForSupplementariesInCurrentUpdate:] + 400 (UICollectionView.m:11077)
9   UIKitCore                     	0x00000001a28d4540 -[UICollectionView _updatePreferredAttributesForSupplementariesInCurrentUpdateWithRect:newlyVisible:includeInserts:] + 756 (UICollectionView.m:11055)
10  UIKitCore                     	0x00000001a28d3a44 -[UICollectionView _updatePreferredAttributesForCurrentUpdate:] + 1140 (UICollectionView.m:10892)
11  UIKitCore                     	0x00000001a28d3a9c -[UICollectionView _updatePreferredAttributesForCurrentUpdate:] + 1228 (UICollectionView.m:10906)
12  UIKitCore                     	0x00000001a2390984 -[UICollectionView _viewAnimationsForCurrentUpdateWithCollectionViewAnimator:] + 116 (UICollectionView.m:9931)
13  UIKitCore                     	0x00000001a28d4d44 __102-[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:]_block_invoke.744 + 268 (UICollectionView.m:11253)
14  UIKitCore                     	0x00000001a21ff6d0 +[UIView(Animation) performWithoutAnimation:] + 76 (UIView.m:14722)
15  UIKitCore                     	0x00000001a24e1f8c -[UICollectionView _updateWithItems:tentativelyForReordering:propertyAnimator:collectionViewAnimator:] + 1388 (UICollectionView.m:11243)
16  UIKitCore                     	0x00000001a24e15a8 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 9020 (UICollectionView.m:9766)
17  UIKitCore                     	0x00000001a243f11c -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] + 520 (UICollectionView.m:11823)
18  SwiftUI                       	0x00000001a40fa88c UpdateCoalescingCollectionView.performBatchUpdates(_:completion:) + 408 (UpdateCoalescingCollectionView.swift:241)
19  SwiftUI                       	0x00000001a40fb27c @objc UpdateCoalescingCollectionView.performBatchUpdates(_:completion:) + 200 (<compiler-generated>:0)
20  SwiftUI                       	0x00000001a3a65f58 thunk for @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
21  SwiftUI                       	0x00000001a3bb8150 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
22  UIKitCore                     	0x00000001a21ff6d0 +[UIView(Animation) performWithoutAnimation:] + 76 (UIView.m:14722)
23  SwiftUI                       	0x00000001a40fa624 UpdateCoalescingCollectionView.layoutSubviews() + 340 (UpdateCoalescingCollectionView.swift:225)
24  SwiftUI                       	0x00000001a40fa6d0 @objc UpdateCoalescingCollectionView.layoutSubviews() + 32 (<compiler-generated>:0)
25  UIKitCore                     	0x00000001a21d2cec -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980 (UIView.m:18550)
26  QuartzCore                    	0x00000001a16af4e8 CA::Layer::layout_if_needed(CA::Transaction*) + 500 (CALayer.mm:10223)
27  UIKitCore                     	0x00000001a22a0ae8 -[UIView(Hierarchy) layoutBelowIfNeeded] + 292 (UIView.m:12990)
28  UIKitCore                     	0x00000001a2a03c80 __87-[_UINavigationControllerRefreshControlHost refreshControl:didChangeToState:fromState:]_block_invoke + 52 (_UINavigationControllerRefreshControlHost.m:119)

... 

54  QuartzCore                    	0x00000001a16ced48 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 1444 (CATransactionInternal.mm:1933)
55  QuartzCore                    	0x00000001a16e03e8 display_timer_callback(__CFMachPort*, void*, long, void*) + 372 (CADisplayTimer.cpp:219)
56  CoreFoundation                	0x00000001a00bbb30 __CFMachPortPerform + 176 (CFMachPort.c:549)
57  CoreFoundation                	0x00000001a00d9010 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1998)
58  CoreFoundation                	0x00000001a00dac18 __CFRunLoopDoSource1 + 520 (CFRunLoop.c:2137)
59  CoreFoundation                	0x00000001a00bc44c __CFRunLoopRun + 2264 (CFRunLoop.c:3192)
60  CoreFoundation                	0x00000001a00c11e4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3390)
61  GraphicsServices              	0x00000001d8ee1368 GSEventRunModal + 164 (GSEvent.c:2196)
62  UIKitCore                     	0x00000001a2570d88 -[UIApplication _run] + 888 (UIApplication.m:3726)
63  UIKitCore                     	0x00000001a25709ec UIApplicationMain + 340 (UIApplication.m:5316)
64  SwiftUI                       	0x00000001a3b6fce8 closure #1 in KitRendererCommon(_:) + 168 (UIKitApp.swift:37)
65  SwiftUI                       	0x00000001a3accc24 runApp<A>(_:) + 152 (<compiler-generated>:0)
66  SwiftUI                       	0x00000001a3ab5b44 static App.main() + 128 (App.swift:114)
67  Figy                          	0x0000000102b24530 static FigyClientAppleApp.$main() + 52 (FigyClientAppleApp.swift:11)
68  Figy                          	0x0000000102b24530 main + 64 (FacebookAPI.swift:0)
69  dyld                          	0x00000001be3e5948 start + 2504 (dyldMain.cpp:1168)

Check for memory leaks, memory usage, high cpu with Instruments.

Thank you for your message. I do not understand why the exception only occurs for iOS 16 though. We do not have problems with iOS 15.

similar here, it just crashes randomly, but i have no indication on problem location

PS: using SwiftUI

OS Version:          iPhone OS 16.1 (20B82)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000019a9edeb4
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [45365]

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   SwiftUI                       	       0x19a9edeb4 0x19a9c3000 + 175796
1   SwiftUI                       	       0x19a9ede98 0x19a9c3000 + 175768
2   SwiftUI                       	       0x19aa02da4 0x19a9c3000 + 261540
3   libswiftCore.dylib            	       0x1910dd138 Slice.index(after:) + 48
4   SwiftUI                       	       0x19abd4d48 0x19a9c3000 + 2170184
5   SwiftUI                       	       0x19ac16594 0x19a9c3000 + 2438548
6   libswiftCore.dylib            	       0x190f29678 BidirectionalCollection.index(_:offsetBy:) + 292
7   SwiftUI                       	       0x19a9edd00 0x19a9c3000 + 175360
8   SwiftUI                       	       0x19be30904 0x19a9c3000 + 21420292
9   SwiftUI                       	       0x19bc2ffa8 0x19a9c3000 + 19320744
10  SwiftUI                       	       0x19b7b1034 0x19a9c3000 + 14606388
11  SwiftUI                       	       0x19b7afc20 0x19a9c3000 + 14601248
12  SwiftUI                       	       0x19b7b21e4 0x19a9c3000 + 14610916
13  UIKitCore                     	       0x1994e57d4 -[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:deselectPrevious:performCustomSelectionAction:] + 1060
14  UIKitCore                     	       0x1997314d4 -[UICollectionView touchesEnded:withEvent:] + 480
15  UIKitCore                     	       0x1993e7514 forwardTouchMethod + 284
16  UIKitCore                     	       0x1993e7514 forwardTouchMethod + 284
17  UIKitCore                     	       0x1993e7514 forwardTouchMethod + 284
18  UIKitCore                     	       0x1993e7514 forwardTouchMethod + 284
19  UIKitCore                     	       0x1993185e0 _UIGestureEnvironmentUpdate + 5772
20  UIKitCore                     	       0x199b9ce14 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 288
21  UIKitCore                     	       0x1992dc31c -[UIGestureEnvironment _updateForEvent:window:] + 188
22  UIKitCore                     	       0x1992e0c74 -[UIWindow sendEvent:] + 3268
23  UIKitCore                     	       0x1992dff44 -[UIApplication sendEvent:] + 672
24  UIKitCore                     	       0x1992df600 __dispatchPreprocessedEventFromEventQueue + 7084
25  UIKitCore                     	       0x1993273e4 __processEventQueue + 5632
26  UIKitCore                     	       0x199f790a4 updateCycleEntry + 168
27  UIKitCore                     	       0x199837740 _UIUpdateSequenceRun + 84
28  UIKitCore                     	       0x199e7efd0 schedulerStepScheduledMainSection + 172
29  UIKitCore                     	       0x199e7e19c runloopSourceCallback + 92
30  CoreFoundation                	       0x1970fdf54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
31  CoreFoundation                	       0x19710a32c __CFRunLoopDoSource0 + 176
32  CoreFoundation                	       0x19708e210 __CFRunLoopDoSources0 + 244
33  CoreFoundation                	       0x1970a3ba8 __CFRunLoopRun + 836
34  CoreFoundation                	       0x1970a8ed4 CFRunLoopRunSpecific + 612
35  GraphicsServices              	       0x1cfb05368 GSEventRunModal + 164
36  UIKitCore                     	       0x1995873d0 -[UIApplication _run] + 888
37  UIKitCore                     	       0x199587034 UIApplicationMain + 340
38  libswiftUIKit.dylib           	       0x19fb73308 UIApplicationMain(_:_:_:_:) + 104
39  Fyzio Klinik Doctor           	       0x10445b2d8 static UIApplicationDelegate.main() + 104
40  Fyzio Klinik Doctor           	       0x10445b260 static AppDelegate.$main() + 44
41  Fyzio Klinik Doctor           	       0x10445b450 main + 28
42  dyld                          	       0x1b5700960 start + 2528

Thread 1:
0   libsystem_pthread.dylib       	       0x1e370eb90 start_wqthread + 0

Same error here, since iOS 16. The crashed for my app in the AppStore increased by almost a few 100% since iOS 16 (and still in 16.1). I have absolutely no indication why this is happening. I can't reproduce this error at all.

This might be due to the issue discussed here: https://developer.apple.com/forums/thread/708097 For iOS 16, if you're using a UIText view it is probably using TextKit 2 which may cause crashes on iOS 16. The workaround is to access the layoutManager of the of the view: _ = textView.layoutManager

SwiftUI app crashes using iOS 16 EXC_BREAKPOINT, difficulty understanding crash report
 
 
Q