Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: QTads crashes on launch when I build from source on Apple Silicon #25

Open
dfabulich opened this issue Jan 17, 2024 · 3 comments

Comments

@dfabulich
Copy link

I'm on macOS Sonoma 14.2.1, on Apple Silicon M1 (ARM) CPU.

I worked around #23 buy installing QT 5 via Homebrew.

brew install qt@5
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
qmake
make macdist

It compiled and linked without errors, but when I double-click on QTads.app, it crashes on launch.

Crash Report
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               QTads [48985]
Path:                  /private/tmp/*/QTads.app/Contents/MacOS/QTads
Identifier:            nikos.chantziaras.qtads
Version:               3.4.0 (3.4.0)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-01-16 17:52:47.3488 -0800
OS Version:            macOS 14.2.1 (23C71)
Report Version:        12
Anonymous UUID:        C2FF76FC-D056-C33D-A521-B3077F55D9E9

Sleep/Wake UUID:       0F951567-92EE-482E-9A60-4F4E8C03767C

Time Awake Since Boot: 59000 seconds
Time Since Wake:       4836 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000102b64000
Exception Codes:       0x0000000000000032, 0x0000000102b64000

Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page

VM Region Info: 0x102b64000 is in 0x102b64000-0x102cac000;  bytes after start: 0  bytes before end: 1343487
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      dyld private memory         102b60000-102b64000    [   16K] ---/--- SM=NUL  
--->  mapped file                 102b64000-102cac000    [ 1312K] r--/rwx SM=COW  ...t_id=82794ee1
      GAP OF 0x67020000 BYTES
      Stack Guard                 169ccc000-16d4d0000    [ 56.0M] ---/rwx SM=NUL  

Thread 0 Crashed:
0   dyld                          	       0x185e3d508 dyld3::MachOFile::hasMachOMagic() const + 0
1   dyld                          	       0x185e1063c dyld4::SyscallDelegate::mapFileReadOnly(Diagnostics&, char const*, unsigned long*, dyld4::FileID*, bool*, char*) const + 228
2   dyld                          	       0x185e0ffa0 dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const + 88
3   dyld                          	       0x185e09000 dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*) + 208
4   dyld                          	       0x185dfdfe8 dyld4::Loader::makeDiskLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*) + 172
5   dyld                          	       0x185dff584 invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 2056
6   dyld                          	       0x185dfe694 dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 776
7   dyld                          	       0x185debb8c dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const + 556
8   dyld                          	       0x185dfe1cc dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) + 248
9   dyld                          	       0x185dfe9fc dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&) + 808
10  dyld                          	       0x185e06f2c invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 412
11  dyld                          	       0x185e3dcd0 invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 148
12  dyld                          	       0x185de52fc dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 300
13  dyld                          	       0x185e3db04 dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const + 172
14  dyld                          	       0x185e06c70 dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&) + 164
15  dyld                          	       0x185de97c0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 1176
16  dyld                          	       0x185de8edc start + 1844


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000102b64000   x1: 0x0000000000000000   x2: 0x000000016dcc9be8   x3: 0x0000000000040002
    x4: 0x0000000000000003   x5: 0x0000000000000000   x6: 0x000000016dcc9be8   x7: 0x0000000000000fd0
    x8: 0x000000016dcc9a80   x9: 0x000000016dcc9a88  x10: 0x000000000100000e  x11: 0x0000000000000001
   x12: 0x000000016dcca282  x13: 0x0000000000000000  x14: 0x00000002402f1272  x15: 0x0000000000008000
   x16: 0x000000000000005c  x17: 0x0000000185de6f90  x18: 0x0000000000000000  x19: 0x000000016dcca170
   x20: 0x0000000000000003  x21: 0x000000016dcc9bbf  x22: 0x0000000102b64000  x23: 0x000000016dcc9be8
   x24: 0x000000016dcc9bc0  x25: 0x000000016dcc9be0  x26: 0x000000016dcca080  x27: 0x0000000102b22db8
   x28: 0x0000000000000000   fp: 0x000000016dcc9ba0   lr: 0x0000000185e1063c
    sp: 0x000000016dcc9a80   pc: 0x0000000185e3d508 cpsr: 0x80001000
   far: 0x0000000102b64000  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x102134000 -        0x102633fff nikos.chantziaras.qtads (3.4.0) <79573514-81b2-3fe2-a902-df68a41d99b8> /private/tmp/*/QTads.app/Contents/MacOS/QTads
       0x185de3000 -        0x185e77347 dyld (*) <324e4ad9-e01f-3183-b09f-3e20b326643a> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=897.6M resident=0K(0%) swapped_out_or_unallocated=897.6M(100%)
Writable regions: Total=12.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=12.2M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
__DATA                             123K        3 
__DATA_CONST                       198K        2 
__DATA_DIRTY                         7K        1 
__LINKEDIT                       892.0M        2 
__TEXT                            5716K        2 
dyld private memory               4384K        4 
mapped file                       1312K        1 
===========                     =======  ======= 
TOTAL                            967.4M       17 



-----------
Full Report
-----------

{"app_name":"QTads","timestamp":"2024-01-16 17:52:47.00 -0800","app_version":"3.4.0","slice_uuid":"79573514-81b2-3fe2-a902-df68a41d99b8","build_version":"3.4.0","platform":1,"bundleID":"nikos.chantziaras.qtads","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 14.2.1 (23C71)","roots_installed":0,"name":"QTads","incident_id":"845E1164-3970-445A-982C-93BAEB27C6F1"}
{
  "uptime" : 59000,
  "procRole" : "Default",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,2",
  "coalitionID" : 6463,
  "osVersion" : {
    "train" : "macOS 14.2.1",
    "build" : "23C71",
    "releaseType" : "User"
  },
  "captureTime" : "2024-01-16 17:52:47.3488 -0800",
  "codeSigningMonitor" : 1,
  "incident" : "845E1164-3970-445A-982C-93BAEB27C6F1",
  "pid" : 48985,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-01-16 17:52:47.3210 -0800",
  "procStartAbsTime" : 1430835815401,
  "procExitAbsTime" : 1430836114488,
  "procName" : "QTads",
  "procPath" : "\/private\/tmp\/*\/QTads.app\/Contents\/MacOS\/QTads",
  "bundleInfo" : {"CFBundleShortVersionString":"3.4.0","CFBundleVersion":"3.4.0","CFBundleIdentifier":"nikos.chantziaras.qtads"},
  "storeInfo" : {"deviceIdentifierForVendor":"AF7A5081-C271-5B74-826A-AF1FD5929F2C","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "nikos.chantziaras.qtads",
  "crashReporterKey" : "C2FF76FC-D056-C33D-A521-B3077F55D9E9",
  "codeSigningID" : "QTads",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 587334144,
  "codeSigningValidationCategory" : 0,
  "codeSigningTrustLevel" : 4294967295,
  "instructionByteStream" : {"beforePC":"SwEJi2sJQLl\/AQhroAAAVClBAJE\/gQPxQf\/\/VMADX9ZAaWn4wANf1g==","atPC":"CABAuemsn1LJ7q9yPwVIa+AXnxrAA1\/WwANf1ggAQLnprJ9Sye6vcg=="},
  "wakeTime" : 4836,
  "sleepWakeUUID" : "0F951567-92EE-482E-9A60-4F4E8C03767C",
  "sip" : "enabled",
  "vmRegionInfo" : "0x102b64000 is in 0x102b64000-0x102cac000;  bytes after start: 0  bytes before end: 1343487\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      dyld private memory         102b60000-102b64000    [   16K] ---\/--- SM=NUL  \n--->  mapped file                 102b64000-102cac000    [ 1312K] r--\/rwx SM=COW  ...t_id=82794ee1\n      GAP OF 0x67020000 BYTES\n      Stack Guard                 169ccc000-16d4d0000    [ 56.0M] ---\/rwx SM=NUL  ",
  "exception" : {"codes":"0x0000000000000032, 0x0000000102b64000","rawCodes":[50,4340465664],"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)","subtype":"UNKNOWN_0x32 at 0x0000000102b64000"},
  "termination" : {"flags":0,"code":2,"namespace":"CODESIGNING","indicator":"Invalid Page"},
  "vmregioninfo" : "0x102b64000 is in 0x102b64000-0x102cac000;  bytes after start: 0  bytes before end: 1343487\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      dyld private memory         102b60000-102b64000    [   16K] ---\/--- SM=NUL  \n--->  mapped file                 102b64000-102cac000    [ 1312K] r--\/rwx SM=COW  ...t_id=82794ee1\n      GAP OF 0x67020000 BYTES\n      Stack Guard                 169ccc000-16d4d0000    [ 56.0M] ---\/rwx SM=NUL  ",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":812169,"threadState":{"x":[{"value":4340465664},{"value":0},{"value":6137093096},{"value":262146},{"value":3},{"value":0},{"value":6137093096},{"value":4048},{"value":6137092736},{"value":6137092744},{"value":16777230},{"value":1},{"value":6137094786},{"value":0},{"value":9666761330},{"value":32768},{"value":92},{"value":6540914576,"symbolLocation":56,"symbol":"fcntl"},{"value":0},{"value":6137094512},{"value":3},{"value":6137093055},{"value":4340465664},{"value":6137093096},{"value":6137093056},{"value":6137093088},{"value":6137094272},{"value":4340198840},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6541084220},"cpsr":{"value":2147487744},"fp":{"value":6137093024},"sp":{"value":6137092736},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":6541268232,"matchesCrashFrame":1},"far":{"value":4340465664}},"frames":[{"imageOffset":369928,"symbol":"dyld3::MachOFile::hasMachOMagic() const","symbolLocation":0,"imageIndex":1},{"imageOffset":185916,"symbol":"dyld4::SyscallDelegate::mapFileReadOnly(Diagnostics&, char const*, unsigned long*, dyld4::FileID*, bool*, char*) const","symbolLocation":228,"imageIndex":1},{"imageOffset":184224,"symbol":"dyld4::SyscallDelegate::withReadOnlyMappedFile(Diagnostics&, char const*, bool, void (void const*, unsigned long, bool, dyld4::FileID const&, char const*) block_pointer) const","symbolLocation":88,"imageIndex":1},{"imageOffset":155648,"symbol":"dyld4::JustInTimeLoader::makeJustInTimeLoaderDisk(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*)","symbolLocation":208,"imageIndex":1},{"imageOffset":110568,"symbol":"dyld4::Loader::makeDiskLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, bool, unsigned int, mach_o::Layout const*)","symbolLocation":172,"imageIndex":1},{"imageOffset":116100,"symbol":"invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":2056,"imageIndex":1},{"imageOffset":112276,"symbol":"dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":776,"imageIndex":1},{"imageOffset":35724,"symbol":"dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const","symbolLocation":556,"imageIndex":1},{"imageOffset":111052,"symbol":"dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)","symbolLocation":248,"imageIndex":1},{"imageOffset":113148,"symbol":"dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)","symbolLocation":808,"imageIndex":1},{"imageOffset":147244,"symbol":"invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)","symbolLocation":412,"imageIndex":1},{"imageOffset":371920,"symbol":"invocation function for block in dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const","symbolLocation":148,"imageIndex":1},{"imageOffset":8956,"symbol":"dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const","symbolLocation":300,"imageIndex":1},{"imageOffset":371460,"symbol":"dyld3::MachOFile::forEachDependentDylib(void (char const*, bool, bool, bool, unsigned int, unsigned int, bool&) block_pointer) const","symbolLocation":172,"imageIndex":1},{"imageOffset":146544,"symbol":"dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)","symbolLocation":164,"imageIndex":1},{"imageOffset":26560,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":1176,"imageIndex":1},{"imageOffset":24284,"symbol":"start","symbolLocation":1844,"imageIndex":1}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4329783296,
    "CFBundleShortVersionString" : "3.4.0",
    "CFBundleIdentifier" : "nikos.chantziaras.qtads",
    "size" : 5242880,
    "uuid" : "79573514-81b2-3fe2-a902-df68a41d99b8",
    "path" : "\/private\/tmp\/*\/QTads.app\/Contents\/MacOS\/QTads",
    "name" : "QTads",
    "CFBundleVersion" : "3.4.0"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6540898304,
    "size" : 607048,
    "uuid" : "324e4ad9-e01f-3183-b09f-3e20b326643a",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6540148736,
  "size" : 4061216768,
  "uuid" : "f9ddd844-7f3f-34bd-be29-f0c72d5e5449"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=897.6M resident=0K(0%) swapped_out_or_unallocated=897.6M(100%)\nWritable regions: Total=12.2M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=12.2M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \n__DATA                             123K        3 \n__DATA_CONST                       198K        2 \n__DATA_DIRTY                         7K        1 \n__LINKEDIT                       892.0M        2 \n__TEXT                            5716K        2 \ndyld private memory               4384K        4 \nmapped file                       1312K        1 \n===========                     =======  ======= \nTOTAL                            967.4M       17 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "22c196a9849c8e93e836ac70803d969b7f2d3c2a",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "632e3df958740028737bffc0",
      "factorPackIds" : {
        "SIRI_UNDERSTANDING_NL_OVERRIDES" : "659c01d6f750153af8282e91"
      },
      "deploymentId" : 240000596
    },
    {
      "rolloutId" : "5fb4245a1bbfe8005e33a1e1",
      "factorPackIds" : {

      },
      "deploymentId" : 240000021
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "52e9806b-48cf-4718-ba06-6aaa79468566",
      "experimentId" : "6553f184553f07431fda611f",
      "deploymentId" : 400000004
    }
  ]
}
}

Model: MacBookPro18,2, BootROM 10151.61.4, proc 10:8:2 processors, 64 GB, SMC 
Graphics: Apple M1 Max, Apple M1 Max, Built-In
Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online
Memory Module: LPDDR5, Hynix
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x4387), wl0: Sep  1 2023 19:46:07 version 20.10.1073.3.8.7.165 FWID 01-b66346c5
AirPort: 
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus

This seems to be the crucial line:

EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
@dfabulich
Copy link
Author

I tried following Apple's instructions to analyze this here https://developer.apple.com/forums/thread/706442

But I couldn't get anywhere with it. It is a crash on launch, but there is a valid backtrace (it doesn't say, "Backtrace not available.")

This issue seems related: KLayout/klayout#1481

@dfabulich
Copy link
Author

I also tried building the Qt6 branch #21 after uninstalling Qt5 and installing Qt6. It compiles, but it crashes on launch, with seemingly identical crash log.

@dfabulich dfabulich changed the title macOS: QTads crashes on launch when I build from source macOS: QTads crashes on launch when I build from source on Apple Silicon Jan 18, 2024
@dfabulich
Copy link
Author

This is an issue with Apple Silicon; other QT users are experiencing it, too. I was able to launch QTads when building on macOS Sonoma 14.2.1 on an Intel Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant