nathantannar4 / Transmission

Bridges UIKit presentation APIs to a SwiftUI API so you can use presentation controllers, interactive transitions and more.
BSD 2-Clause "Simplified" License
457 stars 19 forks source link

Hero animation crash in iOS 18 #55

Closed ChrisTitos closed 2 months ago

ChrisTitos commented 2 months ago

Hi,

We're using the example Hero move transition (as given here with some very minor tweaks)

We've been getting crashes in Crashlytics from users who use iOS 18. We are only able to reproduce this via release builds or builds distributed via testflight, so this is very annoying to debug. The crash happens immediately when the user taps on the item that should start the transition.

We're using version 1.2.0 of this library, but we've also been able to reproduce it after upgrading to version 1.4.3

Crash log:

Incident Identifier: 7928DDDB-816F-4022-8AE7-3FF4189EB4B9
Distributor ID:      com.apple.TestFlight
Hardware Model:      iPhone13,2
Process:             Chainels [872]
AppStoreTools:       15F31e
AppVariant:          1:iPhone13,2:17.4
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Date/Time:           2024-09-04 22:10:42.0733 +0200
Launch Time:         2024-09-04 22:10:34.7150 +0200
OS Version:          iPhone OS 18.0 (22A5350a)
Release Type:        Beta
Baseband Version:    5.02.06
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xfffffffffff9321a
Exception Codes: 0x0000000000000001, 0xfffffffffff9321a
VM Region Info: 0xfffffffffff9321a is not in any region.  Bytes after previous region: 18446743592672768539  
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)     1000000000-7000000000 [384.0G] ---/--- SM=NUL  reserved VM address space (unallocated)
--->  
      UNUSED SPACE AT END
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [872]

Triggered by Thread:  0

