Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115182

[Mac] Crash in QSGRenderThread - MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5, 6.6, 6.7
    • 6.5.1, 6.5.2
    • Qt RHI
    • None
    • MacBook Pro 2021 Apple M1 Pro
      macOS 13.4.1, 13.5.2
      Qt 6.5.1 (x86_64), 6.5.2 (x86_64)
    • macOS
    • cb8f812e6cc6cab374075fdd81b5d6f5f40e8a40

    Description

      A sporadic crash, unknown steps.

      Xcode output:

      -[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2885: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7f8529a8f000 (label: <no label set>):
      <MTLToolsObject: 0x7f84cabb8210> -> <AGXG13XFamilyTexture: 0x7f84cababb50>
          label = CAMetalLayer Drawable 
          textureType = MTLTextureType2D 
          pixelFormat = MTLPixelFormatBGRA8Unorm 
          width = 1890 
          height = 1560 
          depth = 1 
          arrayLength = 1 
          mipmapLevelCount = 1 
          sampleCount = 1 
          cpuCacheMode = MTLCPUCacheModeDefaultCache 
          storageMode = MTLStorageModeManaged 
          hazardTrackingMode = MTLHazardTrackingModeTracked 
          resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeManaged MTLResourceHazardTrackingModeTracked  
          usage = MTLTextureUsageShaderRead MTLTextureUsageShaderWrite MTLTextureUsageRenderTarget MTLTextureUsagePixelFormatView 
          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 = 0x600000aad670 
          iosurfacePlane = 0 
          allowGPUOptimizedContents = YES'
      Message from debugger: Terminated due to signal 6
      

      Stack trace:

      Crashed Thread: 51 QSGRenderThread

      Exception Type: EXC_CRASH (SIGABRT)
      Exception Codes: 0x0000000000000000, 0x0000000000000000

      Thread 51 Crashed:: QSGRenderThread
      0   ???                           	    0x7ff891a8a9a8 ???
      1   libsystem_kernel.dylib        	    0x7ff801e5b1f2 __pthread_kill + 10
      2   libsystem_pthread.dylib       	       0x131cde5c2 pthread_kill + 263
      3   libsystem_c.dylib             	    0x7ff801db9b45 abort + 123
      4   libsystem_c.dylib             	    0x7ff801db8e5e __assert_rtn + 314
      5   Metal                         	    0x7ff80bb50202 MTLReportFailure.cold.1 + 43
      6   Metal                         	    0x7ff80bb2bcaf MTLReportFailure + 529
      7   MetalTools                    	    0x7ff8026a112d -[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:] + 379
      8   MetalTools                    	    0x7ff802641705 -[MTLToolsObject dealloc] + 41
      9   MetalTools                    	    0x7ff80265960b -[MTLToolsResource dealloc] + 81
      10  MetalTools                    	    0x7ff802659e7b -[MTLToolsTexture dealloc] + 93
      11  MetalTools                    	    0x7ff8026ddd74 -[MTLDebugTexture dealloc] + 141
      12  GPUToolsCapture               	       0x1325c2f75 -[CaptureMTLTexture dealloc] + 37
      13  QuartzCore                    	    0x7ff809d1223b -[CAMetalDrawable dealloc] + 346
      14  CoreFoundation                	    0x7ff801f13a1d __RELEASE_OBJECTS_IN_THE_ARRAY__ + 131
      15  CoreFoundation                	    0x7ff801f13953 -[__NSArrayM dealloc] + 130
      16  QuartzCore                    	    0x7ff809f23e13 layer_composited(_CAImageQueue*, void*, unsigned int, unsigned int) + 786
      17  QuartzCore                    	    0x7ff809d1205b CAImageQueueDidComposite + 216
      18  QuartzCore                    	    0x7ff809d1541b release_images(_CAImageQueue*, CAImageQueueReleased*) + 431
      19  QuartzCore                    	    0x7ff809ce60e1 CAImageQueueCollect_ + 318
      20  QuartzCore                    	    0x7ff809ce9341 -[CAMetalLayer nextDrawable] + 524
      21  GPUToolsCapture               	       0x13257056d CAMetalLayer_nextDrawable + 147
      22  QtGui                         	       0x13b06ec20 QRhiMetal::beginPass(QRhiCommandBuffer*, QRhiRenderTarget*, QColor const&, QRhiDepthStencilClearValue const&, QRhiResourceUpdateBatch*, QFlags<QRhiCommandBuffer::BeginPassFlag>) + 240
      23  QtGui                         	       0x13ae2053b QRhiCommandBuffer::beginPass(QRhiRenderTarget*, QColor const&, QRhiDepthStencilClearValue const&, QRhiResourceUpdateBatch*, QFlags<QRhiCommandBuffer::BeginPassFlag>) + 43
      24  QtQuick                       	       0x1381741e1 QSGBatchRenderer::Renderer::render() + 81
      25  QtQuick                       	       0x13818c2ce QSGRenderer::renderScene() + 302
      26  QtQuick                       	       0x13813964d QQuickWindowPrivate::renderSceneGraph() + 893
      27  QtQuick                       	       0x1382e1437 QSGRenderThread::syncAndRender() + 967
      28  QtQuick                       	       0x1382e23d1 QSGRenderThread::run() + 273
      29  QtCore                        	       0x13c7d2fa3 QThreadPrivate::start(void*) + 323
      30  libsystem_pthread.dylib       	       0x131cdd7eb _pthread_start + 125
      31  libsystem_pthread.dylib       	       0x131ce5bef thread_start + 15
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              lagocs Laszlo Agocs
              sergei.nevdakh Sergei Nevdakh
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change