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

Crash when running a qt quick app on iOS simulator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.2.0 Beta2
    • Fix Version/s: 6.2.0 Beta3, 6.3.0 Alpha
    • Component/s: Qt RHI
    • Labels:
      None
    • Environment:
      Xcode 12.4
      macOS Catalina 10.15.7
      MacBook Pro (16-inch, 2019)
      iOS SDK + Simulator 14.4
    • Platform/s:
      iOS/tvOS/watchOS
    • Commits:
      213755a86622ae8b3ed3d7ad34a6aecd051b2b03 (qt/qtbase/dev) 88373a370ad12c8f81ee3497c5d1d87e70f446ee (qt/qtbase/6.1) 2f753de2d807ee2959e927032c4a5cb6f1238677 (qt/qtbase/6.2)

      Description

      I get a crash when running a simple qt quick app on an iOS Simulator

      Project i tried is qtdeclarative/examples/quick/text, but it repros with other Quick projects as well.

      Configure qt with

      ./qt5/configure -developer-build -xplatform macx-ios-clang -debug-and-release -qt-host-path /path/to/qtbase/ -nomake tests  -- -DQT_BUILD_SUBMODULES="qtdeclarative"
      

      to ensure debug_and_release + universal libs. Otherwise building the project with qmake might not work out.
      Might work with -sdk iphonesimulator only as well though.

      Stack trace

      QSGRenderThread (11)#0	0x00007fff6113133a in __pthread_kill ()
      #1	0x00007fff61166e60 in pthread_kill ()
      #2	0x00007fff200fab94 in abort ()
      #3	0x00007fff200f9e4e in __assert_rtn ()
      #4	0x00007fff36e230f0 in MTLReportFailure.cold.1 ()
      #5	0x00007fff36e0da72 in MTLReportFailure ()
      #6	0x00007fff510ee92c in -[MTLDebugRenderCommandEncoder drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:] ()
      #7	0x0000000112d22b47 in ___lldb_unnamed_symbol1261$$libMTLCapture.dylib ()
      #8	0x000000010e752b53 in QRhiMetal::drawIndexed(QRhiCommandBuffer*, unsigned int, unsigned int, unsigned int, int, unsigned int) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtbase/src/gui/rhi/qrhimetal.mm:1336
      #9	0x000000010e4aeffe in QRhiCommandBuffer::drawIndexed(unsigned int, unsigned int, unsigned int, int, unsigned int) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtbase/src/gui/rhi/qrhi.cpp:5806
      #10	0x000000010deaa9e6 in QSGBatchRenderer::Renderer::renderMergedBatch(QSGBatchRenderer::Renderer::PreparedRenderBatch*, bool) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3126
      #11	0x000000010deae02d in QSGBatchRenderer::Renderer::recordRenderPass(QSGBatchRenderer::Renderer::RenderPassContext*) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3711
      #12	0x000000010deac329 in QSGBatchRenderer::Renderer::render() at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:3410
      #13	0x000000010dedbadf in QSGRenderer::renderScene() at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:176
      #14	0x000000010df1383d in QSGDefaultRenderContext::renderNextRhiFrame(QSGRenderer*) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/qsgdefaultrendercontext.cpp:211
      #15	0x000000010de58bbe in QQuickWindowPrivate::renderSceneGraph(QSize const&, QSize const&) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/items/qquickwindow.cpp:682
      #16	0x000000010e116330 in QSGRenderThread::syncAndRender() at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:785
      #17	0x000000010e11742f in QSGRenderThread::run() at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:986
      #18	0x000000010d8c9ca7 in QThreadPrivate::start(void*) at /Volumes/T3/Dev/qt/qt5_cmake/worktrees/dev/qtbase/src/corelib/thread/qthread_unix.cpp:330
      #19	0x00007fff61167109 in _pthread_start ()
      #20	0x00007fff61162b8b in thread_start ()
      
      

      Log

      2021-08-13 14:21:07.078277+0200 text[98284:1839908] Metal GPU Frame Capture Enabled
      2021-08-13 14:21:07.078470+0200 text[98284:1839908] Metal API Validation Enabled
      2021-08-13 14:21:07.368273+0200 text[98284:1839908] stale focus object 0x0 , doing manual update
      =================================================================
      Main Thread Checker: UI API called on a background thread: -[UIView layer]
      PID: 98284, TID: 1840160, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   text                                0x000000010e7603ef _ZL14layerForWindowP7QWindow + 111
      5   text                                0x000000010e7602ae _ZN15QMetalSwapChain16surfacePixelSizeEv + 94
      6   text                                0x000000010e115b2f _ZN15QSGRenderThread13syncAndRenderEv + 623
      7   text                                0x000000010e11742f _ZN15QSGRenderThread3runEv + 287
      8   text                                0x000000010d8c9ca7 _ZN14QThreadPrivate5startEPv + 807
      9   libsystem_pthread.dylib             0x00007fff61167109 _pthread_start + 148
      10  libsystem_pthread.dylib             0x00007fff61162b8b thread_start + 15
      2021-08-13 14:21:07.531519+0200 text[98284:1840160] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
      PID: 98284, TID: 1840160, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   text                                0x000000010e7603ef _ZL14layerForWindowP7QWindow + 111
      5   text                                0x000000010e7602ae _ZN15QMetalSwapChain16surfacePixelSizeEv + 94
      6   text                                0x000000010e115b2f _ZN15QSGRenderThread13syncAndRenderEv + 623
      7   text                                0x000000010e11742f _ZN15QSGRenderThread3runEv + 287
      8   text                                0x000000010d8c9ca7 _ZN14QThreadPrivate5startEPv + 807
      9   libsystem_pthread.dylib             0x00007fff61167109 _pthread_start + 148
      10  libsystem_pthread.dylib             0x00007fff61162b8b thread_start + 15
      =================================================================
      Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]
      PID: 98284, TID: 1840160, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   text                                0x000000010d9efe64 _ZNK10QIOSWindow16devicePixelRatioEv + 36
      5   text                                0x000000010e350c2d _ZNK7QWindow16devicePixelRatioEv + 93
      6   text                                0x000000010e760d67 _ZN15QMetalSwapChain14createOrResizeEv + 2087
      7   text                                0x000000010e115c43 _ZN15QSGRenderThread13syncAndRenderEv + 899
      8   text                                0x000000010e11742f _ZN15QSGRenderThread3runEv + 287
      9   text                                0x000000010d8c9ca7 _ZN14QThreadPrivate5startEPv + 807
      10  libsystem_pthread.dylib             0x00007fff61167109 _pthread_start + 148
      11  libsystem_pthread.dylib             0x00007fff61162b8b thread_start + 15
      2021-08-13 14:21:07.590854+0200 text[98284:1840160] [reports] Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]
      PID: 98284, TID: 1840160, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   text                                0x000000010d9efe64 _ZNK10QIOSWindow16devicePixelRatioEv + 36
      5   text                                0x000000010e350c2d _ZNK7QWindow16devicePixelRatioEv + 93
      6   text                                0x000000010e760d67 _ZN15QMetalSwapChain14createOrResizeEv + 2087
      7   text                                0x000000010e115c43 _ZN15QSGRenderThread13syncAndRenderEv + 899
      8   text                                0x000000010e11742f _ZN15QSGRenderThread3runEv + 287
      9   text                                0x000000010d8c9ca7 _ZN14QThreadPrivate5startEPv + 807
      10  libsystem_pthread.dylib             0x00007fff61167109 _pthread_start + 148
      11  libsystem_pthread.dylib             0x00007fff61162b8b thread_start + 15
      
      
      2021-08-13 14:21:07.722765+0200 text[98284:1840160] fopen failed for data file: errno = 2 (No such file or directory)
      2021-08-13 14:21:07.722869+0200 text[98284:1840160] Errors found! Invalidating cache...
      2021-08-13 14:21:07.848175+0200 text[98284:1840160] fopen failed for data file: errno = 2 (No such file or directory)
      
      
      2021-08-13 14:21:07.848266+0200 text[98284:1840160] Errors found! Invalidating cache...
      MTLValidateFeatureSupport:3901: failed assertion `Base Vertex Instance Drawing is not supported on this device'
      MTLValidateFeatureSupport:3901: failed assertion `Base Vertex Instance Drawing is not supported on this device'
      
      CoreSimulator 732.18.6 - Device: iPhone SE (2nd generation) (9CF78864-E6AB-4FBC-B069-92356D2E7E5E) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone SE (2nd generation)
      (lldb) 
      

      Line that crashed

      
      void QRhiMetal::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
                                  quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
      {
      ...
      
      [cbD->d->currentRenderPassEncoder drawIndexedPrimitives: QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline)->d->primitiveType
            indexCount: indexCount
            indexType: cbD->currentIndexFormat == QRhiCommandBuffer::IndexUInt16 ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32
            indexBuffer: mtlbuf
            indexBufferOffset: indexOffset
            instanceCount: instanceCount
            baseVertex: vertexOffset
            baseInstance: firstInstance];
      

      Searching on the internet for

      MTLValidateFeatureSupport:3901: failed assertion `Base Vertex Instance Drawing is not supported on this device'
      

      doesn't give any results.

      Github search is pretty sparse too
      https://github.com/search?q=MTLValidateFeatureSupport

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes