Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory error in AI's ::Save() corrupts the emergency save. #7862

Closed
James103 opened this issue Dec 17, 2019 · 1 comment
Closed

Out of memory error in AI's ::Save() corrupts the emergency save. #7862

James103 opened this issue Dec 17, 2019 · 1 comment

Comments

@James103
Copy link
Contributor

Version of OpenTTD

2019-12-07 master (win7 32-bit)

Expected result

When an AI triggers an out of memory error when the game is saved, the emergency save is successful. When the emergency save is loaded, the AI that triggered the out of memory error is reloaded without saved data (as if a different AI was loaded in its place).

Actual result

When an AI triggers an out of memory error when the game is saved, the emergency save triggers the same out of memory error. The emergency save is empty.

Steps to reproduce

  1. Put the following code in an AI (or Game Script):
function AIController::Save() {
	array(1e9);
}
  1. Run the AI with the above code.
  2. The game will crash with an Out of Memory error.
  3. Attempt an emergency save.
  4. The game will crash again with the same Out of Memory error.
  5. Check the emergency save. The file is empty (size: 0 bytes).
@LordAro
Copy link
Member

LordAro commented Dec 28, 2019

Duplicate of #7641
The result is a little different, as now the game is crashing while trying to write the crash data...

@LordAro LordAro closed this as completed Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants