Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.1
-
None
-
-
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
For Gerrit Dashboard: QTBUG-131957 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
610428,8 | QtQml: Add some consistency to QV4::RegExp | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
610539,5 | Use MAP_JIT on all Apple platforms | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
611969,3 | QtQml: Revert to old executable memory detection for macOS on x86 | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
612427,1 | QtQml: Revert to old executable memory detection for macOS on x86 | 6.9 | qt/qtdeclarative | Status: INTEGRATING | +2 | 0 |
612428,1 | Use MAP_JIT on all Apple platforms | 6.9 | qt/qtdeclarative | Status: INTEGRATING | +2 | 0 |