[PyQt] Help tracking down intermittent segfault using QGraphicsItem

Mathias.Born at gmx.de Mathias.Born at gmx.de
Sat Jan 5 13:01:11 GMT 2013


Lee,

I tried pynguin-0.12.zip on Windows7, python 2.7, PyQt 4.8.4 32bit,
and I could run "go()" many times without any crashes or warnings.
However, there appears to be no "tournament" function.

One advise, if I may say so: The chance of finding someone who would
be willing to debugg your entire project is slim. On a mailing list
such as this one, the best way is to reduce the problem to a self
contained, minimum size test case which reproduces the bug.

Best Regards,
Mathias Born

On 05.01.2013, 05:11:10 Lee Harr wrote:

> I develop a free python turtle graphics application:
> http://pynguin.googlecode.com/

> Right now I am trying to track down and fix an intermittent
> segfault involving a QGraphicsScene and QGraphicsItem

> Here is what I have...

> a QGraphicsItem subclass (item0) created with parent=None
> another QGraphicsItem subclass (item1) created with parent=item0

> I then add item0 to my scene and things appear to be
> working fine, but when removing and adding instances
> of this arrangement in rapid succession I will soon get
> a segfault.

> If you want to play along at home, load the "horserace.pyn"
> example and run the "tournament" function. For me it will
> crash reliably within the first 2 or 3 races.

> In this case, item1 represents the text labels for the horses.
> If I remove the labels, I never see the segfault.

> The strangest part is that if I manually add item1 to the scene
> (should not be needed since the child is automatically added when
> the parent is added) I do not get the segfault.

> The only problem with this is that I get a warning:
> "QGraphicsScene::addItem: item has already been added to this scene"


> So... my questions:

> What is most likely to be the real problem here?

> How likely is it that if I get it to the point that there is no segfault
> on my machine (ie, just leave in the code that generates the warning)
> that it won't segfault on a different OS/architecture?

> What is the best way to go about tracking down and fixing the real problem?


> Thanks for any assistance.

>                                           
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list