View Issue Details

IDProjectCategoryView StatusLast Update
0000414FreeCADBugpublic2011-11-05 22:55
Reportermagwas Assigned Towmayer  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionno change required 
Product Versiontrunk 
Fixed in Version0.12 
Summary0000414: reference counting problem
DescriptionThis bug is recently introduced.
It might be related to the fixed reference count problem related to mouse observer or the buttonup/buttondown patch.

I am basically doing a
self.vobj.RootNode.addChild(self.pt)
self.vobj.RootNode.removeChild(self.pt)
self.vobj.RootNode.addChild(self.pt)

the error message is:
Coin error in SoBase::assertAlive(): Detected an attempt to access an instance (0xa8f6b10) of an SoBase-derived class after it was destructed! This is most likely to be the result of some grave programming error in the application / client code (or less likely: internal library code), causing premature destruction of a reference counted object instance. This check was called from a dangling reference to it.
freecad: SoBase.cpp:443: void SoBase::assertAlive() const: Assertion `0 && "SoBase-object no longer alive!"' failed.

Additional Informationreproduction:
use git@github.com:magwas/SurfaceMesh.git , commit tagged refcountbug (d2fa07f6ee03dbf8b03e4b1ccf45cf5d90db43d5)
start freecad
new document
draw a 2d line
select it
in the Surface Mesh workbench do an Add Mesh
select a Point object
press the space three times
TagsNo tags attached.
FreeCAD Information

Activities

magwas

2011-08-05 11:15

reporter   ~0000974

Another one.

Reproduction:

start freecad
new document
draw a line
l=App.getDocument("Unnamed").getObject("Line")
delete the line
l.Content

wmayer

2011-08-06 07:14

administrator   ~0000975

Last edited: 2011-08-08 05:48

> I am basically doing a
> self.vobj.RootNode.addChild(self.pt)
> self.vobj.RootNode.removeChild(self.pt)
> self.vobj.RootNode.addChild(self.pt)

I can't imagine that this is related to the fix because these are two completely different things.

> l=App.getDocument("Unnamed").getObject("Line")
> delete the line
> l.Content
And what is the bug? When removing an object if undo/redo is enabled the object isn't deleted but only managed by a transaction object. With an undo you can restore it.

And when removing an object if undo/redo is not enabled the objects gets destroyed. If you access "l" afterwards it throws an exception: ReferenceError: Cannot print representation of deleted object

This is exactly the desired behaviour because python objects are not allowed to prevent C++ objects from being destructed if they should. Thus, we set a flag in the python object to become invalid now.

Jriegel

2011-11-04 21:15

administrator   ~0001245

Werner Im not sure whats the problem and I have no need to debug hes application.
Close the bug if you want...

wmayer

2011-11-05 22:55

administrator   ~0001259

No bug

Issue History

Date Modified Username Field Change
2011-08-05 09:17 magwas New Issue
2011-08-05 11:15 magwas Note Added: 0000974
2011-08-06 07:14 wmayer Note Added: 0000975
2011-08-08 05:48 wmayer Note Edited: 0000975
2011-11-04 21:14 Jriegel Status new => assigned
2011-11-04 21:14 Jriegel Assigned To => Jriegel
2011-11-04 21:14 Jriegel Assigned To Jriegel => wmayer
2011-11-04 21:15 Jriegel Note Added: 0001245
2011-11-05 22:55 wmayer Note Added: 0001259
2011-11-05 22:55 wmayer Status assigned => closed
2011-11-05 22:55 wmayer Resolution open => no change required
2011-11-05 22:55 wmayer Fixed in Version => 0.12