6

We see strange crashes when running our app on macOS 12 beta 21A5522h. We have not been able to fully identify the issue but it seems to happen on continue video playback in an AVPlayer after the app has been in the background. Xcode points to some random code (seems different every time and never in our own code)

enter image description here

And in the log we will see:

-[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion 'MTLResource 0x600002293790 (label: (null)), referenced in cmd buffer 0x7f7b2200a000 (label: (null)) is in volatile or empty purgeable state at commit'

-[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion 'MTLResource 0x600002293790 (label: (null)), referenced in cmd buffer 0x7f7b2200a000 (label: (null)) is in volatile or empty purgeable state at commit'

We tried finding the object 0x600002293790 and 0x7f7b2200a000 but this gave no additional information as to why the app crashes.

We are using a custom VideoCompositor: AVVideoCompositing and initialise the CIContext for the work done here with these options:

if let mtlDevice = MTLCreateSystemDefaultDevice() 
    let options: [CIContextOption : Any] = [
        CIContextOption.useSoftwareRenderer: false,
        CIContextOption.outputPremultiplied: false,
    ]
    let context = CIContext(mtlDevice: mtlDevice, options: options)
}

Not sure this is an Xcode debug issue? or an actual issue as we have not seen it crash when not using Xcode to build our app.

Any information as to locating the source of the issue or a solution would be awesome.

Update:

We seem to see messages before the crash that relate to the screen on most crashes.

****[48028:857651] [] [15:53:06.503] FPSupport_GetDisplayRefreshInformation signalled err=-12780 (kCMBaseObjectError_ParamErr) (CGDisplayModeGetRefreshRate returned 0) at FigPlayerSupport.m:3198

****[48028:857658] [] [15:53:06.548] customVideoCompositor_CopyProperty signalled err=-12784 (kFigBaseObjectError_PropertyNotFound) (unrecognised property) at FigVideoCompositor_Custom.c:581

Or this one:

enter image description here

Jory de Kort
  • 262
  • 2
  • 13
  • Crash still occurs on Xcode 13 (13A233) on macOS 12.0.1. Still can't pinpoint where the crash originates. – Jory de Kort Oct 21 '21 at 08:48
  • Also still happens to me with PDFView on MacoS 12.6.3. I can't even access the PDFView from the `NSViewRepresentable` without crashing the app. Did you find a solution? – Fabian Feb 09 '23 at 12:53
  • @Fabian, we did not... We never found why this happened. But never had a client with the crash in release ever. We marked it as Xcode issue.... and went on with our live ;) – Jory de Kort Feb 09 '23 at 13:48
  • Makes sense, thanks! I think it doesn't crash in release because Metal sanity checks are not compiled in there: Edit Scheme -> Diagnostics -> Metal API validation. That's at least what I'm trying out atm :) – Fabian Feb 09 '23 at 18:09
  • You might be right about that indeed. – Jory de Kort Feb 20 '23 at 10:27

0 Answers0