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

[REG 6.8.0 → 6.8.1] QML applications crash on macOS 12 (x86)

    XMLWordPrintable

Details

    • macOS
    • b4b691b04 (dev), caf7f29f3 (dev), 4f64760f3 (dev)

    Description

      QML applications crash on macOS 12 (x86), probably due to JIT code which is rejected by macOS. macOS 12 is listed as supported target platform for Qt 6.8.

      Here's a part of the crash report (full file attached):

       

      Crashed Thread:        0  Dispatch queue: com.apple.main-thread
      
      Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
      Exception Codes:       UNKNOWN_0x32 at 0x000000010c2bd000
      Exception Codes:       0x0000000000000032, 0x000000010c2bd000
      Exception Note:        EXC_CORPSE_NOTIFY
      
      Termination Reason:    Namespace CODESIGNING, Code 2
      
      VM Region Info: 0x10c2bd000 is in 0x10c2bd000-0x10c2be000;  bytes after start: 0  bytes before end: 4095
            REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
            VM_ALLOCATE                 10c2bb000-10c2bc000    [    4K] rw-/rwx SM=PRV  
            GAP OF 0x1000 BYTES
      --->  JS JIT generated code       10c2bd000-10c2be000    [    4K] r-x/rwx SM=PRV  
            GAP OF 0x4000 BYTES
            __TEXT                      10c2c2000-10c406000    [ 1296K] r-x/rwx SM=COW  ...s/A/QtNetwork
      
      Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
      0   ???               0x10c2bd000 ???
      1   QtQml             0x10cacf5bf 0x10c907000 + 1869247
      2   QtQml             0x10ca0b675 0x10c907000 + 1066613
      3   QtQml             0x10cb6fcf5 QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) + 613
      4   QtQml             0x10cb0e00c QQmlBinding::doUpdate(QQmlJavaScriptExpression::DeleteWatcher) + 300
      5   QtQml             0x10cb0bc07 QQmlBinding::update(QFlags<QQmlPropertyData::WriteFlag>) + 327
       

       

      This bug was introduced with Qt 6.8.1 with the following change: https://codereview.qt-project.org/c/qt/qtdeclarative/+/599702

      Up to Qt 6.8.0 the method canAllocateExecutableMemory() returned false on macOS 12 (x86), since Qt 6.8.1 it returns true, which later leads to the crash.
      (Note: on macOS 14 (x86) the method returns `true` for both Qt versions, but the app does not crash.)

      The crash can be reproduced using the Qt example "calqlatrexample". Add the following changes to its CMakeLists.txt:

      enable support for macOS 12:

      set(CMAKE_OSX_DEPLOYMENT_TARGET "12")

      install entitlements file (file attached):

      install(FILES app.entitlements
              DESTINATION "${CMAKE_INSTALL_PREFIX}/$<TARGET_BUNDLE_DIR_NAME:calqlatrexample>/Contents/Resources") 

      enable macdeployqt code signing by adding this line to qt_generate_deploy_qml_app_script():

      DEPLOY_TOOL_OPTIONS "-sign-for-notarization=YOURCODESIGNID" 

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            jgrill Joachim Grill
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes