Open ryandesign opened 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.
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.
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.
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?
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.
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(QFlagsI 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.