Help diagnosing crash with only system code in its stack trace

Hello,

I work on a video streaming app, and I have been working on this crash that we are seeing quite frequently (it is our #2 crasher at the moment). The stack trace indicates that an AVPictureInPictureController is being deallocated on a background thread. This leads to dangling AutoLayout constraints getting cleaned up, further resulting in an exception being thrown from the framework about the layout engine being accessed from a background thread.

We have internal analytics which indicate that the crash occurs after the user comes back to the app after putting it in the background, and switches playback from Picture in Picture mode back to the app's regular playback UI.

What has me puzzled here is that, as I'm sure you know, we have no control over the PIP UI. It is entirely system-provided, and there is none of our app's code in the stack trace. The whole process is even initiated by a KVO on an AVPlayerController property, and our app doesn't use that class directly anywhere. So how did we manage to cause this process to happen on a background thread?

Add to this the fact that the bug only appeared once we switched to compiling with Xcode 16, and is overwhelmingly present only on devices running iOS 18.

These factors lead me to believe that this is probably an OS issue. But before I go to file a feedback, I thought I would post here in case anyone has any ideas. I have attached an instance of the crash log to this post.

Answered by DTS Engineer in 820720022

Hello @ElFrijol,

I think you should go ahead and file that bug report using Feedback Assistant. (Please post your FB# back on this thread once you file)

If you have a focused sample that can reliably reproduce the issue, be sure to include that in your report.

-- Greg

Hello @ElFrijol,

I think you should go ahead and file that bug report using Feedback Assistant. (Please post your FB# back on this thread once you file)

If you have a focused sample that can reliably reproduce the issue, be sure to include that in your report.

-- Greg

Help diagnosing crash with only system code in its stack trace
 
 
Q