ReloadAI crashes

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

ReloadAI crashes

Post by wilco_moerman »

I noticed that the game directly crashes if you try to reload your AI in r13442.

The same happened in r13355 but only after a few "reloads" (in the same game). Also if the "newgame" command was issued on the console then the game crashed after "start_ai ....".

(Is this the correct place to post this kind of stuff?)
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: NoAI Branch - An AI Framework

Post by Zutty »

wilco_moerman wrote:I noticed that the game directly crashes if you try to reload your AI in r13442.

The same happened in r13355 but only after a few "reloads" (in the same game). If the "newgame" command was issued on the console then the game crashed when "start_ai ...." was used.

(Is this the correct place to post this kind of stuff?)
You can report bugs here. I'd report my issue above, but I'm not sure if its expected behaviour or not!
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: NoAI Branch - An AI Framework

Post by Yexo »

wilco_moerman wrote:I noticed that the game directly crashes if you try to reload your AI in r13442.

The same happened in r13355 but only after a few "reloads" (in the same game). Also if the "newgame" command was issued on the console then the game crashed after "start_ai ....".

(Is this the correct place to post this kind of stuff?)
As Zutty pointed out, you can report it on flyspray. However, if you post it here it'll get read. About the first bug: get the lastest version (can you compile yourself?) and try if the game still crashes.

The issue about start_ai after a new_game command is known and was fixed in r13454. Thanks for reporting and please keep posting any bugs here or on flyspray. If you want a fast reaction or follow latest development, irc is a good place (#openttd.noai @OFTC).
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

Yexo wrote:
wilco_moerman wrote:I noticed that the game directly crashes if you try to reload your AI in r13442.

The same happened in r13355 but only after a few "reloads" (in the same game). Also if the "newgame" command was issued on the console then the game crashed after "start_ai ....".

(Is this the correct place to post this kind of stuff?)
As Zutty pointed out, you can report it on flyspray. However, if you post it here it'll get read. About the first bug: get the lastest version (can you compile yourself?) and try if the game still crashes.
I can't compile here, but I thought I was already using the latest NOAI-binaries. I have tried it with r13442 (latest) and two older ones. All of them have the same error.
The issue about start_ai after a new_game command is known and was fixed in r13454.
OK, any idea when it will apear on http://nightly.openttd.org/noai/scoreboard.php? Because that is still r13442 instead of r13454
Thanks for reporting and please keep posting any bugs here or on flyspray. If you want a fast reaction or follow latest development, irc is a good place (#openttd.noai @OFTC).
maybe I'll do that.


I wanted to start a server with restart_game_year = 2007 and starting in 1998 (for the TJIP challenge) and just let it run all night for testing. But if the game crashes after each "newgame" that won't work.

I am trying to implement an AI using a neural network, but networks need a lot of runs to train. That is why I need to start new games and save and load data. The network needs to be stored and loaded between each run. The saving works by using the console to output a script. I'll try to do the loading by modifying the .nut-files automatically using some Java-programming. I'll just get the parts I need from the console-output and substitute them into the .nut-file.

It might be ugly, but as far as I can see it's the only way to transfer information between successive AI's.
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

TrueLight wrote: Nightlies run every night at 1800 CEST ... and the commits are made after that ;) So check back in ... 10 minutes :p
hmmm, I still get the same error with r13474. Pressing the "reload AI" button still crashes the game :(
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: NoAI Branch - An AI Framework

Post by Yexo »

wilco_moerman wrote:
TrueLight wrote: Nightlies run every night at 1800 CEST ... and the commits are made after that ;) So check back in ... 10 minutes :p
hmmm, I still get the same error with r13474. Pressing the "reload AI" button still crashes the game :(
Can you post your ai? That'll help debugging the problem.

Are you using windows/linux?
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: NoAI Branch - An AI Framework

Post by glx »

And we need the exact message if there's any.
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

Yexo wrote: Can you post your ai? That'll help debugging the problem.
I'm in the TJIP competition, so that is a problem. But I can recreate the problem without giving away any juicy bits :D
If I try to start Convoy (posted earlier in this topic) or wrightai the same happens. So it would seem that it is not specific for my AI.
Are you using windows/linux?
windows 2000
Last edited by wilco_moerman on 11 Jun 2008 16:53, edited 1 time in total.
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

glx wrote:And we need the exact message if there's any.
I only get a screen saying "Runtime Error!" and "abnormal program termination"



edit:
my error is similar to this post from earlier in this topic, only for the latest binaries I don't get this error, only the runtime error + abnormal termination.
kuifware wrote:(..)

Bug report: I noticed that in the latest SVN revision (r13197-noai) you can crash OpenTTD by starting an AI, issuing the restart command in the in-game console and starting an AI again:
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: C:\Games\OpenTTDNoAI\openttd.exe
File: /compile_farm/openttd/noai/compile.../ai_threads.cpp
Line: 370

Expression: thr == NULL

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------
Abort Retry Ignore
---------------------------
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

TrueLight wrote:
Zutty wrote:I'm sorry to bump my own post, but I don't suppose anyone can answer this question can they? :) Its kind of blocking my development at the moment.
It is fixed now, and in 5 hours and 25 minutes in the binaries that will produced by then :)
any more news on the crashes related to start_ai?
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoAI Branch - An AI Framework

Post by TrueBrain »

