Until 8de6382 ("Gui: Fix stackoverflow when loading corrupted file")
a static_cast was used to obtain App::Origin object, however with
introducing App::LocalCoordinateSystem this was no longer correct,
although not causing any troubles as OriginFeatures moved into
LocalCoordinateSystem as well.
Recent use of getObject template triggered this problem, so use now
correct cast to App::LocalCoordinateSystem.
Fixes: 19702dc ("Core: Add App::LocalCoordinateSystem")
If an object has a link to itself it may cause a stackoverflow
in several cases:
* If the method claimChildren3D() returns a list containing the
object of the view provider then Document::handleChildren3D()
will add a SoGroup to itself as a child. This will result into
a stackoverflow as soon as an action traverses the scene.
* If the method claimChildren() returns a list containing the
object of the view provider then DocumentItem::createNewItem()
causes an infinite loop with DocumentItem::populateItem()
Solution:
* Inside Document::handleChildren3D() avoid to add a SoGroup to itself
* In this specific case fix ViewProviderCoordinateSystem::claimChildren()
to avoid a cyclic dependency
Hint: Since PR 18126 FreeCAD is vulnerable for this problem.
This fixes issue 19682