MapKit crash on Catalyst after resizing the window

Hi,

I am faced with a strange problem with a Catalyst app that uses MapKit.

If the map is visible and I resize the window (causing the map the resize), sometime the app crashes with some Metal related error.

Is this a know issue between MapKit and Catalyst? There is something I can do in order to prevent this crash?

Below you can find the error message and a screenshot of the thread that caused the crash.

Thank you

-[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2951: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7f96de27f600 (label: <no label set>):
<MTLToolsObject: 0x7f96dde552e0> -> <BronzeMtlTexture: 0x7f96dc04c230>
    label = <none> 
    textureType = MTLTextureType2D 
    pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB 
    width = 2372 
    height = 1668 
    depth = 1 
    arrayLength = 1 
    mipmapLevelCount = 1 
    sampleCount = 1 
    cpuCacheMode = MTLCPUCacheModeDefaultCache 
    storageMode = MTLStorageModeManaged 
    hazardTrackingMode = MTLHazardTrackingModeTracked 
    resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeManaged MTLResourceHazardTrackingModeTracked  
    usage = MTLTextureUsageShaderRead MTLTextureUsageRenderTarget 
    shareable = 0 
    framebufferOnly = 0 
    purgeableState = MTLPurgeableStateNonVolatile 
    swizzle = [MTLTextureSwizzleRed, MTLTextureSwizzleGreen, MTLTextureSwizzleBlue, MTLTextureSwizzleAlpha] 
    isCompressed = 0 
    parentTexture = <null> 
    parentRelativeLevel = 0 
    parentRelativeSlice = 0 
    buffer = <null> 
    bufferOffset = 0 
    bufferBytesPerRow = 0 
    iosurface = 0x0 
    iosurfacePlane = 0 
    allowGPUOptimizedContents = YES'

  • I experience the same problem as you describe.

Add a Comment

Accepted Reply

In Xcode, in the "Product" Menu, go to "Scheme", then "Edit Scheme...". In the left panel select "Run (Debug)" and in Diagnostic tab uncheck "API Validation" under Metal settings.

  • Thank you javman!

  • This fixed my issue exactly the same as the original poster. My issue was basically the exact circumstances but in MapKit in the iPadOS16 environment rather than Catalyst as was the case for the OP. Everything builds fine and runs perfectly however some system events such as a device orientation change cause this error & SIGABRT. Thank you for sharing your fix!

Add a Comment

Replies

In Xcode, in the "Product" Menu, go to "Scheme", then "Edit Scheme...". In the left panel select "Run (Debug)" and in Diagnostic tab uncheck "API Validation" under Metal settings.

  • Thank you javman!

  • This fixed my issue exactly the same as the original poster. My issue was basically the exact circumstances but in MapKit in the iPadOS16 environment rather than Catalyst as was the case for the OP. Everything builds fine and runs perfectly however some system events such as a device orientation change cause this error & SIGABRT. Thank you for sharing your fix!

Add a Comment

I had exactly the same problem. Thank you!