[PyQt] Segfault when calling repr() on a pyqtSignal

Florian Bruhin me at the-compiler.org
Fri Jun 24 16:58:16 BST 2016


I unfortunately can't figure out an example where this happens without
pytest, but with the attached code, when running py.test repr.py, I
get a segfault:

	(gdb) bt
	#0  pyqtBoundSignal_repr (self=0x7fffdf2f02b0) at ../qpy/QtCore/qpycore_pyqtboundsignal.cpp:241
	#1  0x00007ffff79bc9a8 in PyObject_Repr () from /usr/lib/libpython3.5m.so.1.0
	[...]

The simplified pyqtBoundSignal_repr looks like this:

    PyUnicode_FromFormat("<bound PYQT_SIGNAL %s of %s object at %p>"
                         name.constData() + 1,
	                     bs->bound_pyobject->ob_type->tp_name,
                         bs->bound_pyobject);

Looking at the data with gdb:

	(gdb) p bs
	$11 = (qpycore_pyqtBoundSignal *) 0x7fffdf2f02b0
	(gdb) p bs->bound_pyobject
	$12 = (PyObject *) 0x7fffdf0594c8
	(gdb) p bs->bound_pyobject->ob_type
	$13 = (_typeobject *) 0x43
	(gdb) p bs->bound_pyobject->ob_type->tp_name
	Cannot access memory at address 0x5b

Not sure what's going on exactly, but I hope that helps!

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repr.py
Type: text/x-python
Size: 275 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160624/54cc38d7/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160624/54cc38d7/attachment.sig>


More information about the PyQt mailing list