MacOS 13 Help menu crash in my qt app
-
Writing here, not in bug tracker, because not sure that this is pure QT bug. So, after updating my MacOS from 12 to 13 and building my QT app, run and press app's Help menu (standard menu without any my custom code) got next crash (reproduced on QT5 and QT6):
Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [76904] VM Region Info: 0 is not in any region. Bytes before following region: 4329619456 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 10210c000-1045d0000 [ 36.8M] r-x/r-x SM=COW ...s/MacOS/OMaps Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x0 ??? 1 dyld 0x198d237c4 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 156 2 dyld 0x198d68214 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340 3 dyld 0x198d5b524 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 524 4 dyld 0x198d082d8 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296 5 dyld 0x198d5a548 dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192 6 dyld 0x198d67bf4 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 516 7 dyld 0x198d2369c dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 176 8 dyld 0x198d23950 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 216 9 dyld 0x198d2392c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 180 10 dyld 0x198d2392c dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 180 11 dyld 0x198d23ae8 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 328 12 dyld 0x198d40aa8 dyld4::APIs::dlopen_from(char const*, int, void*) + 1212 13 AppKit 0x19caec250 initSPSafariPlatformSupport + 48 14 AppKit 0x19c507d80 __82-[NSAutoFillHeuristicController showAutoFillIfNecessaryFor:withCompletionHandler:]_block_invoke + 764 15 AppKit 0x19caec200 ___NSMainRunLoopPerformBlockInModes_block_invoke + 44 16 CoreFoundation 0x1991155cc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 17 CoreFoundation 0x1991154e0 __CFRunLoopDoBlocks + 368 18 CoreFoundation 0x19911432c __CFRunLoopRun + 820 19 CoreFoundation 0x1991138a4 CFRunLoopRunSpecific + 612 20 HIToolbox 0x1a27873bc RunCurrentEventLoopInMode + 292 21 HIToolbox 0x1a278704c ReceiveNextEventCommon + 236 22 HIToolbox 0x1a2786f48 _BlockUntilNextEventMatchingListInModeWithFilter + 72 23 AppKit 0x19c36c630 _DPSNextEvent + 632 24 AppKit 0x19c36b7c0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 25 AppKit 0x19ca103dc _NSHLTBMenuEventProc + 304 26 HIToolbox 0x1a27edcec IsUserStillTracking(MenuSelectData*, unsigned char*) + 224 27 HIToolbox 0x1a292be5c TrackMenuCommon(MenuSelectData&, unsigned char*, SelectionData*, MenuResult*, MenuResult*) + 1396 28 HIToolbox 0x1a27f958c MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 348 29 HIToolbox 0x1a27f9380 _HandleMenuSelection2 + 416 30 AppKit 0x19c4bf0f4 _NSHandleCarbonMenuEvent + 256 31 AppKit 0x19c4bef18 _DPSEventHandledByCarbon + 60 32 AppKit 0x19c36bdb8 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2256 33 AppKit 0x19c35fbf0 -[NSApplication run] + 464 34 libqcocoa.dylib 0x10ff5ab18 0x10ff44000 + 92952 35 QtCore 0x1107e3fcc QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 536 36 QtCore 0x1107db618 QCoreApplication::exec() + 128 37 OMaps 0x10213de74 main + 2648 (main.cpp:247) 38 dyld 0x198d0be50 start + 2544
Arm64, MacOS 13.0.1
I suspect that it's something related to 3party app "injection" (Safari?). Googling with "IsUserStillTracking" or "TrackMenuCommon" gives some similar crashes for different apps with no clear workaround.
QtCreator and other installed apps work fine.
-
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows this behaviour ?
-
Tried to factor out minimal example starting from empty QT widgtets app, but no luck here ..
I work on open source app and it crashes on Help menu, so here is a link, if you have time to check it out: https://github.com/organicmaps/organicmaps -
Tried to factor out minimal example starting from empty QT widgtets app, but no luck here ..
I work on open source app and it crashes on Help menu, so here is a link, if you have time to check it out: https://github.com/organicmaps/organicmaps@vng-me do you access some native code (for example system information) when opening the help menu?
Maybe macOS13 now requires explicit permissions for those functions inside the plist file ?
-
@vng-me do you access some native code (for example system information) when opening the help menu?
Maybe macOS13 now requires explicit permissions for those functions inside the plist file ?
@J-Hilk Well, no. Here is my sample code from the test app, which is quite the same as in working app:
QMenu * helpMenu = new QMenu(tr("Help"), this); menuBar()->addMenu(helpMenu); helpMenu->addAction(tr("About"), this, SLOT(OnAbout())); helpMenu->addAction(tr("Preferences"), this, SLOT(OnPreferences())); helpMenu->addAction(tr("Foo"), this, SLOT(OnFoo())); helpMenu->addAction(tr("Bar"), this, SLOT(OnBar()));
After pressing on Help button, I got this in test app:
It works fine with the test app, but crashes immediately after pressing Help menu item in my working app.I suspect that MacOS injects "search bar" into "Help" menu (by name?), because if I rename this menu item on something else (say "XXX Help") everything works fine.
-
Update: This crash happens only when running the app from QT Creator. Running from Terminal or Finder is ok.
@vng-me, you have no idea how much your last reply helped me. I had been facing a similar issue and I just could not make sense of it. Strangely enough, my app had been working perfectly under Linux. Also, there's no such problem if I build for release in Qt Creator on Mac.
-
@vng-me, you have no idea how much your last reply helped me. I had been facing a similar issue and I just could not make sense of it. Strangely enough, my app had been working perfectly under Linux. Also, there's no such problem if I build for release in Qt Creator on Mac.