Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-89669

Crash on Cmd+C/Cmd+X/Cmd+V/Cmd+A press in plug-in mode on Mac OS

    XMLWordPrintable

Details

    • macOS

    Description

      When Qt-based application is run as a plug-in to another host application on Mac OS, pressing Cmd+C/Cmd+X/Cmd+V/Cmd+A in Qt dialog causes an unhandled exception and crash.

      In our case the host application is the Final Cut Pro which has its own Cmd+C/Cmd+X/Cmd+V/Cmd+A handlers in place.

      We've noticed that inside qnsview_menus.mm the copy:/cut:/paste:/selectAll: all have special handling. See for ex. selectorIsCutCopyPaste(SEL selector) and its usage in - respondsToSelector(), methodSignatureForSelector() and forwardInvocation().

      What seems to happen in our scenario is that Cmd+C/Cmd+X/Cmd+V/Cmd+A produces a copy:/cut:/paste:/selectAll: selector that is correctly recognized as such by selectorIsCutCopyPaste(), however its origin is not a QCocoaNSMenuItem as Qt code expects. Hence it ends up in forwardInvocation  > super forwardInvocation and crashes the plug-in and the host application.

      This seems to be related to the discussion in QTBUG-17291, however the corresponding code is not in Qt 5.15 any more.

      Is this special handling of copy:/cut:/paste:/selectAll: needed at all? We've noticed that just unconditionally returning "false" from selectorIsCutCopyPaste() fixes the crash and does not break Cmd+C/Cmd+X/Cmd+V/Cmd+A functionality. This simple "fix" is what we are going to use for now until you guys come up with a better solution.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            skoulik Sergei Kulik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes