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

QSGRenderThread crashes on iOS with Xcode 15

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      When building Qt Quick apps for iOS with Xcode 15 we have seen random crashes at application startup at a call of QSGRenderThread::drawTriangle. (see attached screenshot and crashlog)

      It does not happen on the simulator, but occurs on real devices. I believe the crash must be related to visible warnings from the Xcode MainThread checker. (UI API called on a background thread) 

      Main Thread Checker: UI API called on a background thread: -[UIView layer]PID: 1285, TID: 167649, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0Backtrace:4   appPlayground                      0x00000001017012e8 _ZN11QIOSContext11makeCurrentEP16QPlatformSurface + 3525   appPlayground                      0x0000000102b689d4 _ZN14QOpenGLContext11makeCurrentEP8QSurface + 1766   appPlayground                      0x0000000102b73254 _ZNK9QRhiGles213ensureContextEP8QSurface + 1367   appPlayground                      0x0000000102b734bc _ZN9QRhiGles26createE6QFlagsIN4QRhi4FlagEE + 4448   appPlayground                      0x0000000102a98ef4 _ZN4QRhi6createENS_14ImplementationEP14QRhiInitParams6QFlagsINS_4FlagEEP17QRhiNativeHandles + 2409   appPlayground                      0x0000000102690bc4 _ZN13QSGRhiSupport9createRhiEP12QQuickWindowP8QSurface + 43210  appPlayground                      0x0000000102768c7c _ZN15QSGRenderThread9ensureRhiEv + 31211  appPlayground                      0x0000000102768f84 _ZN15QSGRenderThread3runEv + 28012  appPlayground                      0x0000000100d10f00 _ZN14QThreadPrivate5startEPv + 35213  libsystem_pthread.dylib             0x000000021ba4a6b8 _pthread_start + 14814  libsystem_pthread.dylib             0x000000021ba49b88 thread_start + 82023-10-03 19:06:00.484841+0200 appPlayground[1285:167649] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]PID: 1285, TID: 167649, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0Backtrace:4   appPlayground                      0x00000001017012e8 _ZN11QIOSContext11makeCurrentEP16QPlatformSurface + 3525   appPlayground                      0x0000000102b689d4 _ZN14QOpenGLContext11makeCurrentEP8QSurface + 1766   appPlayground                      0x0000000102b73254 _ZNK9QRhiGles213ensureContextEP8QSurface + 1367   appPlayground                      0x0000000102b734bc _ZN9QRhiGles26createE6QFlagsIN4QRhi4FlagEE + 4448   appPlayground                      0x0000000102a98ef4 _ZN4QRhi6createENS_14ImplementationEP14QRhiInitParams6QFlagsINS_4FlagEEP17QRhiNativeHandles + 2409   appPlayground                      0x0000000102690bc4 _ZN13QSGRhiSupport9createRhiEP12QQuickWindowP8QSurface + 43210  appPlayground                      0x0000000102768c7c _ZN15QSGRenderThread9ensureRhiEv + 31211  appPlayground                      0x0000000102768f84 _ZN15QSGRenderThread3runEv + 28012  appPlayground                      0x0000000100d10f00 _ZN14QThreadPrivate5startEPv + 35213  libsystem_pthread.dylib             0x000000021ba4a6b8 _pthread_start + 14814  libsystem_pthread.dylib             0x000000021ba49b88 thread_start + 8=================================================================Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]PID: 1285, TID: 167649, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0Backtrace:4   appPlayground                      0x00000001029a54d4 _ZNK7QWindow16devicePixelRatioEv + 445   appPlayground                      0x0000000102b852b4 _ZN15QGles2SwapChain16surfacePixelSizeEv + 526   appPlayground                      0x0000000102767e3c _ZN15QSGRenderThread13syncAndRenderEv + 4167   appPlayground                      0x0000000102768f8c _ZN15QSGRenderThread3runEv + 2888   appPlayground                      0x0000000100d10f00 _ZN14QThreadPrivate5startEPv + 3529   libsystem_pthread.dylib             0x000000021ba4a6b8 _pthread_start + 14810  libsystem_pthread.dylib             0x000000021ba49b88 thread_start + 82023-10-03 19:06:03.417390+0200 appPlayground[1285:167649] [reports] Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]PID: 1285, TID: 167649, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0Backtrace:4   appPlayground                      0x00000001029a54d4 _ZNK7QWindow16devicePixelRatioEv + 445   appPlayground                      0x0000000102b852b4 _ZN15QGles2SwapChain16surfacePixelSizeEv + 526   appPlayground                      0x0000000102767e3c _ZN15QSGRenderThread13syncAndRenderEv + 4167   appPlayground                      0x0000000102768f8c _ZN15QSGRenderThread3runEv + 2888   appPlayground                      0x0000000100d10f00 _ZN14QThreadPrivate5startEPv + 3529   libsystem_pthread.dylib             0x000000021ba4a6b8 _pthread_start + 14810  libsystem_pthread.dylib             0x000000021ba49b88 thread_start + 8

      So far we are unable to accurately reproduce the crash with simple example projects. Small changes to the code and rebuilding can have a random effect, so the crash might not happen anymore.

      From what we see the problem seems to arise at compile-time, as the application will consistently crash if it is broken, or never crash if the current setup/code works out somehow.

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            GTDev Günther Teufl
            Votes:
            8 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes