Failed assertion after `SetParent`

Hello, Defolders!

Recently, I started observing engine crashes in a large Defold 1.10.4 project with the following error:

dmengine: ../src/gameobject/gameobject.cpp:3208: Result dmGameObject::SetParent(HInstance, HInstance): Assertion `parent->m_Depth == first_child->m_Depth - 1' failed.

The assertion is made here.

I’m unsure what exactly triggers the crash, but sooner or later it happened every session out of a couple dozen attempts (on Linux/Windows/HTML5, both in debug and release builds). This assertion exists in Defold since 2011 yet I couldn’t find any references to this problem which is rather weird to me.

Am I correct in assuming that this most likely is an engine bug? How could this invariant be broken from a Lua-script side? Are there some undocumented caveats when using `go.set_parent`, which could lead to this?

Any help would be much appreciated!

After further investigation, the problem seems to be related to the spine extension. The parent in question is a GO spine bone (and a child is a regular single sprite GO). If I instead use the GO containing the spine model as a parent - the assertion doesn’t seem to be broken.

1 Like

Hopefully it’s something we can detect.
Would you mind creating an issue in the extension spine repo, and preferably with a repro project attached?

1 Like