Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MacOS 13 Help menu crash in my qt app
Forum Updated to NodeBB v4.3 + New Features

MacOS 13 Help menu crash in my qt app

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 1.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vng.me
    wrote on last edited by vng.me
    #1

    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.

    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Can you provide a minimal compilable example that shows this behaviour ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vng.me
        wrote on last edited by
        #3

        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

        J.HilkJ 1 Reply Last reply
        0
        • V vng.me

          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

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @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 ?


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          V 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @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 ?

            V Offline
            V Offline
            vng.me
            wrote on last edited by
            #5

            @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:
            643f4983-1afb-462d-87a8-d9d8d9364d3d-Screenshot 2022-11-17 at 17.21.39.png
            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.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vng.me
              wrote on last edited by
              #6

              Update: This crash happens only when running the app from QT Creator. Running from Terminal or Finder is ok.

              MehrshadM 1 Reply Last reply
              1
              • V vng.me

                Update: This crash happens only when running the app from QT Creator. Running from Terminal or Finder is ok.

                MehrshadM Offline
                MehrshadM Offline
                Mehrshad
                wrote on last edited by Mehrshad
                #7

                @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.

                MehrshadM 1 Reply Last reply
                0
                • MehrshadM Mehrshad

                  @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.

                  MehrshadM Offline
                  MehrshadM Offline
                  Mehrshad
                  wrote on last edited by
                  #8

                  I filed a bug report here.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved