[SOLVED] r5354: AI stack not popping to previous state.

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Tricky
---- E L I T E ----
---- E L I T E ----
Posts: 821
Joined: Sun May 13, 2012 11:12 pm
Location: Bradford, UK. (Anarchic)

[SOLVED] r5354: AI stack not popping to previous state.

Post by Tricky »

Repost of the bug report I submitted on berlios...

[Bug #18737 ] r5354: AI stack not popping to previous state.
Summary:
r5354: AI stack not popping to previous state.

Original Submission:
Whenever an exitAIWithMessage (or a simple exitAI) is encountered in the AI, the system tries to pop the previous state. All processing for the AI stops at this point.

ship.AI contains the original AI filename.
ship.AIState also contains the original AI filename and NOT the original state.
Last edited by Tricky on Sun Sep 23, 2012 2:56 pm, edited 1 time in total.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: r5354: AI stack not popping to previous state.

Post by Eric Walch »

Yes, I can confirm this bug. I see that starting from r5341 there have been changes to the AI system. While checking this bug and having Oolite running in the background for several minutes I got the following CTD:

Code: Select all

Application Specific Information:
  [ai.stack.pop]: Popping previous state machine for <AI 0x11d5bc510>{"interceptAI.plist" in state: "FLEE_FOR_CLOAKED" for Cobra Mark III 354}
 

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   org.aegidian.oolite           	0x000000010000899a -[AI reactToMessage:context:] + 1233 (AI.m:493)
1   org.aegidian.oolite           	0x0000000100008361 -[AI setStateMachine:] + 160 (AI.m:322)
2   org.aegidian.oolite           	0x0000000100123854 ShipSetAI + 303 (OOJSShip.m:1318)
3   org.aegidian.oolite           	0x00000001001fae16 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode) + 105886
4   org.aegidian.oolite           	0x000000010025254d js::RunScript(JSContext*, JSScript*, JSStackFrame*) + 238
5   org.aegidian.oolite           	0x0000000100252aa3 js::Invoke(JSContext*, js::CallArgs const&, unsigned int) + 1293
6   org.aegidian.oolite           	0x000000010025317d js::ExternalInvoke(JSContext*, js::Value const&, js::Value const&, unsigned int, js::Value*, js::Value*) + 363
7   org.aegidian.oolite           	0x000000010018d518 JS_CallFunctionValue + 68
8   org.aegidian.oolite           	0x000000010007b564 -[OOJSScript callMethod:inContext:withArguments:count:result:] + 586 (OOJSScript.m:409)
9   org.aegidian.oolite           	0x00000001000dd554 -[ShipEntity doScriptEvent:inContext:withArguments:count:] + 39 (ShipEntity.m:12639)
10  org.aegidian.oolite           	0x00000001000dcd34 -[ShipEntity doScriptEvent:] + 196 (OOJavaScriptEngine.h:132)
11  org.aegidian.oolite           	0x0000000100008b50 -[AI takeAction:] + 397 (AI.m:534)
12  org.aegidian.oolite           	0x0000000100008883 -[AI reactToMessage:context:] + 954 (AI.m:467)
13  org.aegidian.oolite           	0x00000001000c14d0 -[ShipEntity behaviour_intercept_target:] + 139 (ShipEntity.m:3578)
14  org.aegidian.oolite           	0x00000001000bde17 -[ShipEntity update:] + 6211 (ShipEntity.m:2357)
15  org.aegidian.oolite           	0x0000000100038f5c -[Universe update:] + 2215 (Universe.m:5708)
16  org.aegidian.oolite           	0x000000010000d8a6 -[GameController doPerformGameTick] + 78 (GameController.m:334)
17  com.apple.Foundation          	0x00007fff802aebc5 __NSFireTimer + 114
18  com.apple.CoreFoundation      	0x00007fff80644bb8 __CFRunLoopRun + 6488
19  com.apple.CoreFoundation      	0x00007fff80642d8f CFRunLoopRunSpecific + 575
20  com.apple.HIToolbox           	0x00007fff864607ee RunCurrentEventLoopInMode + 333
21  com.apple.HIToolbox           	0x00007fff864605f3 ReceiveNextEventCommon + 310
22  com.apple.HIToolbox           	0x00007fff864604ac BlockUntilNextEventMatchingListInMode + 59
23  com.apple.AppKit              	0x00007fff86af2eb2 _DPSNextEvent + 708
24  com.apple.AppKit              	0x00007fff86af2801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
25  com.apple.AppKit              	0x00007fff86ab868f -[NSApplication run] + 395
26  com.apple.AppKit              	0x00007fff86ab13b0 NSApplicationMain + 364
27  org.aegidian.oolite           	0x0000000100002188 start + 52
Is probably related with the AI changes. Although the 'Application Specific Information' might be unrelated as this was logged a few minutes before the crash.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: r5354: AI stack not popping to previous state.

Post by Eric Walch »

Found the bug. It is a C&P error in r5341 in line 248. Will fix it after some testing.

EDIT: Works now correct in r5355
User avatar
Tricky
---- E L I T E ----
---- E L I T E ----
Posts: 821
Joined: Sun May 13, 2012 11:12 pm
Location: Bradford, UK. (Anarchic)

Re: [SOLVED] r5354: AI stack not popping to previous state.

Post by Tricky »

Saw the fix this morning but had to go to work before testing.

Just tested it and can confirm that all is well with the AI.

EDIT - Just noticed I can't close the bug on the berlios bug tracker. Submitted a comment that it is solved.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: [SOLVED] r5354: AI stack not popping to previous state.

Post by Thargoid »

I presume this would also account for the current "run to the hills" mode that my docking computer seems to default to as well in a recent test.
Post Reply