Yep, stack frame 26, Tree.cpp:1006, the assertion failure. I've removed that assertion. Please sync and try again.DeepSOIC wrote:I caught the crash in debugger.
Yep, stack frame 26, Tree.cpp:1006, the assertion failure. I've removed that assertion. Please sync and try again.DeepSOIC wrote:I caught the crash in debugger.
Done. No crashes so far...realthunder wrote:Yep, stack frame 26, Tree.cpp:1006, the assertion failure. I've removed that assertion. Please sync and try again.
Code: Select all
class proxy(object):
def __init__(self, obj):
obj.Proxy = self
class vpproxy(object):
def __init__(self,vobj):
vobj.Proxy = self
def attach(self, vobj):
self.ViewObject = vobj
self.Object = vobj.Object
def claimChildren(self):
return [self.Object]
if not App.ActiveDocument:
App.newDocument()
obj = App.ActiveDocument.addObject("App::FeaturePython", "chicken_or_egg")
proxy(obj)
vpproxy(obj.ViewObject)
Code: Select all
if not App.ActiveDocument:
App.newDocument()
import Part
chicken = App.ActiveDocument.addObject("Part::Extrusion", "chicken")
egg = App.ActiveDocument.addObject("Part::Extrusion", "egg")
chicken.Base = egg
egg.Base = chicken
Hmm... It's easy for me to fix this up by extra checking, and just not create item for this kind of scenario. But it can't prevent cyclic dependency, and it is still there. There bound to be other problems, e.g. if DAGView is enabled, it doesn't freeze the GUI, but spits error message endlessly. To be fair, FC without my patch will lock up too.DeepSOIC wrote:And another example with same result, that can actually happen for real.
Indeed it does, I haven't checked thisrealthunder wrote:To be fair, FC without my patch will lock up too.
It is kinda of. It actually hangs inside Qt::TreeWidgetItem.addChild. They don't bother checking cyclic reference either. And for a good reason, as it may be a potentially expensive operation.DeepSOIC wrote:I'll have a look at what's going on, because I now have a feeling it's not your code that hangs.
Well, at least it doesn't block one from fixing the looprealthunder wrote:If you enable DAGView, you'll be spammed with endless error message.
It may, as it looks like tree update is fired for every change to a property... So maybe just leave it alone for now?realthunder wrote:I added the check nevertheless. We'll see how it affects FC performance. Please sync the branch.
The cyclic check only happens when a free item (i.e. an item at document root) is newly claimed, which already has children. The check needs to visit all its children. That's the only case requiring a check. We'd be creating new items (without children obviously) for all other cases. So, I think the performance impact should be limited.DeepSOIC wrote:It may, as it looks like tree update is fired for every change to a property... So maybe just leave it alone for now?