BDB block issue

Posted by jdev
Hi,

Whenever I load up one of the BDB's blocks that I have, it spits out a "Fatal Error" "Out of Memory" error.

Any solutions?

Replies (27)

Last message on 2 Dec 2018

Size43 (Administrator) on 18 Nov 2018, 15:35:28
Can you provide a few of the BDB ids that cause these issues?
jdev (Topicstarter) on 18 Nov 2018, 16:00:07
I had some cheaters create over 5,000 GameINI's somehow, so props to them, but I've since cleaned this (I spoke about this on Discord with you) and ever since those 5,000 GameINI's were created, all the BDB's seems to be unusable and spit out these Out of Memory errors.
jdev (Topicstarter) on 18 Nov 2018, 15:57:48
It seems to be all BDB's that do this. My game cannot operate without them so this is slightly concerning for me.
Size43 (Administrator) on 18 Nov 2018, 15:59:47
Are you maybe creating instances or something like that based on the data in the BDB? And if so, could that potentially create way too many?

The stored BDBs are still only 8KiB in size, so I don't suspect this is something on my end.
jdev (Topicstarter) on 18 Nov 2018, 16:03:02
It can't be anything in my code because I released an update around a week ago (everything was working normally) and then a day later I woke up to the 5,000 INI's and the Out of Memory errors on all worlds (BDB's). I'll double check through the code but I doubt it would be anything code related as I try to keep performance above 60fps at all times.
jdev (Topicstarter) on 18 Nov 2018, 16:06:47
OK, so I've just tried to access BDB 1000, which I know for a fact hasn't ever been touched since I started using BDB's, and it's giving me the same Fatal Memory Error Out Of Memory error.
jdev (Topicstarter) on 18 Nov 2018, 16:52:30
Update: Even when [bold]creating[/bold] BDB's it's giving that error.
jdev (Topicstarter) on 18 Nov 2018, 17:29:15
Sending variable image_angle = 0
Sending variable image_blend = 16777215
Received Lock for BDB 1
Received BDB 1
Loaded world data with index: 1
Out of Memory allocating 28988283676819472 bytes
Compile finished: 16:16:58



Here's where the errors happen (Happens in all BDB's ids) after the 5,000 GameINI's were created.
Size43 (Administrator) on 22 Nov 2018, 20:38:30
Can you try to figure out which line of code is causing the problem? You can do this by setting a breakpoint in the world loading code and then stepping through line-by-line until it crashes.
jdev (Topicstarter) on 22 Nov 2018, 22:25:30
This isn't a code issue as the update that I released was perfectly fine, and loaded everything in less than a second. After the 5,000 GameINI's were created, then the error started happening on every single older client using BDB's, and the update that was working fine before the 5,000 GameINI's were created.

I will add a breakpoint and get back to you. Could this be a GameINI cache issue? It's trying to allocate around 20 petabytes of data, which is ridiculous.
jdev (Topicstarter) on 22 Nov 2018, 22:47:06
OK, so it seems to crash with the Out of Memory error before it even tries to load the BDB, but that doesn't make sense because it's running code in on_load_world before it crashes, but it doesn't even seem to reach that script before crashing.

Would it just be easier to maybe move the entire game data (on your end) to a new GameID, maybe this would fix the issue? We would most likely have to talk on Discord about this though.
jdev (Topicstarter) on 22 Nov 2018, 22:52:12
Alright, I've got more data for you:

It seems that it goes through the on_load_world script, and get's about half way through before crashing.

Received BDB 1
Loaded world data with index: 1
1
2
3
Out of Memory allocating 28988283676819472 bytes
Compile finished: 21:49:28


