[defaultai.cc:2406] Help: I do not know what to do with a outpost

Bug #1342554 reported by wl-zocker
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
TiborB

Bug Description

Steps to reproduce:
- Start any game.
- Increase the game speed.
- The game crashes after some minutes (gametime).

As far as I can see, the stdout and stderr produce no relevant output.
I could reproduce this with different maps and in single and multiplayer mode.

I am on Win7, using Tino's builds. r7084 went fine.

Tags: crash windows

Related branches

Revision history for this message
SirVer (sirver) wrote :

I did not look into this yet. But can you test if it also happens in a single player game?

Revision history for this message
wl-zocker (wl-zocker) wrote :

It does not happen when I am the only one who plays. So this might be an AI issue. This would be strange because the AI has been changed in r7080 already (and r7084 does not crash).

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this issue.

I have a theory that it might be related with autosaving. Could you check the output whether the crash seem to happen just after or during storing the automatic savegames? (If this is the case, also try to turn up the frequency for how often it stores automatically and see whether the game crashes more often).

I was running r7105 in the background when I noticed my WL window had disappeared and this was in the terminal:
 Writing Scripting Data ... PANIC: unprotected error in call to Lua API (attempt to persist a light C function (0xf97653))
Avbrutt (SIGABRT) (core dumped)

PS. This may of course be an unrelated issue, as I haven't been able to reproduce it, even after running a couple of games where I was autosaving every second minute.

Changed in widelands:
importance: Undecided → Medium
Revision history for this message
TiborB (tiborb95) wrote :

Yesterday I encountered a segmentation fault with trunk + own changes. I am running widelands under gdb since, but no crash yet. If I have another crash I will let you know.

Generally gdb does not cause significant overhead so I encourage every tester to run widelands under gdb or similar tool. :)

Revision history for this message
wl-zocker (wl-zocker) wrote :

I found out:
- The crash is not related to autosave (switching it off or increasing the frequency has no significant influence).
- The crash is related to the AI. When there are no other AI players, I can built up a whole economy without any crash. When I set all AI players to "none", the game does not crash neither.
- The crash is reproducible very easily (for me): Ancient sun of fire (other maps work too), 8 Barbarian AIs. Increase game speed. Crash after 5-8 minutes gametime.

I doubt it will help, but I attach the last few lines from the stdout. Everything seems normal.
I forgot to mention: I get no error message, Widelands just shuts down.

Revision history for this message
wl-zocker (wl-zocker) wrote :

It seems this is a Windows issue - I am not able to reproduce it with Ubuntu.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

> I am not able to reproduce it with Ubuntu.

Hm... which means my issue in #3 was completely unrelated and that I should probably try and figure out what on earth happened there. :(

tags: added: windows
Revision history for this message
SirVer (sirver) wrote :

hjd, #3 sounds awful. If you can reproduce, I would be interested in this a lot.

I started the Ancient sun of fire in debug mode and got this nearly immediately:

libc++abi.dylib: terminating with uncaught exception of type _wexception: [/Users/sirver/Desktop/Programming/cpp/widelands/bzr_repo/src/ai/defaultai.cc:2406] Help: I do not know what to do with a outpost

Changed in widelands:
assignee: nobody → Tibor Bamhor (tiborb95)
status: New → Confirmed
milestone: none → build19-rc1
importance: Medium → Critical
summary: - r7102 crashes
+ [defaultai.cc:2406] Help: I do not know what to do with a outpost
Changed in widelands:
assignee: Tibor Bamhor (tiborb95) → SirVer (sirver)
Revision history for this message
SirVer (sirver) wrote :

I fixed the bug in #8 in r7110. I close this bug for now, if somebody else sees problems again, please ping me here again and I will reopen.

Changed in widelands:
status: Confirmed → Fix Committed
assignee: SirVer (sirver) → nobody
Revision history for this message
TiborB (tiborb95) wrote :

It is hard to find out what has changed in that diff, can you point out what was the problem?

Revision history for this message
SirVer (sirver) wrote :

yes, computerplayers subscribed to a bunch of of notes - which I changed recently to contain the player and be send to every subscriber (so no subscription per player, but per note type). I forgot to check if the note really concerned the computer player in question and so they "gained" immovables of other tribes.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

SirVer: Certainly. Though I don't really know how or why it happened in the first place, and I haven't been able to reproduce it so far. This is why I hoped it would turn out to be the "random-crash-which-recently-got-reported"...

Revision history for this message
wl-zocker (wl-zocker) wrote :

It showed up in r7119 again. Same symptoms: Only when AI is involved, a crash after several minutes. No error message (unfortunately, I do not have the tools to debug on Windows). I have not yet checked if the crash happens on Ubuntu (the original crash did not happen on Ubuntu).

Changed in widelands:
status: Fix Committed → Confirmed
Revision history for this message
TiborB (tiborb95) wrote :

Are you sure this is the same problem?

There is also a bug: https://bugs.launchpad.net/widelands/+bug/1344288 - this is not fixed in trunk yet though I have a fix allready.

Revision history for this message
wl-zocker (wl-zocker) wrote :

