Segfault on PyQt6 6.9.1

Jonathan Coates jonathan.coates at oxionics.com
Tue Jun 10 13:37:51 BST 2025


Hi all,

I recently updated to the PyQt6 6.9.1, and started experiencing
SIGSEGVs when closing an application. I've narrowed it down to the
attached example, and also attached the stacktrace from where the
segfault occurs. This is specific to 6.9.1, and does not occur with
6.9.0.

The crash occurs when the QtWidgets.QMainWindow is disposed — either
with a `del main_window` or (in the attached example) the stack frame
itself is disposed of. I'm happy to debug this further — currently
trying to get a debug build of PyQt 6 working, but wanted to check if
a) this was a known issue and b) if there were any tips for debugging
the generated SIP code?

Many thanks,

Jonathan

-- 


*Registered in England
& Wales, company number 11795789, registered 
address: Oxford Ionics
Limited, 6a Oxford Technology Park, OX5 1GN, UK*
-------------- next part --------------
#0  0xffffffffffffffff in ?? ()
#1  0x00007ffff373113f in ?? () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#2  0x00007ffff36fbbbf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#3  0x00007ffff407c65e in sipQApplication::notify(QObject*, QEvent*) () from .venv.broken/lib/python3.12/site-packages/PyQt6/QtWidgets.abi3.so
#4  0x00007ffff6d4ff4a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Core.so.6
#5  0x00007ffff6db2346 in QObjectPrivate::setParent_helper(QObject*) () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Core.so.6
#6  0x00007ffff6db28a9 in QObject::~QObject() () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Core.so.6
#7  0x00007ffff38b585d in ?? () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#8  0x00007ffff38b160e in ?? () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#9  0x00007ffff38b1a4d in ?? () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#10 0x00007ffff37590eb in QWidget::~QWidget() () from .venv.broken/lib/python3.12/site-packages/PyQt6/Qt6/lib/libQt6Widgets.so.6
#11 0x00007ffff3eb3ad9 in sipQMainWindow::~sipQMainWindow() () from .venv.broken/lib/python3.12/site-packages/PyQt6/QtWidgets.abi3.so
#12 0x00007ffff74edadb in cleanup_qobject(_sipSimpleWrapper*, void*) () from .venv.broken/lib/python3.12/site-packages/PyQt6/QtCore.abi3.so
#13 0x00007ffff424ccc9 in sip_api_visit_wrappers (visitor=0x7ffff74eda20 <cleanup_qobject(_sipSimpleWrapper*, void*)>, closure=0xddc630) at sip_core.c:11873
#14 0x00007ffff3e789e0 in release_QApplication () from .venv.broken/lib/python3.12/site-packages/PyQt6/QtWidgets.abi3.so
#15 0x00007ffff425bd51 in forgetObject (sw=sw at entry=0x7ffff77007d0) at sip_core.c:10140
#16 0x00007ffff425bdb4 in sipWrapper_dealloc (self=0x7ffff77007d0) at sip_core.c:9785
#17 0x000000000059f213 in subtype_dealloc (self=<QApplication() at remote 0x7ffff77007d0>) at ../Objects/typeobject.c:2051
#18 0x00000000005f7bc5 in Py_DECREF (op=<optimized out>) at ../Include/object.h:705
#19 Py_XDECREF (op=<optimized out>) at ../Include/object.h:798
#20 Py_XDECREF (op=<optimized out>) at ../Include/object.h:795
-------------- next part --------------
A non-text attachment was scrubbed...
Name: segfault_example.py
Type: text/x-python
Size: 769 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250610/9c0a2034/attachment-0001.py>


More information about the PyQt mailing list