Closed KeeVeeGames closed 10 months ago
I also have a similar issue with arrays+structs (I'm assuming) in VM: having the garbage collector enabled by default produces some random silent crashes in VM, while disabling it fixes the issue.
I haven't gotten so in depth as the original poster and I'm trying to narrow it down and get it into a small project for reporting.
It looks like the issue here is caused by the construct foo ??= new Obj()
not being handled correctly by the compiler. if you want to avoid that just now it would be a good idea
gh-gmb-2627_nullish_newobject.zip
This is a simpler sample which isolates the problem - it doesn't actually crash but we can more easily see what's going wrong internally with this.
Fixed in 2024.2
Verified fix in IDE v2024.200.0.461 Runtime v2024.200.0.477, thanks.
Description
I am not sure if these two bugs are related, but taking into account the similarity of their conditions and the fact that they happen on the same project (so no need to send it two times) I posted them in one issue. Sorry for the possible inconvenience in future tracking.
There are occasional silent crashes and struct corruptions in my project. I wasn't able to reproduce them on a smaller scale so I had to send the full game instead.
The silent crash happens after going into the level room from the level selection menu. It yields the
-1073741819
status error in Output without any exceptions. After debugging in Visual Studio I concluded that it's related to garbage collector, specifically to theMarkAndSweepGen
function. The issue is not observed with thegc_enable(false)
and manualgc_collect
s. More info: https://forum.gamemaker.io/index.php?threads/2023-11-release-thread.107587/post-649403The second bug is causing a static method variable to "disappear" from the constructor. After re-entering the room (if the first crash hasn't happened) an exception will be raised with the "Unable to get variable setRGB from object ..." although the variable definitely should be in that object. It's most certainly not a coding mistake and possibly also related to the garbage collector because it's not observed in VM and disappears with the GC disabled in the same fashion as the issue above.
Possible relation to #1910, #1617, #2253, https://forum.gamemaker.io/index.php?threads/how-to-debug-a-crash-that-doesnt-leave-an-error.101560/post-613634
Steps To Reproduce
5f4c8c2a-6ba7-466c-a882-f82d850e0793