Out of memory error. What does PP=155 refer to?

Started by Dave Gilbert, Thu 23/01/2014 17:50:37

Previous topic - Next topic

Dave Gilbert

A number of testers are reporting this error:

"Out of memory: failed to allocate -3120 bytes (at PP=155)"

In doing some research on this forum, it appears that the PP number refers to a specific action that the game is performing (load room, drawsprite, etc). Does anyone know what the number 155 is referring to? It doesn't appear to be in the manual anywhere. That would help me narrow down what the problem could be.

Thanks!

-Dave

Crimson Wizard

Those numbers are only in the engine code, they were never mentioned in the manual.
I would also mention that negative amount of required memory possibly indicates that the amount requested was so large that it caused value overflow. Might be an engine logic error, or corrupted game data.

PP = 155 checkpoint is right before the speech is displayed on screen.

Dave Gilbert

Aha! Thanks. :) That helped me narrow it down. There was a SayAt command that accidentally used a negative number for width. :D

Crimson Wizard

Quote from: Dave Gilbert on Thu 23/01/2014 18:52:13
Aha! Thanks. :) That helped me narrow it down. There was a SayAt command that accidentally used a negative number for width. :D
This means there's unsafe code in the engine. I believe this should be corrected.
I can't reproduce the error though. I assume you are using Sierra with background speech style? Maybe there are some specifics?

Atavismus

Quote from: Crimson Wizard on Thu 23/01/2014 18:34:54
Those numbers are only in the engine code, they were never mentioned in the manual.
I would also mention that negative amount of required memory possibly indicates that the amount requested was so large that it caused value overflow. Might be an engine logic error, or corrupted game data.

PP = 155 checkpoint is right before the speech is displayed on screen.
Is there a list of the PP "codes" somewhere?
I guess it could be useful to publish one.

Wyz

The PP codes refer to specific places in the engine code which is useful for developers to track down at which point something went wrong in the engine code. If you are not ready to read engine code they are not very useful I'm afraid. If you do you can search for them in the source.
Life is like an adventure without the pixel hunts.

Atavismus

#6
Thx for your answer Wyz.
Well, I checked the source code yesterday, but was not sure where to search.
Now, I have a starting point. :)

If someone mind and already get this one, the PP code I'm looking for is 6.

EDIT: Seems to be here:
https://github.com/adventuregamestudio/ags/blob/c9bb64ee2698ad1135fd28c3bba15a2ee5a553a4/Engine/main/game_run.cpp
And related to game_loop_update_events();

Crimson Wizard

The problem with these PPs is that they let you know the approximate location of crash. But they do not let you know when the initial error in the engine occured (it could happen minutes before and in another part of the code).

Atavismus

Ok Crimson Wizard, thx for this precision.
According to you, what is the best way to track those "Out of memory: failed to allocate..." issues?

Crimson Wizard

#9
Quote from: Atavismus on Mon 11/05/2015 13:51:22
According to you, what is the best way to track those "Out of memory: failed to allocate..." issues?
Well, objectively the best way is to run the program under debugger, and make it crash, then observe the situation.

We may try to write memory allocation to the log to see how much memory is used by program, and when does it start to grow.

Atavismus

Ok thx again.
It could be interesting indeed.
For the moment, it seems fixed (as advised in some threads I delete my dynamic sprite and we redo the concerned room in case of corrupted data).
Our game should be released this week on steam, that's hard times to get such weird error. :D

selmiak

Quote from: Atavismus on Mon 11/05/2015 14:20:48
Our game should be released this week on steam, that's hard times to get such weird error. :D
8-0 :-D

Atavismus

#12
Mind, before Dustbowl and with other projects, I have that error sometimes when I try to compile*:

"Unable to register for Vista Game Explorer: Unable to replace resource: EndUpdateResource for __GDF_XML failed: 0000006E
Unable to set EXE name/description: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
"

I never bothered about it, because I always thought that was a windows error and it compiles fine after another try so...
But I'm becoming suspicious with everything those last time...
We use AGS 3.3.3 but I had also that issue with previous versions.
Of course we don't use Vista (but Windows 7).
*(Same for my colleague)

Dave Gilbert

This happens to me all the time. I just chalk it up as one of those AGSisms that I ignore, but if it's indicative of another problem, it would be nice to know!

Atavismus

Thx Dave, we feel less alone :D
And indeed, we want to know! Tell us the truth! It's a conspiracy right?!
(Sorry, adrenaline of project end ^^)

Crimson Wizard

Atavismus, if you can reproduce this problem more or less easily, I could debug your game for you and see what's happening.

Atavismus

Thx a lot Crimson Wizard. :)
For the moment, it seems fixed, no crash anymore, we are continuing tests.
I'll pm you in last resort. ^^

About the "vista" error, I can get it by compiling the default template (but more rarely than with an "heavier" project with more files).

SMF spam blocked by CleanTalk