(Continued in next post because there's a character limit)
jdev (Topicstarter) on 22 Nov 2018, 22:53:55
Link to the code as there's a character limit on here:https://justpaste.it/42n56
jdev (Topicstarter) on 22 Nov 2018, 22:59:15
OK, I am very fairly certain it crashes at the ds_grid_resize line of code, as it reads the debug message before it, but not after it:

for(var i = 0; i < num_layers; i++)
            {
                show_debug_message("3 (code doesn't get further than this)");
                ds_grid_resize(layer[i], width, height)
                show_debug_message("ds_grid_resize OK");
            }
jdev (Topicstarter) on 22 Nov 2018, 23:18:03
When I comment out the ds_grid_resize, I get thousands of these in the console very quickly:

Grid 1, index out of bounds writing [0,4253] - size is [32,32]
Grid 1, index out of bounds writing [0,4253] - size is [32,32]
world_set 2 OK
4 world set
Grid 2, index out of bounds writing [0,4253] - size is [32,32]
Grid 2, index out of bounds writing [0,4253] - size is [32,32]
gms_bdb_read OK
Grid 0, index out of bounds writing [0,4254] - size is [32,32]
Grid 0, index out of bounds writing [0,4254] - size is [32,32]
world_set 1 OK
Grid 1, index out of bounds writing [0,4254] - size is [32,32]
Grid 1, index out of bounds writing [0,4254] - size is [32,32]
world_set 2 OK
4 world set
Grid 2, index out of bounds writing [0,4254] - size is [32,32]
Grid 2, index out of bounds writing [0,4254] - size is [32,32]
gms_bdb_read OK
Grid 0, index out of bounds writing [0,4255] - size is [32,32]
Grid 0, index out of bounds writing [0,4255] - size is [32,32]
world_set 1 OK
jdev (Topicstarter) on 23 Nov 2018, 19:46:37
The game crashes even on Android, which I know for a fact was working perfectly fine before the 5,000+ GameINI's were created by the cheaters. I am 99% certain that this cannot be fixed on my end.
Size43 (Administrator) on 23 Nov 2018, 21:12:16
What are the values of width and height, and are those correct?

I'm not quite sure what you'd want me to do to fix this on my end.
jdev (Topicstarter) on 24 Nov 2018, 01:45:43
I've never touched them and they were working before the cheaters created the INI's. I think it might've downloaded the INI data on all clients and then never really got rid of it, so maybe some sort of caching issue with my game that only you could fix.

Maybe we should try moving my game to a new GameID, I don't know if you could do that or not but maybe it's worth a shot?

Your ongoing help is appreciated nonetheless. But this is definitely an issue your side and I have no idea on how either me or you are to do to even try and fix this. I guess you need more information about what happened to maybe fix it.
Size43 (Administrator) on 27 Nov 2018, 15:56:44
What are the values of width and height, and are those correct?

The only thing I can really do from my end is restore a BDB backup, but I can't guarantee that that would fix anything.
jdev (Topicstarter) on 29 Nov 2018, 00:41:49
Yes, please could you restore BDB backups, that may resolve it. Maybe restore it from over a month ago if that's possible.
Size43 (Administrator) on 29 Nov 2018, 18:23:59
From what date would you like me to restore a backup?
jdev (Topicstarter) on 29 Nov 2018, 21:01:34
8th November 2018. Thank you.

Would you be able to speak on Discord so I can tell you the results as you do this?
Size43 (Administrator) on 2 Dec 2018, 13:47:33
Alright, I've restored your BDBs from a backup from the 8th of november.
jdev (Topicstarter) on 2 Dec 2018, 16:30:58
OK, so this has not been successful and I am still receiving the Out of Memory errors. What is the next step? Moving to a new GameID?
jdev (Topicstarter) on 2 Dec 2018, 16:37:54
Received Lock for BDB 1
Received BDB 1
Loaded world data with index: 1
1
width: 18432
height: 25441
2
3 (code doesn't get further than this)
Out of Memory allocating 28988283
jdev (Topicstarter) on 2 Dec 2018, 16:38:55
My room height and width of the rooms the worlds use are 2048, 2048.
jdev (Topicstarter) on 24 Nov 2018, 01:48:53
To add on, if this is a flaw in your system (which I'm almost if not 100 percent certain it is), this can be and will most likely be done to me again as an attack, so maybe we should arrange a time and speak on Discord for an hour or two to discuss what happened.

Let me know here.