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

AI using 'modes' incorrectly assert #3078

Closed
DorpsGek opened this issue Aug 1, 2009 · 8 comments
Closed

AI using 'modes' incorrectly assert #3078

DorpsGek opened this issue Aug 1, 2009 · 8 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Aug 1, 2009

Felix_Atagong opened the ticket and wrote:

I have had 3 crashes in a couple of days time and this hasn't happened since at least a decade 8-)))
I have also seen in a previous post that an OpenTTD game using Dutch language crashed without a 'reason'...

*** OpenTTD Crash Report ***
Date: 2009-08-01 21:13:40
Build: 0.7.2-RC1 (0) built on Jul 15 2009 20:57:25
Reason: Assertion failed at ..\src\ai\api\ai_testmode.cpp:24: this->GetDoCommandModeInstance() == this
Language: dutch.lng
Exception C0000005 at 004FBAF6

Reported version: 0.7.2-RC2
Operating system: All


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

DorpsGek commented Aug 1, 2009

Rubidium wrote:

Can you figure out which AI causes this issue?
Can you attach crash.log, crash.dmp and crash.sav?


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6420

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 2, 2009

Felix_Atagong wrote:

Ooops, I was pretty sure I had attached all log and crash files... Here I go again...
I'm gonna try to find what AI did the job (I run them all, including the eye candy ones).
I also add the crash.sav that saved right after crashing.

Here are all my downloaded AI...
NAME SIZE MODIFIED
AdmiralAI.22.tar 389,120 17/06/2009 20:43:15
CluelessPlus.8.tar 102,400 30/07/2009 20:44:37
Convoy.11.tar 61,440 13/06/2009 20:56:52
NoCAB.1.23__r328_.tar 378,880 29/07/2009 21:32:26
OtviAI.283.tar 102,400 13/06/2009 20:56:52
PathZilla.6.tar 276,480 9/07/2009 21:26:28
PAXLink.13.tar 143,360 23/06/2009 19:56:18
StreetTraffic1.1.0.tar 51,200 13/06/2009 20:56:52
TownCars.4.tar 51,200 29/07/2009 21:32:26
Trans_AI.090713.tar 266,240 13/07/2009 21:47:41

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6423

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 2, 2009

Felix_Atagong wrote:

...and again... game crashed a few seconds after the last savegame...

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6425

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 2, 2009

Felix_Atagong wrote:

The previous games run smoothly until Fanioz kicks in.
Trans (v90713) causes the crash - last AI debug info is
Executing Headquarter Builder Task
then OpenTTD crashes.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6426

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 3, 2009

fanioz wrote:

simplified script maybe something like this :

for (;;) local x = AITestMode();


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6440

@DorpsGek
Copy link
Member Author

DorpsGek commented Aug 4, 2009

fanioz wrote:

Actually what I've done with Trans (but simplified already).
I've fixed this in my AI locally, but not uploaded yet.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6444

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

I have a backtrace for that. It happened for me when I tried to start Rondje. It failed several times because "the AI took too long to initialize". Eventually I got this crash:

dbg: [ai] The AI died unexpectedly.
dbg: [ai] The AI died unexpectedly.
openttd: /home/alve/projekte/openttd/src/ai/api/ai_testmode.cpp:24: virtual AITestMode::~AITestMode(): Assertion `this->GetDoCommandModeInstance() == this' failed.

Program received signal SIGABRT, Aborted.
0x00007fdbe9140ed5 in raise () from /lib/libc.so.6
(gdb) bt
# 0 0x00007fdbe9140ed5 in raise () from /lib/libc.so.6
# 1 0x00007fdbe91423f3 in abort () from /lib/libc.so.6
# 2 0x00007fdbe9139dc9 in __assert_fail () from /lib/libc.so.6
# 3 0x00000000004a8f48 in ~AITestMode (this=0x2554c70) at /home/alve/projekte/openttd/src/ai/api/ai_testmode.cpp:24
# 4 0x000000000055da15 in SimpleCountedObject::Release (this=0x2554c70) at /home/alve/projekte/openttd/src/misc/countedobj.cpp:20
# 5 0x0000000000448065 in DefSQDestructorCallback (p=0x2554c70, size=0) at /home/alve/projekte/openttd/src/ai/../script/squirrel_helper.hpp:841
# 6 0x0000000000413434 in SQInstance::Release (this=0x21d2c90) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/sqclass.h:131
# 7 0x000000000040bcf2 in ~SQObjectPtr (this=0x218d610) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/sqobject.h:257
# 8 0x000000000040c226 in sqvector::resize (this=0x218d4d0, newsize=0, fill=@0x7ffff3d439c0) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/squtils.h:54
# 9 0x000000000043ce94 in SQGenerator::Kill (this=0x218d490) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/sqclosure.h:61
# 10 0x00000000004363c1 in SQVM::Execute (this=0x1fbfce0, closure=@0xafe340, target=35, nargs=-1, stackbase=-1, outres=@0x7ffff3d43d30, raiseerror=1, et=ET_RESUME_OPENTTD) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/sqvm.cpp:869
# 11 0x0000000000407da5 in sq_resumecatch (v=0x1fbfce0, suspend=10000) at /home/alve/projekte/openttd/src/3rdparty/squirrel/squirrel/sqapi.cpp:1010
# 12 0x00000000006392a7 in Squirrel::Resume (this=0x1c132e0, suspend=10000) at /home/alve/projekte/openttd/src/script/squirrel.cpp:186
# 13 0x000000000044a3b7 in AIInstance::GameLoop (this=0x1cd5f00) at /home/alve/projekte/openttd/src/ai/ai_instance.cpp:338
# 14 0x0000000000440198 in AI::GameLoop () at /home/alve/projekte/openttd/src/ai/ai_core.cpp:69
# 15 0x00000000005ccaf2 in StateGameLoop () at /home/alve/projekte/openttd/src/openttd.cpp:1163
# 16 0x00000000005cde77 in GameLoop () at /home/alve/projekte/openttd/src/openttd.cpp:1242
# 17 0x00000000006cfa53 in VideoDriver_SDL::MainLoop (this=0x109abe0) at /home/alve/projekte/openttd/src/video/sdl_v.cpp:501
# 18 0x00000000005cec56 in ttd_main (argc=1, argv=0x7ffff3d443f8) at /home/alve/projekte/openttd/src/openttd.cpp:733
# 19 0x00000000006ba79e in main (argc=1, argv=0x7ffff3d443f8) at /home/alve/projekte/openttd/src/unix.cpp:251
(gdb) up
# 1 0x00007fdbe91423f3 in abort () from /lib/libc.so.6
(gdb)
# 2 0x00007fdbe9139dc9 in __assert_fail () from /lib/libc.so.6
(gdb)
# 3 0x00000000004a8f48 in ~AITestMode (this=0x2554c70) at /home/alve/projekte/openttd/src/ai/api/ai_testmode.cpp:24
24 assert(this->GetDoCommandModeInstance() == this);
(gdb) p this->GetDoCommandModeInstance()
$5 = (AIObject *) 0x25e0430
(gdb) p *this
$6 = { = { = {_vptr.SimpleCountedObject = 0x731670, m_ref_cnt = 0}, }, last_mode = 0, last_instance = 0x0}
(gdb) p *GetDoCommandModeInstance()
$7 = { = {_vptr.SimpleCountedObject = 0x72e010, m_ref_cnt = 1}, }


This comment was imported from FlySpray: https://bugs.openttd.org/task/3078#comment6484

@DorpsGek
Copy link
Member Author

Yexo closed the ticket.

Reason for closing: Fixed

In r17230.


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) 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