MantisBT - VCMI
View Issue Details
0000870VCMIMechanics - Battlespublic2012-02-21 22:172014-05-30 17:40
Ivan 
Tow 
normalcrashalways
closedfixed 
x86_64Ubuntu Linux11.10 (oneiric)
 
0.88 
0000870: Crash on attacking castle with enemy hero
Reproducible always by attacking top Inferno with Christian on VCMI Tests map.
Game will crash immediately after beginning of the battle

May be related to AI-controlled towers (Christian has Ballistics)
No tags attached.
Issue History
2012-02-21 22:17IvanNew Issue
2012-02-21 22:17IvanStatusnew => assigned
2012-02-21 22:17IvanAssigned To => Tow dragon
2012-02-21 22:19IvanNote Added: 0002216
2012-02-22 15:23TowAssigned ToTow dragon => Tow
2012-02-22 17:46TowNote Added: 0002224
2012-02-22 17:46TowStatusassigned => feedback
2012-02-22 17:46TowNote Edited: 0002224bug_revision_view_page.php?bugnote_id=2224#r1514
2012-02-22 20:19IvanNote Added: 0002225
2012-02-22 20:19IvanStatusfeedback => assigned
2012-02-22 20:19IvanStatusassigned => resolved
2012-02-22 20:19IvanFixed in Version => 0.89
2012-02-22 20:19IvanResolutionopen => fixed
2014-05-30 17:40beegeeStatusresolved => closed

Notes
(0002216)
Ivan   
2012-02-21 22:19   
Maybe AI can't calculate distance from towers? Stacktrace:
0000011 <signal handler called>
0000012 0x0000000000584763 in std::vector<int, std::allocator<int> >::emplace_back<int>(int&&) (this=0x7fad00000000)
    at /usr/include/c++/4.6/bits/vector.tcc:95
0000013 0x000000000057eb50 in std::vector<int, std::allocator<int> >::push_back(int&&) (this=0x7fad00000000,
    __x=@0x7fada822c8f8) at /usr/include/c++/4.6/bits/stl_vector.h:840
0000014 0x00007fadc2e00d72 in CBattleInfoCallback::battleGetDistances (this=0x372b130, stack=0x3735740, hex=...,
    predecessors=0x0) at /home/ivan/src/vcmi/src/lib/IGameCallback.cpp:73
0000015 0x00007fada8246364 in CStupidAI::activeStack (this=0x4060ab0, stack=0x3735740)
    at /home/ivan/src/vcmi/src/AI/StupidAI/StupidAI.cpp:102
0000016 0x00007fadc2c004b0 in CAdventureAI::activeStack (this=0x372b9e0, stack=0x3735740)
    at /home/ivan/src/vcmi/src/lib/CGameInterface.cpp:201
0000017 0x000000000069156f in CClient::waitForMoveAndSend (this=0x2a2e8c0, color=5)
    at /home/ivan/src/vcmi/src/client/Client.cpp:122
(0002224)
Tow   
2012-02-22 17:46   
Very strange, it's working for me. How can pushing a -1 to vector can crash? Something wrong must have happened before, probably out-of-range write to one of the neighbouring arrays. [It'd be good to replace them with vectors.]

Please check if r2556 fixes the issue.

(0002225)
Ivan   
2012-02-22 20:19   
No crash. Fixed I suppose.