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

Florian Bruhin me at the-compiler.org
Mon Jul 4 07:57:55 BST 2016


* Hans-Peter Jansen <hpj at urpla.net> [2016-07-04 06:24:10 +0200]:
> On Freitag, 24. Juni 2016 17:58:16 Florian Bruhin wrote:
> > 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, with which sip/PyQt/Python version(s) does this happen?

Oh, sorry for not mentioning that - my bad.

Python 3.5, sip 4.18, PyQt5 5.6, and I think Qt 5.6.1.

Interestingly enough I can't reproduce it anymore right now, after
updating to Qt 5.7 and rebuilding PyQt.

To answer Phil's question - pytest does a lot of "clever" stuff, but
hard to say what exactly is causing it... ;)

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: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160704/8f97e585/attachment.sig>


More information about the PyQt mailing list