Thread 0 Crashed:
0   SwiftUICore                     0x000000024c71a280 find1<A>(_:key:filter:) + 52 (PropertyList.swift:839)
1   SwiftUICore                     0x000000024c7175a8 closure #1 in PropertyList.subscript.getter + 88 (PropertyList.swift:76)
2   SwiftUICore                     0x000000024c71a960 partial apply for closure #1 in PropertyList.subscript.getter + 28 (<compiler-generated>:0)
3   SwiftUICore                     0x000000024c2c683c $ss20withExtendedLifetimeyq0_x_q0_yq_YKXEtq_YKs5ErrorR_Ri_zRi_0_r1_lF + 156 (<compiler-generated>:0)
4   SwiftUICore                     0x000000024c715e38 PropertyList.subscript.getter + 200 (PropertyList.swift:74)
5   SwiftUI                         0x00000001938b0fe4 specialized static FocusState._makeProperty<A>(in:container:fieldOffset:inputs:) + 124 (FocusState.swift:213)
6   SwiftUICore                     0x000000024c2bfc58 _DynamicPropertyBuffer.addFields<A>(_:container:inputs:baseOffset:) + 312 (DynamicPropertyBuffer.swift:43)
7   SwiftUICore                     0x000000024c2bfd18 _DynamicPropertyBuffer.init<A>(fields:container:inputs:) + 92 (DynamicPropertyBuffer.swift:30)
8   SwiftUICore                     0x000000024c34cea0 project #1 <A><A1>(flags:) in closure #1 in BodyAccessor.makeBody(container:inputs:fields:) + 624 (DynamicProperty.swift:365)
9   SwiftUICore                     0x000000024c34cc1c closure #1 in BodyAccessor.makeBody(container:inputs:fields:) + 136 (DynamicProperty.swift:0)
10  SwiftUICore                     0x000000024c34ffb0 partial apply for closure #1 in BodyAccessor.makeBody(container:inputs:fields:) + 60 (<compiler-generated>:0)
11  SwiftUICore                     0x000000024c5afcbc $ss24withUnsafeMutablePointer2to_q0_xz_q0_SpyxGq_YKXEtq_YKs5ErrorR_Ri_zRi_0_r1_lF + 160 (<compiler-generated>:0)
12  SwiftUICore                     0x000000024c34b9f0 BodyAccessor.makeBody(container:inputs:fields:) + 336 (DynamicProperty.swift:362)
13  SwiftUICore                     0x000000024c2425e8 static View.makeBody(view:inputs:fields:) + 192 (CustomView.swift:58)
14  SwiftUICore                     0x000000024c241e94 static View.makeView(view:inputs:) + 260 (CustomView.swift:30)
15  SwiftUICore                     0x000000024c241a40 static View._makeView(view:inputs:) + 96 (CustomView.swift:11)
16  Chainels                        0x0000000103cfb34c protocol witness for static View._makeView(view:inputs:) in conformance TimelineDetailView + 12 (<compiler-generated>:0)
17  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
18  SwiftUICore                     0x000000024c094d34 static ViewModifierContentProvider.providerMakeView(view:inputs:) + 312 (CustomViewModifier.swift:85)
19  SwiftUICore                     0x000000024c094bcc static _ViewModifier_Content._makeView(view:inputs:) + 144 (CustomViewModifier.swift:14)
20  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
21  SwiftUICore                     0x000000024c094d34 static ViewModifierContentProvider.providerMakeView(view:inputs:) + 312 (CustomViewModifier.swift:85)
22  SwiftUICore                     0x000000024c094bcc static _ViewModifier_Content._makeView(view:inputs:) + 144 (CustomViewModifier.swift:14)
23  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
24  SwiftUICore                     0x000000024c72d6cc static ViewModifier<>._makeView(modifier:inputs:body:) + 308 (ViewModifier.swift:162)
25  Chainels                        0x0000000105a50824 protocol witness for static ViewModifier._makeView(modifier:inputs:body:) in conformance _ViewInputsBridgeModifier.Modifier + 80 (<compiler-generated>:0)
26  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
27  SwiftUICore                     0x000000024c096324 static ViewModifier.makeView(modifier:inputs:body:) + 828 (CustomViewModifier.swift:264)
28  SwiftUICore                     0x000000024c095c14 static ViewModifier._makeView(modifier:inputs:body:) + 96 (CustomViewModifier.swift:238)
29  Chainels                        0x0000000105a508f8 protocol witness for static ViewModifier._makeView(modifier:inputs:body:) in conformance _ViewInputsBridgeModifier + 12 (<compiler-generated>:0)
30  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
31  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
32  SwiftUICore                     0x000000024c72d6cc static ViewModifier<>._makeView(modifier:inputs:body:) + 308 (ViewModifier.swift:162)
33  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
34  SwiftUICore                     0x000000024c096324 static ViewModifier.makeView(modifier:inputs:body:) + 828 (CustomViewModifier.swift:264)
35  SwiftUICore                     0x000000024c095c14 static ViewModifier._makeView(modifier:inputs:body:) + 96 (CustomViewModifier.swift:238)
36  Chainels                        0x00000001059a3b60 protocol witness for static ViewModifier._makeView(modifier:inputs:body:) in conformance PresentationBridgeAdapter + 12 (<compiler-generated>:0)
37  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
38  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
39  SwiftUICore                     0x000000024c094d34 static ViewModifierContentProvider.providerMakeView(view:inputs:) + 312 (CustomViewModifier.swift:85)
40  SwiftUICore                     0x000000024c094bcc static _ViewModifier_Content._makeView(view:inputs:) + 144 (CustomViewModifier.swift:14)
41  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
42  SwiftUI                         0x0000000193b458d4 specialized static ViewModifier<>._makeView(modifier:inputs:body:) + 260 (<compiler-generated>:0)
43  SwiftUI                         0x0000000193dce2d0 protocol witness for static ViewModifier._makeView(modifier:inputs:body:) in conformance EditModeScopeModifier.TransformModifier + 60 (<compiler-generated>:0)
44  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
45  SwiftUICore                     0x000000024c096324 static ViewModifier.makeView(modifier:inputs:body:) + 828 (CustomViewModifier.swift:264)
46  SwiftUI                         0x00000001931c4c74 protocol witness for static ViewModifier._makeView(modifier:inputs:body:) in conformance WidgetLabelModifier + 96
47  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
48  SwiftUICore                     0x000000024c73108c closure #2 in static ModifiedContent<>._makeView(view:inputs:) + 440 (ViewModifier.swift:427)
49  SwiftUICore                     0x000000024c323fd8 static HitTestBindingModifier._makeView(modifier:inputs:body:) + 172 (HitTestBindingModifier.swift:26)
50  SwiftUICore                     0x000000024c730e20 static ModifiedContent<>._makeView(view:inputs:) + 576 (ViewModifier.swift:424)
51  SwiftUICore                     0x000000024c8ae40c specialized closure #1 in closure #1 in ViewGraph.init<A>(rootViewType:requestedOutputs:) + 408 (ViewGraph.swift:282)
52  SwiftUICore                     0x000000024c821904 static _SafeAreaInsetsModifier._makeView(modifier:inputs:body:) + 1680 (SafeAreaInsets.swift:257)
53  SwiftUICore                     0x000000024c8adf30 closure #1 in ViewGraph.init<A>(rootViewType:requestedOutputs:) + 600 (ViewGraph.swift:263)
54  SwiftUICore                     0x000000024c8af45c closure #1 in ViewGraph.instantiateOutputs() + 1136 (ViewGraph.swift:347)
55  SwiftUICore                     0x000000024c8aecf8 ViewGraph.instantiateOutputs() + 132 (ViewGraph.swift:308)
56  SwiftUICore                     0x000000024c52ced8 GraphHost.instantiateIfNeeded() + 460 (GraphHost.swift:418)
57  SwiftUICore                     0x000000024c8b1354 ViewGraph.layoutComputer.getter + 56 (ViewGraph.swift:675)
58  SwiftUICore                     0x000000024c8a6288 closure #1 in ViewRendererHost.sizeThatFits(_:) + 64 (ViewRendererHost.swift:337)
59  SwiftUICore                     0x000000024c8a3a38 ViewRendererHost.updateViewGraph<A>(body:) + 120 (ViewRendererHost.swift:108)
60  SwiftUICore                     0x000000024c8a3604 ViewRendererHost.sizeThatFits(_:) + 136 (ViewRendererHost.swift:337)
61  SwiftUI                         0x000000019408cbc4 specialized _UIHostingView._layoutSizeThatFits(_:fixedAxes:) + 360 (UIHostingView.swift:1664)
62  SwiftUI                         0x00000001931fe160 @objc _UIHostingView._layoutSizeThatFits(_:fixedAxes:) + 48 (<compiler-generated>:1653)
63  UIKitCore                       0x00000001913a0ec8 0x1912fc000 + 675528
64  UIKitCore                       0x00000001913a0524 0x1912fc000 + 673060
65  UIKitCore                       0x0000000191307dbc 0x1912fc000 + 48572
66  UIKitCore                       0x000000019135d5b8 0x1912fc000 + 398776
67  UIKitCore                       0x000000019135d3f4 0x1912fc000 + 398324
68  UIKitCore                       0x000000019135d044 0x1912fc000 + 397380
69  UIKitCore                       0x000000019135cf60 0x1912fc000 + 397152
70  CoreAutoLayout                  0x00000001b1920030 -[NSISEngine withBehaviors:performModifications:] + 84 (NSISEngine.m:1995)
71  UIKitCore                       0x000000019138e07c 0x1912fc000 + 598140
72  UIKitCore                       0x000000019138c738 0x1912fc000 + 591672
73  UIKitCore                       0x000000019138b7a4 0x1912fc000 + 587684
74  UIKitCore                       0x0000000191658b24 0x1912fc000 + 3525412
75  UIKitCore                       0x0000000191352a14 0x1912fc000 + 354836
76  UIKitCore                       0x000000019135259c 0x1912fc000 + 353692
77  UIKitCore                       0x0000000191352328 0x1912fc000 + 353064
78  UIKitCore                       0x000000019130cf2c 0x1912fc000 + 69420
79  QuartzCore                      0x0000000190650778 CA::Layer::layout_if_needed(CA::Transaction*) + 496 (CALayer.mm:10944)
80  QuartzCore                      0x0000000190650304 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 (CALayer.mm:2638)
81  QuartzCore                      0x00000001906a73b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 472 (CAContextInternal.mm:2613)
82  QuartzCore                      0x00000001906261e8 CA::Transaction::commit() + 648 (CATransactionInternal.mm:420)
83  UIKitCore                       0x000000019247c7dc 0x1912fc000 + 18352092
84  UIKitCore                       0x000000019242f2b4 0x1912fc000 + 18035380
85  UIKitCore                       0x000000019247a820 0x1912fc000 + 18343968
86  UIKitCore                       0x0000000191843bd0 0x1912fc000 + 5536720
87  UIKitCore                       0x00000001918437a0 0x1912fc000 + 5535648
88  Chainels                        0x00000001032f98f0 HeroMoveInteractiveTransition.makeAnimatorIfNeeded(using:) + 3200 (HeroMoveTransition.swift:364)
89  Chainels                        0x00000001032f89b0 HeroMoveInteractiveTransition.animateTransition(using:) + 72 (HeroMoveTransition.swift:278)
90  Chainels                        0x00000001032f8a80 @objc HeroMoveInteractiveTransition.animateTransition(using:) + 52 (<compiler-generated>:0)
91  UIKitCore                       0x0000000191e10330 0x1912fc000 + 11617072
92  UIKitCore                       0x000000019173c31c 0x1912fc000 + 4457244
93  UIKitCore                       0x0000000191e1024c 0x1912fc000 + 11616844
94  UIKitCore                       0x0000000192859274 0x1912fc000 + 22401652
95  UIKitCore                       0x0000000191e100a0 0x1912fc000 + 11616416
96  UIKitCore                       0x0000000191d5b6ac 0x1912fc000 + 10876588
97  UIKitCore                       0x00000001913ac0c0 0x1912fc000 + 721088
98  UIKitCore                       0x00000001913abf84 0x1912fc000 + 720772
99  UIKitCore                       0x00000001913abe98 0x1912fc000 + 720536
100 UIKitCore                       0x00000001913abbb8 0x1912fc000 + 719800
101 UIKitCore                       0x00000001913abac8 0x1912fc000 + 719560
102 UIKitCore                       0x00000001913a90b0 0x1912fc000 + 708784
103 UIKitCore                       0x00000001913a8f24 0x1912fc000 + 708388
104 UIKitCore                       0x00000001913a8b74 0x1912fc000 + 707444
105 UIKitCore                       0x00000001913a9ae8 0x1912fc000 + 711400
106 CoreFoundation                  0x000000018eb80088 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1950)
107 CoreFoundation                  0x000000018eb8001c __CFRunLoopDoSource0 + 176 (CFRunLoop.c:1994)
108 CoreFoundation                  0x000000018eb7db08 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2031)
109 CoreFoundation                  0x000000018eb7cd04 __CFRunLoopRun + 840 (CFRunLoop.c:2949)
110 CoreFoundation                  0x000000018eb7c5b8 CFRunLoopRunSpecific + 572 (CFRunLoop.c:3414)
111 GraphicsServices                0x00000001da4551c4 GSEventRunModal + 164 (GSEvent.c:2196)
112 UIKitCore                       0x00000001916dbb6c 0x1912fc000 + 4062060
113 UIKitCore                       0x0000000191789fdc 0x1912fc000 + 4775900
114 Chainels                        0x0000000102c85a40 main + 64 (AppDelegate.swift:72)
115 dyld                            0x00000001b428ed34 start + 2724 (dyldMain.cpp:1334)

Any ideas?

nathantannar4 commented 2 months ago

hmm, tested on Xcode 16 (Beta 6) w/ iOS 18 simulator, build config release, and no crash.

I did make fixes for iOS 18 in v 1.3.0, with some follow up fixes thereafter. I'd recommend using 1.3.1 as a minimum.

If you're able to share the entire view body that you are presenting when a user taps on the link, that would be helpful

nathantannar4 commented 2 months ago

Ok I was able to get a similar crash when using old versions of Engine, the core dependancy of Transmission.

Screenshot 2024-09-07 at 9 07 28 AM

Please Transmission v 1.3.1 or higher, as that sets the Engine dependency to be 1.8.1 or higher which is required for the iOS 18 changes in SwiftUI that Engine needed to adopt.

ChrisTitos commented 2 months ago

Thanks for checking!. We'll upgrade. If we still get crashes we'll let you know.