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

Crash on Reloading AI #4490

Closed
DorpsGek opened this issue Feb 9, 2011 · 6 comments
Closed

Crash on Reloading AI #4490

DorpsGek opened this issue Feb 9, 2011 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Feb 9, 2011

MinchinWeb opened the ticket and wrote:

Using Windows 7 x64, Open TTD 1.0.5 (Stable).
I'm in the process of writing an AI. I had the game paused, pressed 'Reload AI' and the game crashed.

Attachments

Reported version: 1.0.5
Operating system: All


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

DorpsGek commented Feb 9, 2011

MinchinWeb wrote:

Here's the line from my AI that was causing the crash. ('Stage' and 'StageSteps' are both supposed to be integers)

AILog.Info(StageSteps + " / (" + Stage + " / 2) ) % 2 = " ((StageSteps / (Stage / 2) ) % 2) );


This comment was imported from FlySpray: https://bugs.openttd.org/task/4490#comment9640

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Terkhen wrote:

It might be helpful for reproducing the issue if you posted your AI here.

-----------

openttd.exe!SQFuncState::PopTarget() Line 292 + 0x8 Bytes C++
openttd.exe!SQCompiler::PrefixedExpr() Line 591 + 0xe7 Bytes C++
openttd.exe!SQCompiler::PlusExp() Line 510 + 0x5 Bytes C++
openttd.exe!SQCompiler::CompExp() Line 487 + 0x5 Bytes C++
openttd.exe!SQCompiler::BitwiseOrExp() Line 466 + 0x5 Bytes C++
openttd.exe!SQCompiler::LogicalAndExp() Line 443 C++
openttd.exe!SQCompiler::LogicalOrExp() Line 425 C++
openttd.exe!SQCompiler::Expression(bool funcarg) Line 350 C++
openttd.exe!SQCompiler::Statement() Line 298 + 0x10 Bytes C++
openttd.exe!SQCompiler::Statements() Line 196 C++
openttd.exe!SQCompiler::Statement() Line 271 C++
openttd.exe!SQCompiler::WhileStatement() Line 903 C++
openttd.exe!SQCompiler::Statement() Line 205 + 0x8 Bytes C++
openttd.exe!SQCompiler::Statements() Line 196 C++
openttd.exe!SQCompiler::Statement() Line 271 C++
openttd.exe!SQCompiler::IfStatement() Line 872 C++
openttd.exe!SQCompiler::Statement() Line 204 + 0x8 Bytes C++
openttd.exe!SQCompiler::Statements() Line 196 C++
openttd.exe!SQCompiler::Statement() Line 271 C++
openttd.exe!SQCompiler::CreateFunction(tagSQObject & name) Line 1310 C++
openttd.exe!SQCompiler::FunctionStatement() Line 1078 C++
openttd.exe!SQCompiler::Statement() Line 302 C++
openttd.exe!SQCompiler::Compile(SQObjectPtr & o) Line 171 C++
openttd.exe!sq_compile(SQVM * v, __int64 (void ) read, void * p, const wchar_t * sourcename, unsigned __int64 raiseerror) Line 131 + 0xf7 Bytes C++
openttd.exe!Squirrel::LoadFile(SQVM * vm, const char * filename, unsigned int64 printerror) Line 458 + 0x20 Bytes C++
openttd.exe!Squirrel::LoadScript(SQVM * vm, const char * script, bool in_root) Line 474 + 0x13 Bytes C++
openttd.exe!AIInstance::AIInstance(AIInfo * info) Line 136 + 0xf Bytes C++
openttd.exe!AI::StartNew(Owner company, bool rerandomise_ai) Line 55 + 0x1f Bytes C++
openttd.exe!DoStartupNewCompany(bool is_ai, Owner company) Line 503 C++
openttd.exe!CmdCompanyCtrl(unsigned int tile, DoCommandFlag flags, unsigned int p1, unsigned int p2, const char * text) Line 851 C++
openttd.exe!DoCommandPInternal(unsigned int tile, unsigned int p1, unsigned int p2, unsigned int cmd, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback, const char * text, bool my_cmd, bool estimate_only) Line 663 + 0x27 Bytes C++
openttd.exe!DoCommandP(unsigned int tile, unsigned int p1, unsigned int p2, unsigned int cmd, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback, const char * text, bool my_cmd) Line 524 C++
openttd.exe!AIDebugWindow::OnClick(Point pt, int widget, int click_count) Line 909 C++
openttd.exe!DispatchLeftClickEvent(Window * w, int x, int y, int click_count) Line 367 + 0x23 Bytes C++
openttd.exe!MouseLoop(MouseClick click, int mousewheel) Line 2147 C++
openttd.exe!HandleMouseEvents() Line 2200 C++
openttd.exe!WndProcGdi(HWND
* hwnd, unsigned int msg, unsigned int64 wParam, int64 lParam) Line 393 C++
user32.dll!000000007745c3c1()
[Los marcos siguientes pueden no ser correctos o faltar, no se han cargado símbolos para user32.dll]
user32.dll!000000007745c60a()
openttd.exe!VideoDriver_Win32::MainLoop() Line 847 + 0xb Bytes C++
openttd.exe!ttd_main(int argc, char * * argv) Line 762 C++
openttd.exe!WinMain(HINSTANCE * hInstance, HINSTANCE
* hPrevInstance, char * lpCmdLine, int nCmdShow) Line 430 C++
openttd.exe!__tmainCRTStartup() Line 263 + 0x21 Bytes C
kernel32.dll!000000007755f56d()
ntdll.dll!0000000077693021()


This comment was imported from FlySpray: https://bugs.openttd.org/task/4490#comment9641

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

MinchinWeb wrote:

The AI in question

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4490#comment9642

@DorpsGek
Copy link
Member Author

Rubidium wrote:

The reduced testcase for this error would be:

local Stage = 1;
AILog.Info(Stage + "" ());

Without the "Stage + " it compiles just fine and causes an error later on while running.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4490#comment9659

@DorpsGek
Copy link
Member Author

Yexo wrote:

Testcase can be simplified to:

a+0()

Just replace any info.nut with that and OpenTTD will crash during the AI scanning stage.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4490#comment9664

@DorpsGek
Copy link
Member Author

Yexo closed the ticket.

Reason for closing: Fixed

In r22055


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Squirrel labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant