How to debug random GC.h crash on windows target?

Hi all,

My game runs flawlessly on AIR target (which is my test target), but crashes randomly when I run it on windows target.
When the crash happens Windows gives me the option to debug it in Visual Studio and it’s always the same error on the very same line, here is a screenshot :

my system’s language is french, the error message means “unhandled exception at 0x… in SuperAgency.exe : 0x… access violation while reading location 0x…”

I never touched c++ so I understand that it’s something about garbage collection, but I’m lost.

When I look at the local vars, inside __inCtx.marking.stack I see a bunch of Starling images and some matrixes but I have no idea what it means : are those objects about to be garbage-collected or something ?

I have a demo mode where the game runs on its own : it loads an arena, the AI characters fights to death, then everything gets cleared / pooled, then it loads an arena again etc rinse repeat.

On AIR I can have this demo mode running for hours but on windows target it will end up crashing randomly : it can crash after 4 fights or 15+ fights, there doesn’t seem to be any “rule”. The point at which it crashes also looks random : it can happen at any point during the fight.

Lately I put a lot of efforts hunting the slightest memory leak, and most of the objects are pooled. The game uses openFL, Starling, dragonbones, msignal, Actuate, StablexUI, firetongue and crashdumper (which fails at catching the crash)

Any help with this would be very welcome : is there a way to get more info about the crash ? Any tip or advice about what I should do to solve it ?

Thanks a lot !

What versions haxe, hxcpp, openfl, and lime are you using? Compiling 64bit or 32?

Oh sorry, should have specified that :

haxe 4.1.0 (had the same issue with 4.0.3)
hxcpp 4.1.1
lime 7.7.0
openfl 8.9.6

as to 32 or 64 bits I have to say I don’t know : I’m using haxedevelop, I select windows target and hit F5… I’d love to learn more though

my system is 64 bit, I installed haxe 64 bit

When it compiles, here is the output I see

Building SuperAgency
Running Pre-Build Command Line…
cmd: “C:\HaxeToolkit\haxe/haxelib” run lime build “project.xml” windows -debug -Dfdb

Running process: C:\Program Files (x86)\HaxeDevelop\Tools\fdbuild\fdbuild.exe “D:_Dev_Project\SuperAgency\dev\SuperAgency\SuperAgency.hxproj” -ipc ed54966c-b3c7-40c6-813c-dcac59d7c84c -version “4.1.0” -compiler “C:\HaxeToolkit\haxe” -library “C:\Program Files (x86)\HaxeDevelop\Library” -target “windows”

cl.exe -Iinclude -nologo /WX- /fp:precise -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:_Dev_Project\SuperAgency\dev\SuperAgency\bin\windows\obj\obj/msvc1964-debug-nc/vc.pdb(optim-std) -Zi(debug) -FdD:_Dev_Project\SuperAgency\dev\SuperAgency\bin\windows\obj\obj/msvc1964-debug-nc/vc.pdb(debug) -Od(debug) -O2(release) -bigobj -Os(optim-size) -FS -Oy- -c -EHs -GS- -IC:/HaxeToolkit/haxe/lib/hxcpp/4,1,1/include -DHXCPP_DEBUG -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_CHECK_POINTER(haxe) -DHXCPP_STACK_TRACE(haxe) -DHXCPP_STACK_LINE(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=400(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 … tags=[haxe,static]