Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 4 Support (Qt 6) › Crash with xcode15 and iOS 17

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #25138

    Nicola

    Hi,

    building simple app (basic from the template) with the last xcode on iOS 17 the app crashes.

    N.

    #25139

    Günther
    Felgo Team

    Hi Nicola,

    thanks for the message. We are looking into Xcode 15 and iOS 17 at the moment. We successfully deployed on iOS 17 with Felgo 4 already, so it could be a problem with Xcode 15.

    Generally, we advise to not update to the latest Xcode right away, because there are often changes that require adaptions from Qt side. E.g. there’s also currently a Qt bug that breaks qmake project builds when using Xcode 15.

    We will let you know as soon as we know more.

    Best,
    Günther

    #25140

    Nicola

    Thanks!

    #25141

    Günther
    Felgo Team

    Hi Nicola,

    can you share the crashlog with us? It will help us to investigate and match with our findings.

    Best,
    Günther

    #25143

    Nicola

    Hi,

    this the error message in xcode (the crash log is here https://drive.google.com/file/d/1AWb8lneYfOQF_O0tQM1dy3bd9RSEHr7Y/view?usp=drive_link)

    QML debugging is enabled. Only use this in a safe environment.
    stale focus object 0x0 , doing manual update
    qml: If you want to remove the Felgo Splash & loading screen, or to use plugins for monetization, analytics, push notifications, social networks & more, generate a license key for your app here: https://felgo.com/licenseKey
    stale focus object 0x0 , doing manual update
    If you want to remove the Felgo Splash & loading screen, or to use plugins for monetization, analytics, push notifications, social networks & more, generate a license key for your app here: https://felgo.com/licenseKey
    Felgo [INFO]: Starting in “test” stage. Note: When you are ready to publish your app to the app stores, switch to Release mode and set the PRODUCT_STAGE in your CMakeLists.txt to “publish”. For more information see: https://felgo.com/doc/felgo-publishing/
    Felgo [INFO]: Starting in “test” stage. Note: When you are ready to publish your app to the app stores, switch to Release mode and set the PRODUCT_STAGE in your CMakeLists.txt to “publish”. For more information see: https://felgo.com/doc/felgo-publishing/
    =================================================================
    Main Thread Checker: UI API called on a background thread: -[UIView layer]
    PID: 1079, TID: 129215, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
    Backtrace:
    4 appuntitled 0x000000010266c028 _ZN15QMetalSwapChain16surfacePixelSizeEv + 48
    5 appuntitled 0x00000001021a7c34 _ZN15QSGRenderThread13syncAndRenderEv + 416
    6 appuntitled 0x00000001021a8d84 _ZN15QSGRenderThread3runEv + 288
    7 appuntitled 0x0000000100750ef4 _ZN14QThreadPrivate5startEPv + 352
    8 libsystem_pthread.dylib 0x00000001f613f4d4 _pthread_start + 136
    9 libsystem_pthread.dylib 0x00000001f613ea10 thread_start + 8
    Main Thread Checker: UI API called on a background thread: -[UIView layer]
    PID: 1079, TID: 129215, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
    Backtrace:
    4 appuntitled 0x000000010266c028 _ZN15QMetalSwapChain16surfacePixelSizeEv + 48
    5 appuntitled 0x00000001021a7c34 _ZN15QSGRenderThread13syncAndRenderEv + 416
    6 appuntitled 0x00000001021a8d84 _ZN15QSGRenderThread3runEv + 288
    7 appuntitled 0x0000000100750ef4 _ZN14QThreadPrivate5startEPv + 352
    8 libsystem_pthread.dylib 0x00000001f613f4d4 _pthread_start + 136
    9 libsystem_pthread.dylib 0x00000001f613ea10 thread_start + 8
    =================================================================
    Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]
    PID: 1079, TID: 129215, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
    Backtrace:
    4 appuntitled 0x00000001023e52cc _ZNK7QWindow16devicePixelRatioEv + 44
    5 appuntitled 0x000000010266c5d4 _ZN15QMetalSwapChain14createOrResizeEv + 752
    6 appuntitled 0x00000001021a823c _ZN15QSGRenderThread13syncAndRenderEv + 1960
    7 appuntitled 0x00000001021a8d84 _ZN15QSGRenderThread3runEv + 288
    8 appuntitled 0x0000000100750ef4 _ZN14QThreadPrivate5startEPv + 352
    9 libsystem_pthread.dylib 0x00000001f613f4d4 _pthread_start + 136
    10 libsystem_pthread.dylib 0x00000001f613ea10 thread_start + 8
    Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]
    PID: 1079, TID: 129215, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
    Backtrace:
    4 appuntitled 0x00000001023e52cc _ZNK7QWindow16devicePixelRatioEv + 44
    5 appuntitled 0x000000010266c5d4 _ZN15QMetalSwapChain14createOrResizeEv + 752
    6 appuntitled 0x00000001021a823c _ZN15QSGRenderThread13syncAndRenderEv + 1960
    7 appuntitled 0x00000001021a8d84 _ZN15QSGRenderThread3runEv + 288
    8 appuntitled 0x0000000100750ef4 _ZN14QThreadPrivate5startEPv + 352
    9 libsystem_pthread.dylib 0x00000001f613f4d4 _pthread_start + 136
    10 libsystem_pthread.dylib 0x00000001f613ea10 thread_start + 8
    Message from debugger: killed

     

    #25148

    Günther
    Felgo Team

    Hi Nicola,

    we’ve looked into the Xcode 15 crash on iOS and are having a hard time to accurately reproduce the problem. The QSGRenderThread warning messages that are shown at startup are related, but they always show up even when no crash happens. This is expected because of how Qt internally handles the rendering.

    In our tests the crash does not happen for any simple Qt or Felgo project. However,it happens more consistently when changing the used graphics API from Metal to OpenGL (in order to e.g. use the MapLibreGL plugin with AppMap). In this case we see that crashes happen at QSGRenderThread::drawTriangle. We reported this QSGRenderThread crash to Qt here: https://bugreports.qt.io/browse/QTBUG-117846

    Potential workaround:
    The project setup and your code may also affect the Qt rendering behavior at app startup in some way. We’ve seen that small arbitrary changes to the C++ code can result in the crash being gone. The compiled application won’t crash anymore then.

    Can you try to apply the change below to your main.cpp, to see if this affects the crash on your side?
    – Comment the line felgo.setLicenseKey(PRODUCT_LICENSE_KEY);

    If you want to set a License Key in your CMakeLists.txt or via Felgo Cloud Builds, you can add this line instead:
    engine.rootContext()->setContextProperty("appLicenseKey", PRODUCT_LICENSE_KEY);

    Does this change has an effect on the crash issue for you?

    I am sorry that we do not have an actual fix, and hope that Qt will investigate and improve their rendering soon to completely avoid this crash.

    #25152

    Nicola

    Hi,

    i missed this message :(, but also with this change, i have the same problem.

    #25220

    Bas

    hi,

    What is the recomended xxcode version to use?

    i am having the same problem with a project that i converted to run with cmake.

    on macos and simulator it runs without a problem, but when i try to run it on IOS device it crashes, at QSGRenderThread::drawTriangle.

    what can i do?

    greetings,

    Bas

    #25222

    Bas

    Hi,

    I updated my iphone to 17.2.1 and did a publish of the app in publish mode.

    now it is working.

    The app uses OneSignal and GameWindow as starting point in QML.

    I did not used “– engine.rootContext()->setContextProperty("appLicenseKey", PRODUCT_LICENSE_KEY);

    cheers,

    Bas

    #25242

    Nicola

    Hi,

    thanks for your test, it’s true the app start, but there is always a “violet” warning in XCode:

    Main Thread Checker
    -[UIView contentScaleFactor] must be used from main thread only

    -[UIView layer] must be used from main thread only

     

    and in the console log i see:

    Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor]
    PID: 30732, TID: 6957133, Thread name: QSGRenderThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
    Backtrace:
    4 apptestfelgo14 0x0000000104e1d14c _ZNK7QWindow16devicePixelRatioEv + 44
    5 apptestfelgo14 0x00000001050a4454 _ZN15QMetalSwapChain14createOrResizeEv + 752
    6 apptestfelgo14 0x0000000104be00bc _ZN15QSGRenderThread13syncAndRenderEv + 1960
    7 apptestfelgo14 0x0000000104be0c04 _ZN15QSGRenderThread3runEv + 288
    8 apptestfelgo14 0x0000000103188f7c _ZN14QThreadPrivate5startEPv + 352
    9 libsystem_pthread.dylib 0x00000002048344d4 _pthread_start + 136
    10 libsystem_pthread.dylib 0x0000000204833a10 thread_start + 8

     

    I tested on a macbook pro M2, last XCode, last OS and last iOS (17.2.1)

    The app (simple test) start sometime very slower (due the main thread problem). Honestly with this type of error is better doesn’t publish app on the store. We push the face on the store not others.

    #25245

    Günther
    Felgo Team

    If I am not mistaken, the problem is introduced at compile-time. It does not matter how often you restart the app, the build either crashes or it doesn’t. So if you have a working build I think it is safe to publish it and the crash won’t happen. But to make sure I would suggest to at least test the build on a few different iOS devices before making it available to the public.

    #25246

    Nicola

    The message is displayed at runtime, and sometime the application start very slowly. I know that’s not from Felgo but from Qt.

    #25247

    Günther
    Felgo Team

    I have noticed a longer startup time when you run the app with Xcode as it seems to take a while for Xcode to attach the debugger. When starting the app normally on-device there’s no such delay, so I don’t see a general problem here.

    #25272

    Günther
    Felgo Team

    Hi Nicola,

    I recently upgraded Xcode to the new version 15.2. So far I did not encounter any crashes at startup with the projects where it could previously crash for me.

    Can you check if you can also get the new Xcode version, and if this version fixes the issue for your project as well?

    I am hoping that the bug is fixed with the new Xcode version, so we can build for iOS without issues again. If that’s the case we can also close the bug report on Qt side.

    Best,
    Günther from Felgo

    #25273

    Nicola

    Hi,

    i’ll test in the night. Tomorrow morning i’ll write the result.

Viewing 15 posts - 1 through 15 (of 17 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded