4

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.

  • Most likely it's `CATransaction`: make sure your `begin` and `commit` calls are balanced, and so are `lock` / `unlock`... *if you even need `CATransaction` at all* – timbre timbre Dec 12 '22 at 15:25
  • @akjndklskver I have created a simple application which has only export functionality and I don't have CATransaction calls in my code. Thanks. – Rafi Martirosyan Dec 13 '22 at 07:22
  • 1
    CA animations are generally divided to two kinds - explicit and implicit, so that is not surprising. However i still wonder if the problem is caused by code, bug or change in CA – h4cky Dec 13 '22 at 09:54
  • Facing the same issue, but only on iPhone 13 Pro and iPhone 14 Pro.. – Milander Feb 04 '23 at 06:20
  • Having the exact same issue on my end. I narrowed it down to the export session + animation tool setter on composition. If ever I remove that, then the app is not hanging. Which makes sense because CoreAnimation has an issue. Opened a thread on apple dev forums https://developer.apple.com/forums/thread/726146 but it feels like going phishing... @RafiMartirosyan, did you open a radar on Apple with your simple application? – ipodishima Mar 08 '23 at 09:45
  • I made a report on this topic with a sample application and reproduction case, Apple answered that they know about the problem and they are working on this, however there is no solution until now. – Rafi Martirosyan Mar 09 '23 at 12:41

0 Answers0