• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GMS 2.3+ Garbage Collector is crashing with "null pointer dereference" on physics object!

clee2005

Member
From GMS 2.3.1 runtime release notes:
In-Game: Some projects crash silently when changing rooms if garbage collector is enabled

Apparently it is fixed.
:)
Thanks for all your posts and details about the GC crashing... that information is invaluable and saved me a lot of time!

I ended up using the 2.3.1 beta and putting out one of our games to test the waters with it. I'm seeing a lot of errors in the Google Play Console :

GML:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.donkeysoft.wordwowfree <<<

backtrace:
  #00  pc 0000000000000004  <unknown>
  #00  pc 000000000010b98c  /data/app/com.donkeysoft.wordwowfree-1/lib/arm/libyoyo.so (MarkAndSweepGen(int, int, bool)+2116)
  #00  pc 000000000010d17c  /data/app/com.donkeysoft.wordwowfree-1/lib/arm/libyoyo.so (DoGenerationalGC(int)+332)
  #00  pc 000000000025b240  /data/app/com.donkeysoft.wordwowfree-1/lib/arm/libyoyo.so (DoAStep()+1236)
  #00  pc 000000000025b990  /data/app/com.donkeysoft.wordwowfree-1/lib/arm/libyoyo.so (MainLoop_Process()+1392)
  #00  pc 000000000037bb3c  /data/app/com.donkeysoft.wordwowfree-1/lib/arm/libyoyo.so (Java_com_yoyogames_runner_RunnerJNILib_Process+1016)
  #00  pc 000000000219db6b  /data/app/com.donkeysoft.wordwowfree-1/oat/arm/base.odex (offset 0x2143000)
Unfortunately, there are no details above the MarkAndSweepGen that can help point to where it might be crashing. I know @SnoutUp had the same issues with 2.3.0. Just wondering if anyone had any insight on these. Maybe they are still caused from the instance_destroy() in the room end events (I still have that in my code as I read all your posts after releasing this version to Google Play).
 

Tornado

Member
If this is of any help to you, we disabled GC
gc_enable(false);
and are calling
gc_collect();
only on dedicated placed when we consider it to be safe.

Also we removed all instance_destroy() from all Room End Events.
We done all of this already in 2.3.0.

I saw in release notes for 2.3.1 that they have fixed something, I tried quickly the old code with 2.3.1, it seems that the issue with instance_destroy() is fixed.
Also the demo project which I submitted to Yoyo doesn't crash in 2.3.1.

But this was only one problem with crashing the GC, as you already mentioned SnoutUp and other users had also GC crashes but without having instance_destroy() in the Room Events.

I hope this can help at least a little.
 
Last edited:

clee2005

Member
Awesome @Tornado ! Thanks very much. I'll try the manual gc_collect() and see if that brings down the exceptions that I'm seeing, and remove the instance_destroy commands from the room_end.

Much appreciated!
 

SnoutUp

Member
Awesome @Tornado ! Thanks very much. I'll try the manual gc_collect() and see if that brings down the exceptions that I'm seeing, and remove the instance_destroy commands from the room_end.
Much appreciated!
Please report on how it affects stability of the game. I also plan to try the manual gc_collect() out, but might take a while.
 
Top