I am quite sure it is this bug because I am able to reproduce it whenever I want - the other bugs happens more or less randomly.

Revision history for this message
wl-zocker (wl-zocker) wrote :

Still happens in r7159, but only on Windows, not on Ubuntu. Playing against the AI is impossible.
SirVer: Have you tested if you really fixed it? I only have r7102 and r7119 on Windows, which both crash.

Has anyone fixed the issue in #3? Although I encountered it twice with an older revision (using tibor's AI branch), I was not able to reproduce it with the current trunk (r7150+) in about 15,000 saves.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>Has anyone fixed the issue in #3?

I haven't played all that much lately, but I haven't seen it since. And I don't know what triggered it in the first place...1

>in about 15,000 saves.

Wow. What sort of setup are you running?1

Revision history for this message
SirVer (sirver) wrote :
Download full text (3.5 KiB)

I ran into the following stacktrace when running ancient sun of fire in r7161. So there seems to be a bug, but the one I fixed is gone. Tibor, any ideas?

0 widelands 0x000000010221fb3d DefaultAI::check_productionsites(int) + 6973 (string:1714)
1 widelands 0x0000000102214689 DefaultAI::think() + 377 (defaultai.cc:198)
2 widelands 0x0000000101cd93d3 NetHost::think() + 643 (nethost.cc:978)
3 widelands 0x0000000101a960d0 Widelands::Game::think() + 112 (game.cc:612)
4 widelands 0x0000000101f5e911 Interactive_Base::think() + 673 (interactive_base.cc:385)
5 widelands 0x0000000101d8c893 UI::Panel::do_think() + 51 (panel.cc:590)
6 widelands 0x0000000101d8c3dc UI::Panel::run() + 892 (panel.cc:213)
7 widelands 0x0000000101a92823 Widelands::Game::run(UI::ProgressWindow*, Widelands::Game::Start_Game_Type, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 5219 (game.cc:571)
8 widelands 0x0000000101cd5781 NetHost::run(bool) + 12833 (nethost.cc:905)
9 widelands 0x00000001018e6570 WLApplication::mainmenu_multiplayer() + 1824 (wlapplication.cc:1458)
10 widelands 0x00000001018dd483 WLApplication::mainmenu() + 3283 (wlapplication.cc:1307)
11 widelands 0x00000001018db1a8 WLApplication::run() + 9480 (wlapplication.cc:478)
12 widelands 0x00000001018c9b26 SDL_main + 1798 (main.cc:104)
13 widelands 0x00000001018cc9c9 -[SDLMain applicationDidFinishLaunching:] + 49
14 com.apple.CoreFoundation 0x00007fff8e706e0c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
15 com.apple.CoreFoundation 0x00007fff8e5fa82d _CFXNotificationPost + 2893
16 com.apple.Foundation 0x00007fff8f82f7ba -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
17 com.apple.AppKit 0x00007fff911c5b69 -[NSApplication _postDidFinishNotification] + 289
18 com.apple.AppKit 0x00007fff911c589c -[NSApplication _sendFinishLaunchingNotification] + 195
19 com.apple.AppKit 0x00007fff911c2786 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 570
20 com.apple.AppKit 0x00007fff911c21db -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 242
21 com.apple.Foundation 0x00007fff8f84df0a -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 294
22 com.apple.Foundation 0x00007fff8f84dd7d _NSAppleEventManagerGenericHandler + 106
23 com.apple.AE 0x00007fff8cc86e1f aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 381
24 com.apple.AE 0x00007fff8cc86c32 dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 31
25 com.apple.AE 0x00007fff8cc86b36 aeProcessAppleEvent + 315
26 com.apple.HIToolbox 0x00007fff8ac75161 AEProcessAppleEvent + 56
27 com.apple.AppKit 0x00007fff911be0b6 _...

Read more...

Changed in widelands:
assignee: nobody → Tibor Bamhor (tiborb95)
Revision history for this message
wl-zocker (wl-zocker) wrote :

@#17: I hoped that it would happen again - the first two times I was not running under gdb. I hoped the more often I save, the more probable it would show up again, but it did not. I will stop looking actively into it.
In the config file, I set autosave to 5 seconds, and then I made WL run in the background at speed x1 (so no performance problem). Four days with about five hours each was enough to get that many saves.

Revision history for this message
TiborB (tiborb95) wrote :

Well in trunk there is still the bug: 1344288 'segmentation fault - AI building enhancement'. It is fixed in my tibor-ai5 branch. That stacktrace is not very usefull, but the mentioned bug is just in check_productionsites() function.

tibor-ai5 is much tested I am 99,99% sure it does not crash. So I hope when tibor-ai5 is merged the problem will be gone.

One comment about game saving and crashing in general. Under some circumstances, when AI crashes, the wexeption is invoked and before aborting the game is saved. So sometimes it might seem that just that save is a culprit of crash.

Revision history for this message
wl-zocker (wl-zocker) wrote :

I can confirm that is does not crash with r7211 on Win7 any more. The reason is probably Tibor's branch, merged in r7204.

Changed in widelands:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.