Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1874

SIGSEGV when accessing __doc__ of a Property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.7, 6.2.4
    • Fix Version/s: 5.15
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      370e5c712c (pyside/pyside-setup/dev) 1a9476d67d (pyside/pyside-setup/6.2) 1a9476d67d (pyside/tqtc-pyside-setup/6.2) 070ca71cdf (pyside/tqtc-pyside-setup/5.15) 070ca71cdf (pyside/tqtc-pyside-setup/tqtc/5.15)

      Description

      If the __doc__ of a Property is accessed then a SIGSEGV is launched.

      from PySide6.QtCore import Property, QObject
      
      
      class Foo(QObject):
          @Property(int)
          def bar(self):
              return 0
      
      
      Foo.bar.__doc__
      
      gdb --args python PYSIDE1874.py
      
      (gdb) run
      Starting program: /home/qt/.venv/bin/python bug.py
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/usr/lib/libthread_db.so.1".
      [New Thread 0x7ffff41ff640 (LWP 12116)]
      [New Thread 0x7ffff39fe640 (LWP 12117)]
      [New Thread 0x7fffef1fd640 (LWP 12118)]
      
      Thread 1 "python" received signal SIGSEGV, Segmentation fault.
      0x00007ffff7d1b0d0 in _PyObject_GenericGetAttrWithDict () from /usr/lib/libpython3.10.so.1.0
      
      (gdb) backtrace
      #0  0x00007ffff7d1b0d0 in _PyObject_GenericGetAttrWithDict () from /usr/lib/libpython3.10.so.1.0
      #1  0x00007ffff7d19a28 in PyObject_GetAttr () from /usr/lib/libpython3.10.so.1.0
      #2  0x00007fffeb96d164 in qPropertyDocGet () from /home/qt/.venv/lib/python3.10/site-packages/PySide6/libpyside6.abi3.so.6.2
      #3  0x00007fffeb96d22a in qPropertyDocGet () from /home/qt/.venv/lib/python3.10/site-packages/PySide6/libpyside6.abi3.so.6.2
      

      The expectation should be that it returns an empty string. If use:

      @Property(int, doc="bar")
      def bar(self):
          return 0
      

      is used obviously the problem does not occur.

        Attachments

        1. pyside1874_diag.diff
          2 kB
        2. pyside1874_log.txt
          18 kB
        3. pyside1874.py
          0.5 kB
        4. PYSIDE1874.py
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            eyllanesc Edwin Christian Yllanes Cucho
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes