fritzing / fritzing-app

Fritzing desktop application
http://fritzing.org
Other
4.01k stars 828 forks source link

loop example crash #605

Closed davidperrenoud closed 10 years ago

davidperrenoud commented 10 years ago

From irasc...@gmail.com on February 26, 2009 11:59:24

open the digital/loop example. hit autoroute and let it finish. then undo autoroute. fritzing crashes.

Original issue: http://code.google.com/p/fritzing/issues/detail?id=605

davidperrenoud commented 10 years ago

From irasc...@gmail.com on March 02, 2009 01:24:24

This is the old loop example, and not the most recent. I've attached the file. The bug turns out to be a difficult one, and luckily not related to autorouting. You can get the crash simply by opening the file and then immediately deleting the tracewire "wire59".

It's crashing in QGraphicsSceneFindItemBspTreeVisitor::visit because one of the QGraphicsItems that is in its list has been deleted. The bug survives if you open the file, do a save-as, load the new file, and delete wire59 from there. Wire59 is chained to several other wires, and you get the crash if you delete any of the others--it is one of these other wires that is incorrectly remaining on QGraphicsSceneFindItemBspTreeVisitor's list. You don't get the crash if you move all of the chained wires out from under another set of traces, but I don't know whether the "beneathness" is a source of the problem. Interestingly, if you move all the wires, then undo so they're back in the original position, you get the crash again.

When trying to find similar bugs out on the web, the advice was to call PrepareGeometryChange() whenever the boundingrect of a GraphicsItem changes. However, as far as I can tell, wires and connector items are pretty diligent about doing so. But maybe it's one of the parts that the wires are beneath? I guess this is also worth checking.

Attachment: Loopcopy.fz

davidperrenoud commented 10 years ago

From irasc...@gmail.com on March 02, 2009 01:44:06

the bug also disappears if you call QGraphicsScene::setItemIndexMethod(QGraphicsScene::NoIndex), because (of course) the bsp tree code is no longer called. However, this slows selection performance, so it's not a good option.

davidperrenoud commented 10 years ago

From irasc...@gmail.com on March 02, 2009 02:07:19

tried calling prepareGeometryChange on every item in the scene just before the delete takes place, but this doesn't seem to help

davidperrenoud commented 10 years ago

From irasc...@gmail.com on March 02, 2009 09:50:11

lowering priority, since the example giving rise to the bug has been changed, and I haven't been able to replicate the bug in any other circumstance so far.

Labels: -Priority-Medium Priority-Low

davidperrenoud commented 10 years ago

From irasc...@gmail.com on March 05, 2009 10:19:02

example no longer crashes under Qt 4.5.0

davidperrenoud commented 10 years ago

From irasc...@gmail.com on May 13, 2009 04:08:19

example no longer crashes in 4.5.1

Status: Fixed