wilco_moerman wrote: any more news on the crashes related to start_ai?
We can't reproduce the problem, so that is a problem :) Would you be able to join IRC? Or else can you give a detailed description of what you are doing? (what, when, how, like: start OpenTTD, create a new game, open console, type this, and that, and then: BOOM!). Tnx :)
The only thing necessary for the triumph of evil is for good men to do nothing.
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: NoAI Branch - An AI Framework

Post by wilco_moerman »

TrueLight wrote:
wilco_moerman wrote: any more news on the crashes related to start_ai?
We can't reproduce the problem, so that is a problem :)
:)
Would you be able to join IRC? Or else can you give a detailed description of what you are doing? (what, when, how, like: start OpenTTD, create a new game, open console, type this, and that, and then: BOOM!). Tnx :)
1.) I start openttd by executing openttd.exe (in Windows 2000)
2.) I start a new game
3.) on the console, I type "start_ai wrightai" (and wrightai starts to work)
4.) In the ai-debug window, I press "reload AI" and BOOM!
4b.) more formally, the BOOM should be described as:

"Microsoft Visual C++ Runtime Library
Program: F:\tjip-challenge\OTTD-win32-noai-r13474-noai\openttd.exe
abnormal program termination"

this is in r13474 (downloaded yesterday). The same happens when I start a server and press reload. If I start the server and just let it run until it resets itself and automatically starts the AI, the game also crashes
edit: I also get the crash when i start an AI at the console and then try to exit the game!

in an older binary (r13355) the game only sometimes crashes on reload. If i continue to press reload, it crashes (after perhaps 10 or 20 or 30 reloads).
edit: Here the game doesn't crash when I try to close it after I have started an AI.



Is this enough information? Could it be something that is specific to win2k for instance? I was able to recreate this error on another pc (albeit with the same win2k distribution on it. I don't have any other operating systems here).
Last edited by wilco_moerman on 12 Jun 2008 11:34, edited 4 times in total.
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: ReloadAI crashes

Post by glx »

I made an MSVC release build, to get a crash.dmp and crash.log. That way I hope I will be able to find where it crashes. You can get it at http://devs.openttd.org/~glx/OTTD-MSVC- ... 7-noai.zip
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: ReloadAI crashes

Post by wilco_moerman »

glx wrote:I made an MSVC release build, to get a crash.dmp and crash.log. That way I hope I will be able to find where it crashes. You can get it at http://devs.openttd.org/~glx/OTTD-MSVC- ... 7-noai.zip
this is weird... :shock:
I don't get any crashes (related to the AI-reload) with your build in singleplayer mode. I must have pressed reload about a hundred times, and nothing stranges happens. And also no problems after I issue the "newgame" command on the console and restart the wrightai and press reloadAI many times. This is very strange, because I did always crashes with the binaries with the same number (r13487) when I did those things. Running a server also doesn't have the problems it had before.

On the other hand, I now get a crash when I press enter when I am in the create-world-menu when I want to start a single-player game. This is strange, because it doesn't result in a crash in the other binaries that I have tested (r13355, r13435, r13442, r13474 and r13487). Your build is also r13487, but I do get crashes with pressing enter every time! (Not that you hear me complaining about this one, I can do without the enter-key for a while :) )

What did you do? There must be a subtle difference between the binaries and your build?
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: ReloadAI crashes

Post by glx »

The "enter" crash should now be fixed. But we still fail to reproduce the "Reload AI" one.
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: ReloadAI crashes

Post by wilco_moerman »

glx wrote:The "enter" crash should now be fixed.
good. Somehow I am predisposed to press enter when I see a menu. Is it possible to implement "enter" in a menu instead of pressing "ok" (I guess I am lazy :D )?
But we still fail to reproduce the "Reload AI" one.
weird. I got it with all the binaries I tested, except the one that was made to generate some debugging info :?

I haven't tested the lastest binaries yet.

edit: OK, now I have tested it, and it crashed the first time I pressed Reload! :shock: :shock: :shock:

I don't get it. Are there other win2000 users who experience the same problem? Is my house haunted (I get the same problem on another Win2000 computer)? And why did the binaries created for debugging purposes don't crash?
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
Finaldeath
Engineer
Engineer
Posts: 72
Joined: 09 Apr 2006 23:49
Location: UK
Contact:

Re: ReloadAI crashes

Post by Finaldeath »

Try doing it in a new separate folder and rename your original config file so it gets replaced, just to be sure. :)

I'll try it myself sometime to see, not got a new build recently.
Finaldeath
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: ReloadAI crashes

Post by wilco_moerman »

Finaldeath wrote:Try doing it in a new separate folder and rename your original config file so it gets replaced, just to be sure. :)
I already have my own config file and I have installed each build in its own directory
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: ReloadAI crashes

Post by glx »

Let's try something else. I've built a the latest version using mingw (so similar to the nightly). It's available on http://devs.openttd.org/~glx/OTTD-MINGW ... 9-noai.zip
wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: ReloadAI crashes

Post by wilco_moerman »

glx wrote:Let's try something else. I've built a the latest version using mingw (so similar to the nightly). It's available on http://devs.openttd.org/~glx/OTTD-MINGW ... 9-noai.zip
crashes first time I press "reload AI", both in singleplayer and multiplayer.
Nunc dimittis servum tuum Domine secundum verbum tuum in pace
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 35 guests