Closed rdelian closed 2 years ago
This might be a repro for this report from the forums, yes. Not entirely certain as you didn't mention what crash you got, but it matches the pattern.
I will provide a few dumps in the next 15 minutes or so
I somehow can't currently repro it on debug builds at least when waiting 'a few seconds' (b2699, at ~143 FPS, ran for two minutes now and it doesn't die), but the mention of measuring text (on MainThrd) while drawing similar text (on Render) makes it look like a race condition somewhere.
CfxCrashDump_2022_08_14_13_41_42.zip CfxCrashDump_2022_08_14_13_45_16.zip
A way to instant crash (for me atleast) is to put GetTextWidth(TEXT, 0.3)
in a for loop
It does seem to correctly crash on retail builds, with a crash in the GFx heap allocator (after showing some broken emoji for a frame).
This might be somewhat related to 103e46dc947a4bd3a6276ba418a74c8d639fc60b, or it might be a different way the original issue represents itself (checking Sentry data shows that this is indeed the latter).
Confusing, still, is how debug builds seem to be immune to this one.
Peculiar bonus is how a locally-built retail-style build also seems immune to this. Is this another case of having inadvertently fixed it somewhere locally, or a long chain of side effects leading to this being 'fine'?
This turned out to be an anticheat hook having a curious side effect. Fixed in fivem-private@0e12b5487213ad821d8d70741fee7bbe0abd5a1b
.
Info
Since a lot of my users started to crash recently with 'some gfx errors' and I didn't update the gamemode in a while, I started to investigate it.
The trigger seems to be Drawing on screen with natives, especially when I draw Emojis + Chars, but
GetTextScreenLineCount
/EndTextCommandGetWidth
has to be called too.If you need crash dumps or any aditional informations, let me know.
Repro
https://github.com/rdelian/repro_gfx_err/blob/main/client.lua It takes a few seconds before the crash, sometimes it just fails to draw anything on screen and it will throw a client script error
Client: b2189 Canary