Using PhaseAnimator causes a 'Simultaneous accesses' crash when force-quitting the app from the task manager

Originator:fred
Number:rdar://FB13513463 Date Originated:January 3, 2024
Status:Open Resolved:
Product:SwiftUI Product Version:21C66
Classification: Reproducible:
 
=== Environment ===

iOS 17.2.1 (21C66)
Xcode 15.1 (15C65)

Note: It’s reproducible on iOS 17.2.1 (21C66), but I suspect it happens across all iOS 17 builds, since I’ve gotten crash reports coming from 17.1 to 17.3 Beta.

=== Current Behavior ===

Using PhaseAnimator causes a ‘Simultaneous accesses’ crash when killing the app. While force quitting apps is not recommended, users perform this action regularly and it’s causing issues in my app.

=== Expected Behavior ===

The app should not crash upon quitting.

=== Reproduction Steps ===

1. Create a new SwiftUI project
2. Add a PhaseAnimator that doesn't use a trigger.
3. Run the project on an iPhone.
4. Force quit the app from the iPhone’s task manager.
5. Crash.

=== Stack Trace ===

Simultaneous accesses to 0x101705d70, but modification requires exclusive access.
Previous access (a modification) started at SwiftUI`<redacted> + 12108 (0x1b15062cc).
Current access (a read) started at:
0    libswiftCore.dylib                 0x00000001a57cf470 <redacted> + 432
1    libswiftCore.dylib                 0x00000001a57cf688 swift_beginAccess + 84
2    SwiftUI                            0x00000001b1503380 <redacted> + 14364
3    SwiftUI                            0x00000001b16565ac <redacted> + 15408
4    SwiftUI                            0x00000001b089a518 <redacted> + 9464
5    SwiftUI                            0x00000001b089a518 <redacted> + 9148
6    SwiftUI                            0x00000001b17d997c <redacted> + 1944
7    SwiftUI                            0x00000001b08b9870 <redacted> + 44636
8    SwiftUI                            0x00000001b08b9870 <redacted> + 47116
9    libswiftCore.dylib                 0x00000001a57d38dc <redacted> + 56
10   libswiftCore.dylib                 0x00000001a57d4f28 <redacted> + 136
11   SwiftUI                            0x00000001b111fc28 <redacted> + 15256
12   AttributeGraph                     0x00000001d426507c <redacted> + 1236
13   AttributeGraph                     0x00000001d4250c9c <redacted> + 196
14   AttributeGraph                     0x00000001d425f3e4 <redacted> + 352
15   AttributeGraph                     0x00000001d4272c20 AGGraphInvalidate + 36
16   SwiftUI                            0x00000001b1503380 <redacted> + 12156
17   SwiftUI                            0x00000001b16565ac <redacted> + 41600
18   SwiftUI                            0x00000001b16565ac <redacted> + 41340
19   SwiftUI                            0x00000001b16565ac <redacted> + 41648
20   libobjc.A.dylib                    0x00000001a43b9300 <redacted> + 116
21   libobjc.A.dylib                    0x00000001a43b904c objc_destructInstance + 80
22   libobjc.A.dylib                    0x00000001a43b8fec _objc_rootDealloc + 80
23   UIKitCore                          0x00000001ae315234 <redacted> + 124
24   UIKitCore                          0x00000001ae3138ec <redacted> + 1032
25   libobjc.A.dylib                    0x00000001a43b6ab0 <redacted> + 196
26   libobjc.A.dylib                    0x00000001a43b690c objc_autoreleasePoolPop + 260
27   UIKitCore                          0x00000001ae3138ec <redacted> + 1004
28   libobjc.A.dylib                    0x00000001a43b6ab0 <redacted> + 196
29   libobjc.A.dylib                    0x00000001a43b690c objc_autoreleasePoolPop + 260
30   UIKitCore                          0x00000001ae3138ec <redacted> + 1004
31   UIKitCore                          0x00000001af0ccb60 <redacted> + 1124
32   libobjc.A.dylib                    0x00000001a43b6ab0 <redacted> + 196
33   libobjc.A.dylib                    0x00000001a43b690c objc_autoreleasePoolPop + 260
34   UIKitCore                          0x00000001ae340314 <redacted> + 92
35   UIKitCore                          0x00000001ae34009c <redacted> + 164
36   UIKitCore                          0x00000001ae33fe68 <redacted> + 496
37   UIKitCore                          0x00000001ae33fd80 <redacted> + 100
38   UIKitCore                          0x00000001ae33fc98 <redacted> + 72
39   UIKitCore                          0x00000001ae33f790 <redacted> + 84
40   UIKitCore                          0x00000001ae33ee44 <redacted> + 144
41   UIKitCore                          0x00000001ae33ef34 <redacted> + 92
42   CoreFoundation                     0x00000001ac0a1110 <redacted> + 28
43   CoreFoundation                     0x00000001ac0a02f8 <redacted> + 176
44   CoreFoundation                     0x00000001ac09ea68 <redacted> + 340
45   CoreFoundation                     0x00000001ac09d55c <redacted> + 828
46   CoreFoundation                     0x00000001ac09d218 CFRunLoopRunSpecific + 608
47   GraphicsServices                   0x00000001ef61e454 GSEventRunModal + 164
48   UIKitCore                          0x00000001ae4c12b4 <redacted> + 888
49   UIKitCore                          0x00000001ae4c0b14 UIApplicationMain + 340
50   SwiftUI                            0x00000001b0ed125c <redacted> + 604
51   SwiftUI                            0x00000001b0ed125c <redacted> + 160
52   SwiftUI                            0x00000001b0b415fc <redacted> + 2196
53   PhaseAnimatorBug                   0x00000001003f9008 static PhaseAnimatorBugApp.$main() + 40
54   PhaseAnimatorBug                   0x00000001003f91bc main + 12
55   dyld                               0x00000001cedd650c <redacted> + 2240
Message from debugger: Terminated due to signal 9

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!