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