Crashing with more than one AI

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

Post Reply
User avatar
paullb
Traffic Manager
Traffic Manager
Posts: 129
Joined: 19 May 2008 13:11

Crashing with more than one AI

Post by paullb »

I have noticed with the latest noai nightly r13512, that whenever there is more than one AI running it seems to crash the game.

Based on what I have seen, my best guess that it would happen when both of the AIs try to build at the same time.

Anyone else had this experience?
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Crashing with more than one AI

Post by glx »

You forgot to give us all details. OS, message if any, how to reproduce...
User avatar
paullb
Traffic Manager
Traffic Manager
Posts: 129
Joined: 19 May 2008 13:11

Re: Crashing with more than one AI

Post by paullb »

glx wrote:You forgot to give us all details. OS, message if any, how to reproduce...
Before I wrote out a whole lost of stuff. I was just wondering if any else had experienced it.

I was able to reproduce it in the following way.

1) Run Openttd.exe (obviously)
2) Start Convoy twice in rapid succession (does necessarily have to be rapid, but the crash seems to happen earlier when started togher). Same effect for 1 of my AI (Jinjaba, unpublished, which is operates busses as well) and 1 convoy
3) usually crash happens within 10-60 seconds. (message standard, "this has crashed message" from Windows)

If there are any log files or whatnot that OpenTTD produces let me know and I will post them.
WinXP, r13512-noai (also experienced with another recent nightly, forget the number)
(I can paste the above into bug tracker as well if you want)
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Crashing with more than one AI

Post by glx »

Please retry with http://devs.openttd.org/~glx/OTTD-MSVC- ... 2-noai.zip, it should produce .log and .dmp on crash.

Edit: I can reproduce it :) (I get a "map/set iterator not decrementable" error)
Last edited by glx on 15 Jun 2008 00:39, edited 1 time in total.
User avatar
paullb
Traffic Manager
Traffic Manager
Posts: 129
Joined: 19 May 2008 13:11

Re: Crashing with more than one AI

Post by paullb »

glx wrote:Please retry with http://devs.openttd.org/~glx/OTTD-MSVC- ... 2-noai.zip, it should produce .log and .dmp on crash.
Here you go.
Attachments
crash.rar
(138.15 KiB) Downloaded 102 times
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Crashing with more than one AI

Post by glx »

Ok it's the bug described on http://wiki.openttd.org/index.php/AI:Bugs and Convoy does exactly that.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Crashing with more than one AI

Post by GeekToo »

It did never crash on me ( Gentoo Linux), but the line causing trouble is 612 I presume?

Could you try this one?
Attachments
Convoy.tar
(40 KiB) Downloaded 100 times
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Crashing with more than one AI

Post by glx »

This version works. And I did get the segfault using the previous version on windows and mandriva64.

Edit: looking into Convoy code, line 637 may cause problems too.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Crashing with more than one AI

Post by GeekToo »

No, I've seen that line, but the remove is on another list than the iterator

Code: Select all

for (town_it = town_list2.Begin(); town_list2.HasNext(); 
	   	town_it = town_list2.Next()){	
			town_list.RemoveItem(town_it);
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 622
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Re: Crashing with more than one AI

Post by glx »

Oh, you're right.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 30 guests