The issue started happening randomly after iOS 16 update. For video exporting AVFoundation's AVAssetExportSession is used. The issue happens only when AVVideoComposition's animationTool property is applied. The ui freezes when the export process finishes. Main thread's call stack is attached below.
Thread 0 - com.apple.main-thread - (TH_STATE_WAITING)
0 libsystem_kernel.dylib +0x13004 _mach_msg2_internal
1 libsystem_kernel.dylib +0x13244 _mach_msg_overwrite
2 libsystem_kernel.dylib +0x1088 _mach_msg
3 QuartzCore +0x8a6ac CA::Render::Message::send_message()
4 QuartzCore +0x2612a8 CA::Render::Encoder::send_message(unsigned int, unsigned int, unsigned int*, unsigned long)
5 QuartzCore +0x31168 CA::Context::commit_transaction(CA::Transaction*, double, double*)
6 QuartzCore +0x663c0 CA::Transaction::commit()
7 UIKitCore +0x504fcc __UIApplicationFlushCATransaction
8 UIKitCore +0x651674 __UIUpdateSequenceRun
9 UIKitCore +0xc90900 _schedulerStepScheduledMainSection
10 UIKitCore +0xc8facc _runloopSourceCallback
11 CoreFoundation +0xd6228 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
12 CoreFoundation +0xe2610 ___CFRunLoopDoSource0
13 CoreFoundation +0x66578 ___CFRunLoopDoSources0
14 CoreFoundation +0x7beb4 ___CFRunLoopRun
15 CoreFoundation +0x811e0 _CFRunLoopRunSpecific
16 GraphicsServices +0x1364 _GSEventRunModal
17 UIKitCore +0x3a2d84 -[UIApplication _run]
18 UIKitCore +0x3a29e8 _UIApplicationMain
19 PicsArt +0x4998b0 main (main.m:29:16)
20 dyld +0x15944 start
I tried to call AVAssetExportSession's exportAsynchronously and cancelExport functions on background queue, as a result the number of crashes decreased, but big number of users still get this app hang. I expect to find some workaround solution for this.