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

[Bug]: OpenTTD can think that no AI or GS are available if Maximum memory allocation exceeded #9588

Closed
James103 opened this issue Sep 29, 2021 · 0 comments

Comments

@James103
Copy link
Contributor

James103 commented Sep 29, 2021

Version of OpenTTD

20210929-master commit e89be8d on Windows 10 64-bit

Expected result

When Maximum memory allocation exceeded occurs during parsing a script's info.nut, only that script is removed from the list and not any others.

Actual result

When Maximum memory allocation exceeded occurs during parsing a script's info.nut, not only is that script removed from the list, but the following two things happen that mean you must restart the game to use AI or GS:

  • Any other scripts found during execution of rescangame will also not be added to the list because of the same error.
  • Further executions of rescangame will not work at all until game restart, even if the excessive allocation is prevented.

Steps to reproduce

  1. Make sure you have at least 3 GB of available RAM. The array(1e8) at line 1 of the script's info.nut will allocate approximately 1.6 GB of RAM.
  2. Extract the following ZIP into your home directory's OpenTTD\game folder.
    _TestGS.zip
  3. Start up OpenTTD.
  4. Download some game scripts.
  5. Notice that they don't show up.
  6. Extract the following ZIP into your home directory's OpenTTD/ai folder.
    _TestAI.zip
  7. Run rescanai twice.
  8. Download some AIs.
  9. Notice that they don't show up.
  10. Exit OpenTTD.
  11. Restart OpenTTD.
  12. The game crashes with (parenthetical phrase added in post):
Crash reason:
 Exception: E06D7363 (Unhandled C++ Exception)
 Location:  00007FFAF9D74F99
 Message:   <none>

crash.zip

glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 1, 2021
…ript registration could prevent further script detections

Also the allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated was not freed either.
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 1, 2021
…ript registration could prevent further script detections

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
glx22 added a commit to glx22/OpenTTD that referenced this issue Oct 1, 2021
…ript registration could prevent further script detections

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
@glx22 glx22 closed this as completed in ccd586a Oct 2, 2021
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
…ript registration could prevent further script detections (OpenTTD#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
…ript registration could prevent further script detections (OpenTTD#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
…ript registration could prevent further script detections (OpenTTD#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
…ript registration could prevent further script detections (OpenTTD#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
TrueBrain pushed a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
…ript registration could prevent further script detections (OpenTTD#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
TrueBrain pushed a commit that referenced this issue Oct 3, 2021
…gistration could prevent further script detections (#9589)

Also the memory allocation triggering the limit was never freed.
And if the exception was thrown in a constructor using placement new, the pre-allocated memory was not freed either.
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

1 participant