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

It is possible to crash AI without producing error message #5320

Closed
DorpsGek opened this issue Oct 7, 2012 · 5 comments
Closed

It is possible to crash AI without producing error message #5320

DorpsGek opened this issue Oct 7, 2012 · 5 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 7, 2012

Kogut opened the ticket and wrote:

  1. Leaving Start function
  2. By changing-function-names voodo

main nut:

class TEST extends AIController{}

function Check(){}

_Check <- Check;
Check <- function()
{
local result = Check();
return result;
}

function TEST::Start()
{
AILog.Info("Checking")
Check();
AILog.Info("Passed")
}

info nut:

class TEST extends AIInfo {
function GetAuthor() { return "Kogut"; }
function GetName() { return "TEST"; }
function GetDescription() { return "TEST"; }
function GetVersion() { return 1; }
function GetAPIVersion() { return "1.2"; }
function CreateInstance() { return "TEST"; }
function GetShortName() { return "TEST"; }
function GetDate() { return "2012-10-1"; }
function UseAsRandomAI() { return false; }
}

function GetSettings() {

}

RegisterAI(TEST());

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5320
@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 7, 2012

Kogut wrote:

AI will crash on leaving Start function (it trivial to reproduce, as empty Start is enough, so no test AI was posted).


This comment was imported from FlySpray: https://bugs.openttd.org/task/5320#comment11566

@DorpsGek
Copy link
Member Author

Kogut wrote:

It is getting better, you may crash openttd using this method.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5320#comment11577

@DorpsGek
Copy link
Member Author

Zuu wrote:

What is the output in the log? Dose the "Passed" message get passed to the log? If OpenTTD crashes it might be necessary to run OpenTTD in a debugger in order to catch what happens.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5320#comment11617

@DorpsGek
Copy link
Member Author

Yexo wrote:

I can't get OpenTTD to crash with this (or similar) AIs. The reason is pretty simple and none of your function renaming seems necessary. What you have here is infinite recursion -> a stack overflow.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5320#comment11619

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 4, 2013

Rubidium closed the ticket.

Reason for closing: Duplicate

Of #5346


This comment was imported from FlySpray: https://bugs.openttd.org/task/5320

@DorpsGek DorpsGek closed this as completed Feb 4, 2013
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) duplicate component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant