[PyQt] sip segfault in disconnectNotify

Erik Janssens Erik.Janssens at conceptive.be
Thu Sep 9 15:35:15 BST 2010


Hi,

I understand that it's possible to segfault writing
python code (although in my naive view this should
not be the case ;)).  I'm rather convinced the code
is not doing anything 'illegal', but it would be helpful
to have some descriptions on what exactly one can
do wrong using pyqt with regard to these kind of
segfaults ?

I will try to write a test case for this situation,
as well as for the deadlocks I mentioned earlier.

Can you maybe comment on the meaning of this line
in siplib.c

7288	    assert(PyTuple_Check(mro));

It might help me finding the cause at the python
level.

Thank you and best regards,

Erik

On Thu, 2010-09-09 at 09:06 +0100, Phil Thompson wrote:
> On Thu, 09 Sep 2010 09:40:43 +0200, Erik Janssens
> <Erik.Janssens at conceptive.be> wrote:
> > Hello Phil,
> > 
> > I'm experiencing a segmentation fault in sip.
> > 
> > I have build the latest released versions of sip and
> > pyqt on ubuntu, to be able to have a decent stack trace.
> > 
> > The issue only arises when objects are garbage collected,
> > so I'm unsure on how to build a simple test case for it ?
> > 
> > When I turn the python garbage collector of (gc.disable()),
> > the segfault never appears.
> > 
> > If there are things I can test to acquire more information,
> > or if somebody has ideas on how to build test cases involving
> > the garbage collector, please let me know.
> > 
> > Please find attached the stacktrace.
> 
> There isn't a lot I can do without a test case. It is quite possible to
> write Python code that causes a segfault - you can't assume that it's a
> SIP, PyQt or Qt bug.
> 
> The fact that disabling the garbage collector changes the behaviour
> suggests that you might not be keeping an explicit reference to something
> you need to.
> 
> Phil




More information about the PyQt mailing list