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

xCode 10: Test target Main Thread Checker crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.0 RC
    • 5.11.1, 5.11.2
    • QPA
    • None
    • iOS/tvOS/watchOS
    • 74828aa657bda447c4a3f232688819333eb422df (qt/qtbase/5.12)

    Description

      xCode 9 introduced a new tool which checks UI thread access: https://developer.apple.com/documentation/code_diagnostics/main_thread_checker.

      When executing tests on a Qt project from xCode then the checker outputs several warnings like this:

      =================================================================
      Main Thread Checker: UI API called on a background thread: -[UIView layer]
      PID: 28246, TID: 15743208, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   MyApp                  0x000000010b389617 _ZNK10QIOSWindow9eaglLayerEv + 39
      5   MyApp                  0x000000010b3934c1 _ZNK11QIOSContext23needsRenderbufferResizeEP16QPlatformSurface + 145
      6   MyApp                  0x000000010b392d97 _ZN11QIOSContext11makeCurrentEP16QPlatformSurface + 567
      7   MyApp                  0x000000010b39380c _ZThn16_N11QIOSContext11makeCurrentEP16QPlatformSurface + 44
      8   MyApp                  0x000000010c442cea _ZN14QOpenGLContext11makeCurrentEP8QSurface + 458
      9   MyApp                  0x000000010c18e2af _ZN15QSGRenderThread3runEv + 399
      10  MyApp                  0x000000010cc995f4 _ZN14QThreadPrivate5startEPv + 900
      11  libsystem_pthread.dylib             0x0000000116cb2661 _pthread_body + 340
      12  libsystem_pthread.dylib             0x0000000116cb250d _pthread_body + 0
      13  libsystem_pthread.dylib             0x0000000116cb1bf9 thread_start + 13
      2018-11-07 10:53:53.562838+0100 MyApp[28246:15743208] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
      PID: 28246, TID: 15743208, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
      Backtrace:
      4   MyApp                  0x000000010b389617 _ZNK10QIOSWindow9eaglLayerEv + 39
      5   MyApp                  0x000000010b3934c1 _ZNK11QIOSContext23needsRenderbufferResizeEP16QPlatformSurface + 145
      6   MyApp                  0x000000010b392d97 _ZN11QIOSContext11makeCurrentEP16QPlatformSurface + 567
      7   MyApp                  0x000000010b39380c _ZThn16_N11QIOSContext11makeCurrentEP16QPlatformSurface + 44
      8   MyApp                  0x000000010c442cea _ZN14QOpenGLContext11makeCurrentEP8QSurface + 458
      9   MyApp                  0x000000010c18e2af _ZN15QSGRenderThread3runEv + 399
      10  MyApp                  0x000000010cc995f4 _ZN14QThreadPrivate5startEPv + 900
      11  libsystem_pthread.dylib             0x0000000116cb2661 _pthread_body + 340
      12  libsystem_pthread.dylib             0x0000000116cb250d _pthread_body + 0
      13  libsystem_pthread.dylib             0x0000000116cb1bf9 thread_start + 13
      

      Main Thread checker have already been disabled for the app target in : https://bugreports.qt.io/browse/QTBUG-63822 but it was not disabled for the test target .

      By applying this patch to qtbase, this issue will be fixed :
      patch.diff

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            csaba_szigeti_pix4d Csaba Szigeti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes