Spine draw order error: Assertion failed: size <= Capacity() (DEF-2702) (SOLVED)


Greetings, lately i’ve encountered an interesting error:
Assertion failed: size <= Capacity(), file C:\buildbot\slave\builds\engine-win32-master\build\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 437

If the error occurs right after saving the game localy, then after loading the game it pops up again and the game continues to crash until i delete my save. During the crash i’m creating an object with a spine models, adding some gui nodes and extra table values. However i’ve failed to pin point an exact moment the error occurs, sometimes it happens before creating everything and saving the file, sometimes after creating everything. My only guess is that i’m exceding some kind of table capacity. Anyone know a reason why this could be happening?

Tried replicating the crash on Android but couldnt. I guess this is an editor issue?

1 Like


You have stumbled onto an engine bug for sure. You are indeed running out of resources, but the engine should let you know what is going on in a better message than that assert. You could inspect the web profiler to see if any counter is unreasonably high (a common mistake is to forget to delete everything you create through factories). Another thing you can try is spawning whatever your game is spawning, but more, to trigger the assert without saving/loading involved, and then remove one type of thing at a time to see when the assert stops firing.



Thanks for the advice. Managed to track down the crash to certain animations of one spine model. It’s strange since the model was working fine a while ago. I guess i’ll have to look for specific things in the animation which could be causing this.



Great, thanks, that should be enough info for us to track it down and fix it better.

1 Like


Greetings, apparently, using Draw Order in spine was the cause for the crash. After removing Draw Order everything seems to work fine. I’m attaching the sprites for the model and 2 json files(one crashing and one working) in case you guys want to have a look at it.
one_with_nature.zip (724.4 KB)



Thanks a lot, we really appreciate that!

1 Like


Hi Rytis!

Found the issue, working on a fix, thanks for reporting! :slight_smile:

Updated thread title and added the issue id: DEF-2702



Solved in Defold 1.2.104.

1 Like


I’ve just got this error again. Seems random :expressionless:

Assertion failed: size <= Capacity(), file C:\buildbot\slave\builds\engine-win32-64-master\build\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 437



Did you get a crash dump you can share?



No crash dump that I can find. The message appears in the console window.



It should say in the console that it wrote to a crash log.



It doesn’t. Just the assert:

1 Like


Do you know what you changed that triggered the engine to crash? I’m guessing it might not be a spine related thing this time.

The size <= Capacity() assert check can come from many different places in the engine so it would be nice to have a repro case. :+1:

1 Like


I’m not using spine in my game. The error happens at random - simply re-running the game usually results in everything working normally. Will try to get a small example case project for you.




The same happened to me, when randomly running a game at the very beginning (a small change in a script - zoom of the camera, then running again without changing anything and it’s ok, so it doesn’t matter what is changed). Windows 10. Defold 1.2.163.

Assertion failed: size <= Capacity(), file C:\buildbot\slave\builds\engine-win32-64-master\build\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 437

Earlier I didn’t care about it, but it’s not the first time it happen. It always occurs with the same message, game hangs.

1 Like