I'm getting a stack-buffer-overflow when starting a new game on Fellowships with 3 normal AIs:
=================================================================
==22145==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff62131050 at pc 0x0000015ccb20 bp 0x7fff62130950 sp 0x7fff62130940
WRITE of size 4 at 0x7fff62131050 thread T0
#0 0x15ccb1f in DefaultAI::update_buildable_field(Widelands::BuildableField&) /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ai/defaultai.cc:1885
#1 0x15c5d4b in DefaultAI::update_all_not_buildable_fields() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ai/defaultai.cc:1245
#2 0x15bd7e0 in DefaultAI::think() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ai/defaultai.cc:341
#3 0x1234e66 in GameHost::think() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/network/gamehost.cc:730
#4 0xfc8741 in Widelands::Game::think() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/logic/game.cc:546
#5 0x13d8160 in InteractiveBase::think() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/wui/interactive_base.cc:387
#6 0x12ea477 in UI::Panel::do_think() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ui_basic/panel.cc:455
#7 0x12e886c in UI::Panel::do_run() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ui_basic/panel.cc:181
#8 0xddfdf9 in UI::Panel::Returncodes UI::Panel::run<UI::Panel::Returncodes>() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ui_basic/panel.h:99
#9 0xfc81d4 in Widelands::Game::run(UI::ProgressWindow*, Widelands::Game::StartGameType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/logic/game.cc:523
#10 0x1233d42 in GameHost::run() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/network/gamehost.cc:672
#11 0xdd2f60 in WLApplication::mainmenu_multiplayer() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/wlapplication.cc:1200
#12 0xdd1fd6 in WLApplication::mainmenu() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/wlapplication.cc:1040
#13 0xdcc902 in WLApplication::run() /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/wlapplication.cc:439
#14 0xdc9960 in main /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/main.cc:49
#15 0x7f62e043282f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#16 0xdc9828 in _start (/home/bratzbert/sources/widelands/ai_blocked_cosideration/widelands+0xdc9828)
Address 0x7fff62131050 is located in stack of thread T0 at offset 1264 in frame
#0 0x15c5eef in DefaultAI::update_buildable_field(Widelands::BuildableField&) /home/bratzbert/sources/widelands/ai_blocked_cosideration/src/ai/defaultai.cc:1262
I'm getting a stack-buffer- overflow when starting a new game on Fellowships with 3 normal AIs:
======= ======= ======= ======= ======= ======= ======= ======= ======= == overflow on address 0x7fff62131050 at pc 0x0000015ccb20 bp 0x7fff62130950 sp 0x7fff62130940 :update_ buildable_ field(Widelands ::BuildableFiel d&) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/ai/ defaultai. cc:1885 :update_ all_not_ buildable_ fields( ) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/ai/ defaultai. cc:1245 /sources/ widelands/ ai_blocked_ cosideration/ src/ai/ defaultai. cc:341 /sources/ widelands/ ai_blocked_ cosideration/ src/network/ gamehost. cc:730 :Game:: think() /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/logic/ game.cc: 546 ::think( ) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/wui/ interactive_ base.cc: 387 :do_think( ) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/ui_ basic/panel. cc:455 /sources/ widelands/ ai_blocked_ cosideration/ src/ui_ basic/panel. cc:181 :Returncodes UI::Panel: :run<UI: :Panel: :Returncodes> () /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/ui_ basic/panel. h:99 :Game:: run(UI: :ProgressWindow *, Widelands: :Game:: StartGameType, std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&, bool, std::__ cxx11:: basic_string< char, std::char_ traits< char>, std::allocator< char> > const&) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/logic/ game.cc: 523 /sources/ widelands/ ai_blocked_ cosideration/ src/network/ gamehost. cc:672 :mainmenu_ multiplayer( ) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/wlapplicati on.cc:1200 :mainmenu( ) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/wlapplicati on.cc:1040 :run() /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/wlapplicati on.cc:439 /sources/ widelands/ ai_blocked_ cosideration/ src/main. cc:49 64-linux- gnu/libc. so.6+0x2082f) bratzbert/ sources/ widelands/ ai_blocked_ cosideration/ widelands+ 0xdc9828)
==22145==ERROR: AddressSanitizer: stack-buffer-
WRITE of size 4 at 0x7fff62131050 thread T0
#0 0x15ccb1f in DefaultAI:
#1 0x15c5d4b in DefaultAI:
#2 0x15bd7e0 in DefaultAI::think() /home/bratzbert
#3 0x1234e66 in GameHost::think() /home/bratzbert
#4 0xfc8741 in Widelands:
#5 0x13d8160 in InteractiveBase
#6 0x12ea477 in UI::Panel:
#7 0x12e886c in UI::Panel::do_run() /home/bratzbert
#8 0xddfdf9 in UI::Panel:
#9 0xfc81d4 in Widelands:
#10 0x1233d42 in GameHost::run() /home/bratzbert
#11 0xdd2f60 in WLApplication:
#12 0xdd1fd6 in WLApplication:
#13 0xdcc902 in WLApplication:
#14 0xdc9960 in main /home/bratzbert
#15 0x7f62e043282f in __libc_start_main (/lib/x86_
#16 0xdc9828 in _start (/home/
Address 0x7fff62131050 is located in stack of thread T0 at offset 1264 in frame :update_ buildable_ field(Widelands ::BuildableFiel d&) /home/bratzbert /sources/ widelands/ ai_blocked_ cosideration/ src/ai/ defaultai. cc:1262
#0 0x15c5eef in DefaultAI:
This frame has 16 object(s): walkable' owned_walkable' buildable' mines_pots' iron_mines' buildable_ fields'
[32, 33) 'find_open_water'
[96, 98) 'nearest_distance'
[160, 162) 'actual_distance'
[224, 228) 'unused1'
[288, 296) 'find_water'
[352, 368) 'find_unowned_
[416, 432) 'find_enemy_
[480, 496) 'find_unowned_
[544, 560) 'fse'
[608, 632) 'find_unowned_
[672, 696) 'find_unowned_
[736, 760) 'find_ally'
[800, 824) 'found_
[864, 912) 'mr'
[960, 992) '<unknown>'
[1024, 1264) 'score_parts' <== Memory access at offset 1264 overflows this variable