JS JIT crash, Entitlements.plist and CI

I'm getting the following crash in my app

Incident Identifier: 5321CD04-430E-4B10-9467-F416E792F3D6
CrashReporter Key:   1414d117f3d2793f073dc033c9395dccac5f6020
Hardware Model:      iPad12,1
Process:             XxXxXx [591]
Path:                /private/var/containers/Bundle/Application/8A296C9B-52EF-4288-B102-58868A7FD139/XxXxXx.app/XxXxXx
Identifier:          co.XxXxXx.XxXxXx.J873G84M8Q
Version:             1.10 (1.10.6)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           uk.co.XxXxXx.XxXxXx.J873G84M8Q [522]

Date/Time:           2024-07-22 14:37:00.3901 +0100
Launch Time:         2024-07-22 14:37:00.1082 +0100
OS Version:          iPhone OS 17.2 (21C62)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000010c61c000
Exception Codes: 0x0000000000000002, 0x000000010c61c000
VM Region Info: 0x10c61c000 is in 0x10c61c000-0x10c620000;  bytes after start: 0  bytes before end: 16383
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_LARGE             10c5e4000-10c61c000 [  224K] rw-/rwx SM=PRV  
--->  JS JIT generated code    10c61c000-10c620000 [   16K] r--/rw- SM=PRV  
      GAP OF 0x613cc000 BYTES
      Stack Guard              16d9ec000-16d9f0000 [   16K] ---/rwx SM=NUL  
Termination Reason: SIGNAL 10 Bus error: 10
Terminating Process: exc handler [591]

Triggered by Thread:  0

I'm assuming that I need to add the following entitlement to Entitlements.plist

    <key>com.apple.security.cs.allow-jit</key>
    <true/>

From within XCode I can see how to do this, what I can't figure out is how to do the same thing on our CI server without manually managing the signing process of the application using codesign.

How can I add the above entitlement to my application using xcodebuild or is this even possible?

iOS does not, in general, support JITed code. The only exception to that rule is for folks building web browsers. See Protecting code compiled just in time. Do you fall under that exception?

Most folks who encounter problems like this are using third-party tooling that uses JIT on other platfroms. To get those tools to work on iOS, you have to disable the JIT. How you do that is specific to those tools. If you are using third-party tools and you need help disabling the JIT, I recommend that you seek it via the support channel for your tooling.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The app uses QT and has a QML front end (QT's version of Javascript for the UI).

What has me stumped is we have previously built the app using XCode 14.3.1 without issue, so this isn't a new project that we've never built before but one that we're trying to migrate to XCode 15.3 but we're getting this JIT crash now.

Has anything changed regarding security or privileges for JIT between xcode 14.3.1 and 15.3?

JS JIT crash, Entitlements.plist and CI
 
 
Q