Assertion failed: size <= Capacity()

I’m getting the error message above in debug/release bundles but not in editor builds. Any ideas?

Attaching some things, let me know what else I can provide please.

Debug symbols:
dmengine.zip (8.1 MB)

_crash file:
_crash.zip (1.6 KB)

Editor version: 1.2.191 d393bae6a361f86cf2263ab312c9b3cea45253ab

Windows 10

0 0x7FF630B6B430 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:142
 1 0x7FF630ED44A4 raise /tmp/job13466963903411766584/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547
 2 0x7FF630EC5200 abort /tmp/job13466963903411766584/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71
 3 0x7FF630EC4114 common_assert_to_stderr<wchar_t> /tmp/job13466963903411766584/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:175
 4 0x7FF630EC3C38 _wassert /tmp/job13466963903411766584/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443
 5 0x7FF630C1B1B0 dmGameSystem::RenderBatch D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_particlefx.cpp:266
 6 0x7FF630C1B640 dmGameSystem::RenderListDispatch D:\a\defold\defold\engine\gamesys\src\gamesys\components\comp_particlefx.cpp:312
 7 0x7FF630B84AD0 dmRender::DrawRenderList D:\a\defold\defold\engine\render\src\render\render.cpp:565
 8 0x7FF630CCBB70 dmRender::ParseCommands D:\a\defold\defold\engine\render\src\render\render_command.cpp:169
 9 0x7FF630C4E3C0 dmRender::UpdateRenderScriptInstance D:\a\defold\defold\engine\render\src\render\render_script.cpp:2932
10 0x7FF630C1F2B0 dmEngine::Step D:\a\defold\defold\engine\engine\src\engine.cpp:1566
11 0x7FF630C1C430 dmEngineUpdate D:\a\defold\defold\engine\engine\src\engine.cpp:1994
12 0x7FF630C21930 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:69
13 0x7FF630B51A20 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:137
14 0x7FF630E87B94 __scrt_common_main_seh d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
15 0x7FFBC7677020 BaseThreadInitThunk <unknown>:0
16 0x7FFBC85E2630 RtlUserThreadStart <unknown>:0

I’ve managed to hone in on it and pinpointed it to a particlefx component of all things.

Check out this repro:
pfx_crash_repro.zip (7.4 KB)

On Windows 10, this should build fine in the editor but bundles should crash on start. If you remove the “square” emitter then the problem goes away.

2 Likes

I think we know what the problem is.
As a temp workaround until the fix, you may create a factory with GO that has only one component: a particle without emitters. It should help for now.

Thank you for this report and especially for a repocase!

UPD: Crash in ParticleFX `Assertion failed: size <= Capacity()` · Issue #6333 · defold/defold · GitHub

2 Likes

Sorry to reopen this, but I am getting this same crash in html? It doesnt occur on desktop at all. Very odd.

Aborted(Assertion failed: size <= Capacity(), at: ../../../tmp/dynamo_home/sdk/include/dmsdk/dlib/array.h,514,SetSize) dmloader.js:820:40
    printErr http://localhost:56148/html5/dmloader.js:820
    abort http://localhost:56148/html5/index.html line 328 > injectedScript:1
    ___assert_fail http://localhost:56148/html5/index.html line 328 > injectedScript:1
    <anonymous> http://localhost:56148/html5/dmloader.js line 240 > WebAssembly.instantiate:2261124
    <anonymous> http://localhost:56148/html5/dmloader.js line 240 > WebAssembly.instantiate:667023
    <anonymous> http://localhost:56148/html5/dmloader.js line 240 > WebAssembly.instantiate:2516997
    <anonymous> http://localhost:56148/html5/dmloader.js line 240 > WebAssembly.instantiate:2570001
    browserIterationFunc http://localhost:56148/html5/index.html line 328 > injectedScript:1
    callUserCallback http://localhost:56148/html5/index.html line 328 > injectedScript:1
    runIter http://localhost:56148/html5/index.html line 328 > injectedScript:1
    Browser_mainLoop_runner http://localhost:56148/html5/index.html line 328 > injectedScript:1

I’ll try to get some debug info. But this happened since Ive been using the newer particlefx system. I’ll test to see if removing them solves it too.

What is your Defold version?
Also try to bundle(not build, but bundle) and run the game

Which version of Defold? And it works in a desktop build?

The particlefx system has been mostly left untouched for quite some time. There is no new system.

Version is: 1.9.8
Engine: 67542769598a1b794877c96f740f3f527f63f491

I removed all particlefx still same - occurs every run in html.
Happens on bundle and build html. (serving locally)
Also tested in Chrome, Firefox and MSEdge all the same result.
On desktop build (Win11 x64) everything runs fine, no errors.

Referring to the “new” particlefx system, the f18 project was built originally around 2-3 yrs ago and used the old particles. This is what I refer as new :slight_smile: .. soz.

I enabled debug info and such, and there isnt any extra info in console or in the folder? Is there somewhere there might be more detailed html debug info? are there crash dumps (or equivalent) for html?

Im probably going to park this, since Im working to get the desktop version ready. I was surprised to find the same error, which is why I added here. Is it possible there is some buffer limit I need to change in project settings that might help?

1 Like

I was surprised to find the same error

If you’ve removed the particle fx, I don’t think it’s a particle fx issue?
The message size <= Capacity() is just the check inside a dynamic array. We use such arrays in many places.

We’re slowly working on improving the HTML5 debugging experience, but other stuff keeps getting in the way unfortunately.

I think the best option is to report an issue and attach a repro case project that we can debug.

2 Likes

@Mathias_Westerdahl - thanks. I’ll try to make a small repro if I get the time. Not knowing where it is means Im not sure how to do that atm, so I’ll prob ignore the web side for a few weeks until I can slot some time in for it.

The reason I thought it might be particlefx because it looks very similar (but of course as you said its in a core array type, so could be anywhere) but also its one of the few things that is quite different in the game changes Ive done (Ive added various engine and smoke effects) and almost all the other changes have been purely state/ai/gui lua changes which I dont think even interact much with the engine itself (Im using imgui for the gui btw).

Thanks for the tips/ideas. If I come across a solve I’ll update.

1 Like

Back again. I think I might be onto the source of the problem, it might be meshes sizes. In the log (much earlier) I have this error:

ERROR:GAMESYS: The platform doesn't support 32 bit index buffers. See the setting 'model.split_large_meshes'
dmloader.js:820:40
    printErr http://localhost:51213/html5/dmloader.js:820
    _ http://localhost:51213/html5/index.html line 328 > injectedScript:1
    runEmAsmFunction http://localhost:51213/html5/index.html line 328 > injectedScript:1
    _emscripten_asm_const_int http://localhost:51213/html5/index.html line 328 > injectedScript:1
< cut out rest >

This error appears on Chrome, Firefox and MSEdge along with the assert (later in the console log).
I did also recently add a large road mesh that has alot of polys. Im working replacing that to test the theory, since I was doing some changes anyway. Will update if this ends up being the case.

Side note: I tried to use --model.split_large_meshes=1 in the html engine arguments, but it did nothing.

Yeah, we have this reported issue: Split large meshes option doesn't work · Issue #10201 · defold/defold · GitHub

1 Like