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

QGuiApplicationPrivate::processMouseEvent() crashes on NaN event globalPos

    XMLWordPrintable

Details

    • 63bbbdc4b8dba7be5690065dc6a4ffa5a85b1b32 (qt/qtbase/dev) 763c08d809759343ca3558e84ae1a28f5d63b7df (qt/qtbase/5.15)

    Description

      When QGuiApplicationPrivate::processMouseEvent() is called with a MouseEvent where globalPos contains NaN, it will set positionChanged to true even if it is exactly the same position. If e->enhancedMouseEvent() is set and the event is not a NonClientAreaMouseMove or MouseMove event, it will recursively call QGuiApplicationPrivate::processMouseEvent(). (Normally there would only be one recursive call, but because NaN != NaN the code does not notice that it already moved the lastCursorPosition.) This endless recursion will cause a stack overflow.

      Obviously there  should not be any NaN in globalPos, but e.g. the evdev touch code produces this sometimes. (I'll file another bug about that.)

      Attachments

        For Gerrit Dashboard: QTBUG-86207
        # Subject Branch Project Status CR V

        Activity

          People

            srutledg Shawn Rutledge
            steffen-kiess Steffen Kieß
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes