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

[REG] Pressing Ctrl+V to paste in QPlainTextEdit when the clipboard is empty causes a crash

    XMLWordPrintable

Details

    • Linux/X11, macOS

    Description

      Pressing Ctrl+V when the clipboard is empty causes a crash (SEGV). The following trivial PyQt script reproduces it. Make sure the clipboard is empty, then run it and press ctrl+v to cause the crash. You can empty the clipboard by not using a clipbaord manager and copying from some application and then closing that application.

      This is a regression, though I am not sure which version of Qt it was introduced in.

       

      ```

      from PyQt6.QtWidgets import QPlainTextEdit, QApplication

      app = QApplication([])
      w = QPlainTextEdit()
      w.show()
      app.exec()

      ```

      Stack trace, although without, debug symbols:

      ```

                      #0  0x00007f86ca79748f _ZN18QWidgetTextControl18insertFromMimeDataEPK9QMimeData (libQt6Widgets.so.6 + 0x39748f)
                      #1  0x00007f86cae0d454 n/a (QtWidgets.abi3.so + 0x20d454)
                      #2  0x00007f86ca7932c2 _ZN18QWidgetTextControl12processEventEP6QEventRK10QTransformP7QWidget (libQt6Widgets.so.6 + 0x3932c2)
                      #3  0x00007f86ca78ab43 _ZN18QWidgetTextControl12processEventEP6QEventRK7QPointFP7QWidget (libQt6Widgets.so.6 + 0x38ab43)
                      #4  0x00007f86ca76645f _ZN14QPlainTextEdit13keyPressEventEP9QKeyEvent (libQt6Widgets.so.6 + 0x36645f)
                      #5  0x00007f86cae0ec34 n/a (QtWidgets.abi3.so + 0x20ec34)
                      #6  0x00007f86ca5bd3e2 _ZN7QWidget5eventEP6QEvent (libQt6Widgets.so.6 + 0x1bd3e2)
                      #7  0x00007f86ca64ac47 _ZN6QFrame5eventEP6QEvent (libQt6Widgets.so.6 + 0x24ac47)
                      #8  0x00007f86cae0dc2c n/a (QtWidgets.abi3.so + 0x20dc2c)
                      #9  0x00007f86ca5759bc _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x1759bc)
                      #10 0x00007f86ca56e51c _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x16e51c)
                      #11 0x00007f86caf62257 n/a (QtWidgets.abi3.so + 0x362257)
                      #12 0x00007f86c972a258 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x12a258)
                      #13 0x00007f86ca5ccb0b n/a (libQt6Widgets.so.6 + 0x1ccb0b)
                      #14 0x00007f86ca5759bc _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt6Widgets.so.6 + 0x1759bc)
                      #15 0x00007f86caf62257 n/a (QtWidgets.abi3.so + 0x362257)
                      #16 0x00007f86c972a258 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt6Core.so.6 + 0x12a258)
                      #17 0x00007f86c9d9b244 _ZN22QGuiApplicationPrivate15processKeyEventEPN29QWindowSystemInterfacePrivate8KeyEventE (libQt6Gui.so.6 + 0x19b244)
                      #18 0x00007f86c9df7465 _ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Gui.so.6 + 0x1f7465)
                      #19 0x00007f86c65da3e0 n/a (libQt6XcbQpa.so.6 + 0x513e0)
                      #20 0x00007f86c911687b g_main_context_dispatch (libglib-2.0.so.0 + 0x5587b)
                      #21 0x00007f86c916dc89 n/a (libglib-2.0.so.0 + 0xacc89)
                      #22 0x00007f86c9115132 g_main_context_iteration (libglib-2.0.so.0 + 0x54132)
                      #23 0x00007f86c994d382 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt6Core.so.6 + 0x34d382)
                      #24 0x00007f86c9735604 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt6Core.so.6 + 0x135604)
                      #25 0x00007f86c972ce7b _ZN16QCoreApplication4execEv (libQt6Core.so.6 + 0x12ce7b)
                      #26 0x00007f86caf6247e n/a (QtWidgets.abi3.so + 0x36247e)
                      #27 0x00007f86cbb55e48 n/a (libpython3.10.so.1.0 + 0x155e48)
                      #28 0x00007f86cbb4f4eb _PyObject_MakeTpCall (libpython3.10.so.1.0 + 0x14f4eb)
                      #29 0x00007f86cbb4a8ee _PyEval_EvalFrameDefault (libpython3.10.so.1.0 + 0x14a8ee)
                      #30 0x00007f86cbb44120 n/a (libpython3.10.so.1.0 + 0x144120)
                      #31 0x00007f86cbbf1b94 PyEval_EvalCode (libpython3.10.so.1.0 + 0x1f1b94)
                      #32 0x00007f86cbc02323 n/a (libpython3.10.so.1.0 + 0x202323)
                      #33 0x00007f86cbbfda8a n/a (libpython3.10.so.1.0 + 0x1fda8a)
                      #34 0x00007f86cbaa1979 n/a (libpython3.10.so.1.0 + 0xa1979)
                      #35 0x00007f86cbaa162a _PyRun_SimpleFileObject (libpython3.10.so.1.0 + 0xa162a)
                      #36 0x00007f86cbaa1fdd _PyRun_AnyFileObject (libpython3.10.so.1.0 + 0xa1fdd)
                      #37 0x00007f86cbc0eb0d Py_RunMain (libpython3.10.so.1.0 + 0x20eb0d)
                      #38 0x00007f86cbbe336b Py_BytesMain (libpython3.10.so.1.0 + 0x1e336b)
                      #39 0x00007f86cb83c290 n/a (libc.so.6 + 0x23290)
                      #40 0x00007f86cb83c34a __libc_start_main (libc.so.6 + 0x2334a)
                      #41 0x0000561c16970045 _start (python3.10 + 0x1045)

      ```

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              kovidgoyal Kovid Goyal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes