psemiletov / tea-qt

TEA text editor
https://tea.ourproject.org
GNU General Public License v3.0
88 stars 13 forks source link

Crash on launch on macOS in QAction::isEnabled() #64

Open ryandesign opened 1 year ago

ryandesign commented 1 year ago

Hi, I'm the maintainer of tea in MacPorts and after attempting to update our port to 62.1.1 I found that when I launch it on macOS 12.7.1, it crashes immediately in QAction::isEnabled().

Here is the crash log. ``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: tea [11213] Path: /Applications/MacPorts/tea.app/Contents/MacOS/tea Identifier: com.yourcompany.tea Version: ??? Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-11-12 02:01:24.7984 -0600 OS Version: macOS 12.7.1 (21G920) Report Version: 12 Anonymous UUID: FBC688DA-CA71-E41D-0E8C-E06F8E00D142 Sleep/Wake UUID: 2A4CD502-EF55-44E6-9D52-CED29F4A5715 Time Awake Since Boot: 580000 seconds Time Since Wake: 12723 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000676c6f6a Exception Codes: 0x0000000000000001, 0x00000000676c6f6a Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [11213] VM Region Info: 0x676c6f6a is not in any region. Bytes before following region: 2633879702 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 1046a4000-104828000 [ 1552K] r-x/r-x SM=COW ...nts/MacOS/tea Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 QtGui 0x1061a01b4 QAction::isEnabled() const + 4 1 QtGui 0x10618328c qt_mac_set_modal_state_helper_recursive(NSMenu*, NSMenu*, bool) + 572 2 QtGui 0x106183259 qt_mac_set_modal_state_helper_recursive(NSMenu*, NSMenu*, bool) + 521 3 QtGui 0x106188cec QMenuBarPrivate::macUpdateMenuBarImmediatly() + 2492 4 QtGui 0x1061531fc -[NSApplication(QApplicationIntegration) qt_sendPostedMessage:] + 204 5 QtGui 0x106153313 -[NSApplication(QApplicationIntegration) qt_filterEvent:] + 131 6 QtGui 0x1061533eb -[QNSApplication sendEvent:] + 59 7 AppKit 0x7ff81a2c014b -[NSApplication _handleEvent:] + 65 8 AppKit 0x7ff819e88cfe -[NSApplication run] + 623 9 QtGui 0x10615c675 QEventDispatcherMac::processEvents(QFlags) + 2037 10 QtCore 0x10502f288 QEventLoop::exec(QFlags) + 520 11 QtCore 0x1050328bc QCoreApplication::exec() + 188 12 tea 0x10471d7e3 main + 323 13 dyld 0x10606952e start + 462 Thread 1: 0 libsystem_pthread.dylib 0x7ff81745cf48 start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x7ff81745cf48 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x7ff81745cf48 start_wqthread + 0 Thread 4: 0 libsystem_pthread.dylib 0x7ff81745cf48 start_wqthread + 0 Thread 5:: com.apple.NSEventThread 0 libsystem_kernel.dylib 0x7ff81742496a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x7ff817424cd8 mach_msg + 56 2 CoreFoundation 0x7ff817528450 __CFRunLoopServiceMachPort + 319 3 CoreFoundation 0x7ff817526ae0 __CFRunLoopRun + 1276 4 CoreFoundation 0x7ff817525f24 CFRunLoopRunSpecific + 562 5 AppKit 0x7ff81a00598e _NSEventThread + 132 6 libsystem_pthread.dylib 0x7ff8174614e1 _pthread_start + 125 7 libsystem_pthread.dylib 0x7ff81745cf6b thread_start + 15 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x00000000676c6f62 rbx: 0x00007ff8172f44c0 rcx: 0x0000000000000001 rdx: 0x0000000000000000 rdi: 0x00000000676c6f62 rsi: 0x00007ff831ba31c0 rbp: 0x00007ff7bb85b2c0 rsp: 0x00007ff7bb85b2c0 r8: 0x00007ff858b591e0 r9: 0x000000000000003f r10: 0x00007ff8589b2080 r11: 0x00007ff819ea10e8 r12: 0x00007ff831ba31c0 r13: 0x0000000058728901 r14: 0x000060000303cd90 r15: 0x000000000000001c rip: 0x00000001061a01b4 rfl: 0x0000000000010206 cr2: 0x00000000676c6f6a Logical CPU: 0 Error Code: 0x00000004 (no mapping for user data read) Trap Number: 14 Thread 0 instruction stream: 8b 00 48 85 c0 74 39 41-8b 8e 10 01 00 00 83 e1 ..H..t9A........ fe 0f b6 f3 09 f1 66 41-89 8e 10 01 00 00 ba 28 ......fA.......( 01 00 00 48 03 50 08 4c-89 f7 e8 9d e1 ff ff 4c ...H.P.L.......L 89 f7 5b 41 5e 5d e9 31-da ff ff 5b 41 5e 5d c3 ..[A^].1...[A^]. 48 8d 3d 0f a5 74 00 31-c0 5b 41 5e 5d e9 7c 4d H.=..t.1.[A^].|M 63 00 66 2e 0f 1f 84 00-00 00 00 00 55 48 89 e5 c.f.........UH.. [48]8b 47 08 8a 80 10 01-00 00 24 01 5d c3 66 2e H.G.......$.].f. <== 0f 1f 84 00 00 00 00 00-0f 1f 40 00 55 48 89 e5 ..........@.UH.. 41 56 53 48 8b 5f 08 0f-b7 93 10 01 00 00 f6 c2 AVSH._.......... 04 0f 94 c0 40 38 f0 74-0b f6 c2 08 0f 94 c0 40 ....@8.t.......@ 38 f0 74 69 4c 8b 35 09-53 78 00 4d 8b 06 4d 85 8.tiL.5.Sx.M..M. c0 74 48 89 d1 83 e1 f3-89 f0 34 01 0f b6 c0 8d .tH.......4..... Binary Images: 0x10611c000 - 0x106923fff QtGui (*) <2fa19108-309c-3a97-aae3-844a9b1c3e73> /opt/local/libexec/*/QtGui.framework/Versions/4/QtGui 0x7ff819e59000 - 0x7ff81ace8fff com.apple.AppKit (6.9) <461a4d7c-b3e3-3cbc-92b7-a2a419007281> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit 0x104ef9000 - 0x105150fff QtCore (*) <8608f6ac-b17f-3af9-b161-fb5075637428> /opt/local/libexec/*/QtCore.framework/Versions/4/QtCore 0x1046a4000 - 0x104827fff com.yourcompany.tea (*) /Applications/MacPorts/tea.app/Contents/MacOS/tea 0x106064000 - 0x1060cffff dyld (*) <771e1916-3a62-34cd-8488-c1021053c7fa> /usr/lib/dyld 0x7ff81745b000 - 0x7ff817466fff libsystem_pthread.dylib (*) /usr/lib/system/libsystem_pthread.dylib 0x7ff817423000 - 0x7ff81745afff libsystem_kernel.dylib (*) <5bbc2e64-012e-34dd-8c02-41294a3d66e9> /usr/lib/system/libsystem_kernel.dylib 0x7ff8174a8000 - 0x7ff8179a9fff com.apple.CoreFoundation (6.9) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 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: 12 thread_create: 0 thread_set_state: 792 VM Region Summary: ReadOnly portion of Libraries: Total=876.9M resident=0K(0%) swapped_out_or_unallocated=876.9M(100%) Writable regions: Total=618.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=618.8M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Accelerate framework 640K 5 Activity Tracing 256K 1 CG backing stores 720K 4 CG image 184K 8 ColorSync 220K 26 CoreAnimation 1644K 9 CoreGraphics 4K 1 CoreServices 164K 1 CoreUI image data 792K 13 Foundation 16K 1 Kernel Alloc Once 8K 1 MALLOC 220.4M 54 MALLOC guard page 32K 8 MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) STACK GUARD 56.0M 6 Stack 10.5M 6 VM_ALLOCATE 144K 18 __CTF 756 1 __DATA 18.4M 312 __DATA_CONST 12.5M 194 __DATA_DIRTY 536K 98 __FONT_DATA 4K 1 __LINKEDIT 652.1M 37 __OBJC_RO 82.9M 1 __OBJC_RW 3200K 2 __TEXT 224.9M 333 __UNICODE 592K 1 dyld private memory 1024K 1 mapped file 169.1M 25 shared memory 776K 17 =========== ======= ======= TOTAL 1.8G 1186 TOTAL, minus reserved VM space 1.4G 1186 ----------- Full Report ----------- {"app_name":"tea","timestamp":"2023-11-12 02:01:25.00 -0600","app_version":"","slice_uuid":"ce6a441b-c173-38e1-9b67-206d35466d33","build_version":"","platform":1,"bundleID":"com.yourcompany.tea","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.7.1 (21G920)","incident_id":"D1515687-8C2C-4DAD-BFC6-EBE8A3326FDA","name":"tea"} { "uptime" : 580000, "procLaunch" : "2023-11-12 02:01:22.5465 -0600", "procRole" : "Foreground", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "MacBookPro10,1", "procStartAbsTime" : 583504358362937, "coalitionID" : 27531, "osVersion" : { "train" : "macOS 12.7.1", "build" : "21G920", "releaseType" : "User" }, "captureTime" : "2023-11-12 02:01:24.7984 -0600", "incident" : "D1515687-8C2C-4DAD-BFC6-EBE8A3326FDA", "bug_type" : "309", "pid" : 11213, "procExitAbsTime" : 583506608634979, "cpuType" : "X86-64", "procName" : "tea", "procPath" : "\/Applications\/MacPorts\/tea.app\/Contents\/MacOS\/tea", "bundleInfo" : {"CFBundleIdentifier":"com.yourcompany.tea"}, "storeInfo" : {"deviceIdentifierForVendor":"843099DA-CD65-535A-8B8B-9EF96B968E86","thirdParty":true}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "com.yourcompany.tea", "crashReporterKey" : "FBC688DA-CA71-E41D-0E8C-E06F8E00D142", "wakeTime" : 12723, "sleepWakeUUID" : "2A4CD502-EF55-44E6-9D52-CED29F4A5715", "sip" : "enabled", "vmRegionInfo" : "0x676c6f6a is not in any region. Bytes before following region: 2633879702\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1046a4000-104828000 [ 1552K] r-x\/r-x SM=COW ...nts\/MacOS\/tea", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000001, 0x00000000676c6f6a","rawCodes":[1,1735159658],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x00000000676c6f6a"}, "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":11213}, "vmregioninfo" : "0x676c6f6a is not in any region. Bytes before following region: 2633879702\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1046a4000-104828000 [ 1552K] r-x\/r-x SM=COW ...nts\/MacOS\/tea", "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":792,"task_for_pid":12},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 0, "threads" : [{"triggered":true,"id":6265083,"instructionState":{"instructionStream":{"bytes":[139,0,72,133,192,116,57,65,139,142,16,1,0,0,131,225,254,15,182,243,9,241,102,65,137,142,16,1,0,0,186,40,1,0,0,72,3,80,8,76,137,247,232,157,225,255,255,76,137,247,91,65,94,93,233,49,218,255,255,91,65,94,93,195,72,141,61,15,165,116,0,49,192,91,65,94,93,233,124,77,99,0,102,46,15,31,132,0,0,0,0,0,85,72,137,229,72,139,71,8,138,128,16,1,0,0,36,1,93,195,102,46,15,31,132,0,0,0,0,0,15,31,64,0,85,72,137,229,65,86,83,72,139,95,8,15,183,147,16,1,0,0,246,194,4,15,148,192,64,56,240,116,11,246,194,8,15,148,192,64,56,240,116,105,76,139,53,9,83,120,0,77,139,6,77,133,192,116,72,137,209,131,225,243,137,240,52,1,15,182,192,141],"offset":96}},"threadState":{"r13":{"value":1483901185},"rax":{"value":1735159650},"rflags":{"value":66054},"cpu":{"value":0},"r14":{"value":105553166847376},"rsi":{"value":140703962902976,"objc-selector":"tag"},"r8":{"value":140704616911328,"symbolLocation":2976,"symbol":"(anonymous namespace)::SideTablesMap"},"cr2":{"value":1735159658},"rdx":{"value":0},"r10":{"value":140704615178368,"symbolLocation":0,"symbol":"OBJC_CLASS_$_NSMenuItem"},"r9":{"value":63},"r15":{"value":28},"rbx":{"value":140703517590720,"symbolLocation":0,"symbol":"objc_msgSend"},"trap":{"value":14,"description":"(no mapping for user data read)"},"err":{"value":4},"r11":{"value":140703563387112,"symbolLocation":0,"symbol":"-[NSMenuItem tag]"},"rip":{"value":4397334964,"matchesCrashFrame":1},"rbp":{"value":140701979751104},"rsp":{"value":140701979751104},"r12":{"value":140703962902976,"objc-selector":"tag"},"rcx":{"value":1},"flavor":"x86_THREAD_STATE","rdi":{"value":1735159650}},"queue":"com.apple.main-thread","frames":[{"imageOffset":541108,"symbol":"QAction::isEnabled() const","symbolLocation":4,"imageIndex":0},{"imageOffset":422540,"symbol":"qt_mac_set_modal_state_helper_recursive(NSMenu*, NSMenu*, bool)","symbolLocation":572,"imageIndex":0},{"imageOffset":422489,"symbol":"qt_mac_set_modal_state_helper_recursive(NSMenu*, NSMenu*, bool)","symbolLocation":521,"imageIndex":0},{"imageOffset":445676,"symbol":"QMenuBarPrivate::macUpdateMenuBarImmediatly()","symbolLocation":2492,"imageIndex":0},{"imageOffset":225788,"symbol":"-[NSApplication(QApplicationIntegration) qt_sendPostedMessage:]","symbolLocation":204,"imageIndex":0},{"imageOffset":226067,"symbol":"-[NSApplication(QApplicationIntegration) qt_filterEvent:]","symbolLocation":131,"imageIndex":0},{"imageOffset":226283,"symbol":"-[QNSApplication sendEvent:]","symbolLocation":59,"imageIndex":0},{"imageOffset":4616523,"symbol":"-[NSApplication _handleEvent:]","symbolLocation":65,"imageIndex":1},{"imageOffset":195838,"symbol":"-[NSApplication run]","symbolLocation":623,"imageIndex":1},{"imageOffset":263797,"symbol":"QEventDispatcherMac::processEvents(QFlags)","symbolLocation":2037,"imageIndex":0},{"imageOffset":1270408,"symbol":"QEventLoop::exec(QFlags)","symbolLocation":520,"imageIndex":2},{"imageOffset":1284284,"symbol":"QCoreApplication::exec()","symbolLocation":188,"imageIndex":2},{"imageOffset":497635,"symbol":"main","symbolLocation":323,"imageIndex":3},{"imageOffset":21806,"symbol":"start","symbolLocation":462,"imageIndex":4}]},{"id":6265098,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":5}]},{"id":6265099,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":5}]},{"id":6265110,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":5}]},{"id":6265131,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":5}]},{"id":6265137,"name":"com.apple.NSEventThread","frames":[{"imageOffset":6506,"symbol":"mach_msg_trap","symbolLocation":10,"imageIndex":6},{"imageOffset":7384,"symbol":"mach_msg","symbolLocation":56,"imageIndex":6},{"imageOffset":525392,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":319,"imageIndex":7},{"imageOffset":518880,"symbol":"__CFRunLoopRun","symbolLocation":1276,"imageIndex":7},{"imageOffset":515876,"symbol":"CFRunLoopRunSpecific","symbolLocation":562,"imageIndex":7},{"imageOffset":1755534,"symbol":"_NSEventThread","symbolLocation":132,"imageIndex":1},{"imageOffset":25825,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":5},{"imageOffset":8043,"symbol":"thread_start","symbolLocation":15,"imageIndex":5}]}], "usedImages" : [ { "source" : "P", "arch" : "x86_64", "base" : 4396793856, "size" : 8421376, "uuid" : "2fa19108-309c-3a97-aae3-844a9b1c3e73", "path" : "\/opt\/local\/libexec\/*\/QtGui.framework\/Versions\/4\/QtGui", "name" : "QtGui" }, { "source" : "P", "arch" : "x86_64", "base" : 140703563091968, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.AppKit", "size" : 15269888, "uuid" : "461a4d7c-b3e3-3cbc-92b7-a2a419007281", "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit", "name" : "AppKit", "CFBundleVersion" : "2113.60.148" }, { "source" : "P", "arch" : "x86_64", "base" : 4377776128, "size" : 2457600, "uuid" : "8608f6ac-b17f-3af9-b161-fb5075637428", "path" : "\/opt\/local\/libexec\/*\/QtCore.framework\/Versions\/4\/QtCore", "name" : "QtCore" }, { "source" : "P", "arch" : "x86_64", "base" : 4369039360, "CFBundleIdentifier" : "com.yourcompany.tea", "size" : 1589248, "uuid" : "ce6a441b-c173-38e1-9b67-206d35466d33", "path" : "\/Applications\/MacPorts\/tea.app\/Contents\/MacOS\/tea", "name" : "tea" }, { "source" : "P", "arch" : "x86_64", "base" : 4396040192, "size" : 442368, "uuid" : "771e1916-3a62-34cd-8488-c1021053c7fa", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "x86_64", "base" : 140703519059968, "size" : 49152, "uuid" : "e097f78f-fcfb-30f3-9164-dbc9709ba134", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140703518830592, "size" : 229376, "uuid" : "5bbc2e64-012e-34dd-8c02-41294a3d66e9", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "x86_64", "base" : 140703519375360, "CFBundleShortVersionString" : "6.9", "CFBundleIdentifier" : "com.apple.CoreFoundation", "size" : 5251072, "uuid" : "ae0423bc-0596-3bab-82dd-3b0657402b08", "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation", "name" : "CoreFoundation", "CFBundleVersion" : "1866" }, { "size" : 0, "source" : "A", "base" : 0, "uuid" : "00000000-0000-0000-0000-000000000000" } ], "sharedCache" : { "base" : 140703515803648, "size" : 19331678208, "uuid" : "fa8f4c4d-c8a4-327d-aced-bc00b7fda3ea" }, "vmSummary" : "ReadOnly portion of Libraries: Total=876.9M resident=0K(0%) swapped_out_or_unallocated=876.9M(100%)\nWritable regions: Total=618.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=618.8M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nAccelerate framework 640K 5 \nActivity Tracing 256K 1 \nCG backing stores 720K 4 \nCG image 184K 8 \nColorSync 220K 26 \nCoreAnimation 1644K 9 \nCoreGraphics 4K 1 \nCoreServices 164K 1 \nCoreUI image data 792K 13 \nFoundation 16K 1 \nKernel Alloc Once 8K 1 \nMALLOC 220.4M 54 \nMALLOC guard page 32K 8 \nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nSTACK GUARD 56.0M 6 \nStack 10.5M 6 \nVM_ALLOCATE 144K 18 \n__CTF 756 1 \n__DATA 18.4M 312 \n__DATA_CONST 12.5M 194 \n__DATA_DIRTY 536K 98 \n__FONT_DATA 4K 1 \n__LINKEDIT 652.1M 37 \n__OBJC_RO 82.9M 1 \n__OBJC_RW 3200K 2 \n__TEXT 224.9M 333 \n__UNICODE 592K 1 \ndyld private memory 1024K 1 \nmapped file 169.1M 25 \nshared memory 776K 17 \n=========== ======= ======= \nTOTAL 1.8G 1186 \nTOTAL, minus reserved VM space 1.4G 1186 \n", "legacyInfo" : { "threadTriggered" : { "queue" : "com.apple.main-thread" } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "5ffde50ce2aacd000d47a95f", "factorPackIds" : { }, "deploymentId" : 240000348 }, { "rolloutId" : "63582c5f8a53461413999550", "factorPackIds" : { }, "deploymentId" : 240000002 } ], "experiments" : [ ] } } ```

I went back to 62.0.2 to which I had updated the port a year ago and it also crashes with the same message. I feel certain that I would have verified that the program opened without crashing before committing that update a year ago, though it might have been on an earlier major macOS version, and of course tea's various dependencies might have received updates in the past year which might be contributing to the problem.

ryandesign commented 1 year ago

And I should mention that this is a qt4 build with qmake, since I know you also have a qt5/qt6 build option with cmake.

psemiletov commented 1 year ago

Thank you for the bugreport! It's hard to me to determine where exactly is the error without debugger, and I don't have Mac/Mac toolchain for that. I suppose the error is hidden somewhere at the menu creation code, so I'll try to read it more carefully and possible I'll find where the error is.

ryandesign commented 11 months ago

It looks like it might be this uninvestigated Qt4 bug:

https://bugreports.qt.io/browse/QTBUG-25399

The proposed workaround there of disabling the native macOS menubar—

--- tea.cpp.orig    2023-12-07 06:42:57.000000000 -0600
+++ tea.cpp 2023-12-10 20:20:46.000000000 -0600
@@ -6926,6 +6926,7 @@

 void CTEA::create_menus()
 {
+  QApplication::instance()->setAttribute(Qt::AA_DontUseNativeMenuBar);
 /*
 ===================
 File menu

—works in that it no longer crashes but it drives your application so much further into "doesn't look and feel like a native macOS app" territory that I can't imagine any Mac user would want to use it that way.

Probably for MacPorts I need to just switch tea to use Qt5 at the expense of support for old macOS versions—or keep old macOS versions on Qt4 while using Qt5 for newer versions, if that's not too difficult for me to do.

psemiletov commented 11 months ago

Thank you! At 62.2.0 I hardoded Qt::AA_DontUseNativeMenuBar if Qt version < than 5, so at least TEA can run on Qt4/Mac build. Why Qt5, not Qt6?

ryandesign commented 11 months ago

Probably for MacPorts I need to just switch tea to […] keep old macOS versions on Qt4 while using Qt5 for newer versions

This is now done!

At 62.2.0 I hardoded Qt::AA_DontUseNativeMenuBar if Qt version < than 5, so at least TEA can run on Qt4/Mac build.

That will make the user experience terrible for those users who use Qt 4 on older macOS versions that were not affected by the bug.

Why Qt5, not Qt6?

Because I have years of experience with Qt 5 more or less working and no experience yet with Qt 6 and because I expect Qt 6 to have higher system requirements than Qt 5 and because you do not mention Qt 6 support in your qmake build system and it is easier for me to always use qmake than it is to sometimes use qmake and sometimes use cmake depending on the user's choice of Qt version.