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

QML Camera unloading crash on iOS

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • cb8f812e6 (dev), e900ec338 (6.7), b1ecf6c81 (6.6), b0ad82b5a (tqtc/lts-6.5), aadb05820 (dev), d7329f874 (6.8), 7756d875d (6.7)

    Description

      I found a crash on iOS during camera unloading in 6.6.1 and 6.7 beta

      takes a lot more tries to get it to happen but repeatly closing and opening the camera will get it to happen eventually.

      you should be able to reproduce it with the upload main.qml

      this is the crash from an iphone 13 on 6.6.1

      -[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:3190: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x11033fc00 (label: <no label set>):
      <MTLToolsObject: 0x134c4b3f0> -> <AGXG14FamilyTexture: 0x134cd3fd0>
          label = CoreVideo 0x281d8c3c0 
          textureType = MTLTextureType2D 
          pixelFormat = MTLPixelFormatR8Unorm 
          width = 3024 
          height = 4032 
          depth = 1 
          arrayLength = 1 
          mipmapLevelCount = 1 
          sampleCount = 1 
          cpuCacheMode = MTLCPUCacheModeDefaultCache 
          storageMode = MTLStorageModeShared 
          hazardTrackingMode = MTLHazardTrackingModeTracked 
          resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeShared 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 = 0x28058c920 
          iosurfacePlane = 0 
          allowGPUOptimizedContents = YES' 

       

      Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness * thread #10, name = 'QSGRenderThread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc8)
        * frame #0: 0x00000001dc5f2aac AGXMetalA9`___lldb_unnamed_symbol639 + 100
          frame #1: 0x00000001dc5ee350 AGXMetalA9`___lldb_unnamed_symbol596 + 132
          frame #2: 0x000000010388af2c OverLoadQmlTypes`QRhiMetal::enqueueSubresUpload(this=0x0000000108e08eb0, texD=0x00000002804371e0, mp=0x0000000115b04000, blitEncPtr=0x0000000280b0d560, layer=0, level=0, subresDesc=0x0000000280b0d990, curOfs=0x000000016fa7dd48) at qrhimetal.mm:2614:9
          frame #3: 0x000000010388b810 OverLoadQmlTypes`QRhiMetal::enqueueResourceUpdates(this=0x0000000108e08eb0, cb=0x0000000108d08978, resourceUpdates=0x0000000282d34040) at qrhimetal.mm:2709:25
          frame #4: 0x000000010388c684 OverLoadQmlTypes`QRhiMetal::resourceUpdate(this=0x0000000108e08eb0, cb=0x0000000108d08978, resourceUpdates=0x0000000282d34040) at qrhimetal.mm:2845:5
          frame #5: 0x00000001035ce450 OverLoadQmlTypes`QRhiCommandBuffer::resourceUpdate(this=0x0000000108d08978, resourceUpdates=0x0000000282d34040) at qrhi.cpp:8814:16
          frame #6: 0x0000000101d7e520 OverLoadQmlTypes`QSGBatchRenderer::Renderer::prepareRenderPass(this=0x000000010989a000, ctx=0x000000010989a348) at qsgbatchrenderer.cpp:3786:24
          frame #7: 0x0000000101d7cea4 OverLoadQmlTypes`QSGBatchRenderer::Renderer::render(this=0x000000010989a000) at qsgbatchrenderer.cpp:3527:5
          frame #8: 0x0000000101db6690 OverLoadQmlTypes`QSGRenderer::renderScene(this=0x000000010989a000) at qsgrenderer.cpp:147:5
          frame #9: 0x0000000101df42d0 OverLoadQmlTypes`QSGDefaultRenderContext::renderNextFrame(this=0x0000000281a11d40, renderer=0x000000010989a000) at qsgdefaultrendercontext.cpp:174:15
          frame #10: 0x0000000101d16f38 OverLoadQmlTypes`QQuickWindowPrivate::renderSceneGraph(this=0x0000000108e6e410) at qquickwindow.cpp:654:14
          frame #11: 0x0000000102075a18 OverLoadQmlTypes`QSGRenderThread::syncAndRender(this=0x0000000281416ff0) at qsgthreadedrenderloop.cpp:734:12
          frame #12: 0x0000000102076bc0 OverLoadQmlTypes`QSGRenderThread::run(this=0x0000000281416ff0) at qsgthreadedrenderloop.cpp:946:13
          frame #13: 0x000000010138adfc OverLoadQmlTypes`QThreadPrivate::start(void*)::$_0::operator()(this=0x000000016fa7ef90) const at qthread_unix.cpp:324:14
          frame #14: 0x00000001013899ac OverLoadQmlTypes`void (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::$_0>(t=0x000000016fa7ef90) at qthread_unix.cpp:260:9
          frame #15: 0x000000010138993c OverLoadQmlTypes`QThreadPrivate::start(arg=0x0000000281416ff0) at qthread_unix.cpp:283:5
          frame #16: 0x00000001dc07a338 libsystem_pthread.dylib`_pthread_start + 116

      this is the logs, tested from an iphone 7 on qt 6.7.0 beta

      ->  0x107496f2c <+3156>: b      0x107496f30               ; <+3160> at qrhimetal.mm 
      2023-12-22 15:23:03.923702-0600 OverLoadQmlTypes[387:10328] Metal API Validation Enabled 2023-12-22 15:23:04.230427-0600 OverLoadQmlTypes[387:10328] stale focus object 0x0 , doing manual update 2023-12-22 15:23:04.274798-0600 OverLoadQmlTypes[387:10551] fopen failed for data file: errno = 2 (No such file or directory) 2023-12-22 15:23:04.274891-0600 OverLoadQmlTypes[387:10551] Errors found! Invalidating cache... 2023-12-22 15:23:04.712701-0600 OverLoadQmlTypes[387:10551] fopen failed for data file: errno = 2 (No such file or directory) 2023-12-22 15:23:04.712797-0600 OverLoadQmlTypes[387:10551] Errors found! Invalidating cache... 2023-12-22 15:23:09.633882-0600 OverLoadQmlTypes[387:10328] stale focus object 0x280556ae0 , doing manual update 2023-12-22 15:23:11.471229-0600 OverLoadQmlTypes[387:10551] texture creation failed -6661 2023-12-22 15:23:11.471972-0600 OverLoadQmlTypes[387:10551] texture creation failed -6661
       
      

      Attachments

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              norman.dubert Norman Dubert
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: