Crash after sending a disable message to a sprite

The crash happens after a disable message to a specific sprite component during initialisation of a newly loaded proxy, giving me this message:

Assertion failed: i < Size(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 478`

I’ve spent considerable time trying to figure out what exactly causes it, but I’m having a lot of trouble with that. As I started removing pieces of the program to get a minimal repro version, the crash was happening less and less, though it triggers semi-reliably if I click away from the program while it’s being loaded. Therefore I’m sending both the minimal version and the full one (which is still pretty tiny).

In the full version, main/bootstrap.script loads main/loading/loading.collection as a proxy. This (due to a debug flag) immediately unloads itself and triggers loading of main/main_menu/main_menu.collection

This collection contains a gui and a game object containing the offending sprite and its controlling script which sends the disable message which seems to crash the program. Note that the sprite uses a custom shader, material and there’s a small change in the render script, but removing those changes doesn’t fix the issue.

I’ve found that:
- The crash happens only most of the time, not always. It doesn’t seem to affect an android build.
- Waiting a second before sending the message prevents the crash
- So does not sending the disable message at all
- Deleting the sprite/script and adding them back with different names/graphics doesn’t fix the issue
- Adding a second random sprite to the same game object prevents the crash, as long as it’s not sent a disable message too

In the stripped-down version, the bootstrap script loads the main_menu collection directly. The gui has had all its nodes removed, as well as fonts and all but one atlas. It has a script attached, but it is an empty file. Removing either the script or the atlas (or the gui altogether) seemed to prevent me from triggering the crash any more.

This is all on Defold 1.3.1 (via Steam) running on Windows 10.

I’d love to create an issue on github, but I’m kinda baffled by this whole thing and wouldn’t know how to describe it. Hopefully someone can make some sense out of this. Attached are the two version of the program and the crash log.

crash_mimimal.zip (114.9 KB)
crashing_project.zip (425.1 KB)
_crash.zip (20.0 KB)

1 Like

We’d like to look into this issue. Please create an issue in GitHub and include the information you shared here!

Done. I have tested the project on a different machine and it still crashes, so that rules out that it’s an issue with my installation, at least. I’m still baffled by the whole thing, though.

1 Like