Python 3.14a7: Segfault in sip_api_init_module / _Py_TYPE
Florian Bruhin
me at the-compiler.org
Fri Apr 11 16:15:27 BST 2025
Hey,
PyQt6 6.9.0 seemed to work fine with Python 3.14 Alpha 6 so far.
However, after upgrading to Alpha 7, "from PyQt6.QtCore" immediately
segfaults:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff75e765e in _Py_TYPE (ob=0xffffffffffffffff) at /usr/include/python3.14/object.h:270
270 return ob->ob_type;
in:
#0 0x00007ffff75e765e in _Py_TYPE (ob=0xffffffffffffffff) at /usr/include/python3.14/object.h:270
#1 createClassType (client=client at entry=0x7ffff7537a40 <sipModuleAPI_QtCore>, ctd=0x7ffff7509960 <sipTypeDef_QtCore_PyQtMutexLocker>,
mod_dict=mod_dict at entry=0x7ffff7675670) at [...]/pyqt6-sip_[...]/sip_core.c:5721
#2 0x00007ffff75ee1d3 in sip_api_init_module (client=0x7ffff7537a40 <sipModuleAPI_QtCore>, mod_dict=0x7ffff7675670)
at [...]/pyqt6-sip_[...]/sip_core.c:1667
#3 0x00007ffff739e960 in PyInit_QtCore () from [...]/python3.14/site-packages/PyQt6/QtCore.abi3.so
#4 0x00005555558046db in _PyImport_RunModInitFunc (p0=p0 at entry=0x7ffff739e820 <PyInit_QtCore>, info=info at entry=0x7fffffffc2c0,
p_res=p_res at entry=0x7fffffffc230) at ./Python/importdl.c:430
I bisected this to this change in CPython, "Cache the result of
tuple_hash", which adds a new ob_hash field to PyTupleObject:
https://github.com/python/cpython/pull/131529
https://github.com/python/cpython/commit/8614f86b7163b1c39798b481902dbb511292a537
I'm not sure what happens there under the hood. Is there anything
special PyQt/sip is doing there, or is this simply some sort of CPython
regression in that commit? Happy to report it there, but I don't know
much about the CPython C API at all.
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250411/c3483f8d/attachment.sig>
More information about the PyQt
mailing list