MantisBT - VCMI
View Issue Details
0001179VCMIMechanics - Objectspublic2013-01-20 22:502013-01-22 18:35
Ivan 
 
normalcrashalways
closedno change required 
x86_64Ubuntu Linux12.04 (precise)
 
 
0001179: Crash on accessing bonus during loading garrison from h3m
Starting map "All for one" causes crash.

Seems to be related to accessing bonus system from partially loaded object (garrison at least in this case)
...
10 boost::unique_lock<boost::mutex>::unique_lock locks.hpp 291 0x8ec53d
11 CBonusSystemNode::getAllBonuses(boost::function<bool (Bonus const*)> const&, boost::function<bool (Bonus const*)> const&, CBonusSystemNode const*, std::string const&) const HeroBonus.cpp 613 0x7ffff7872113
12 IBonusBearer::getBonuses(boost::function<bool (Bonus const*)> const&, std::string const&) const HeroBonus.cpp 376 0x7ffff786f0b4
13 IBonusBearer::hasBonus(boost::function<bool (Bonus const*)> const&, std::string const&) const HeroBonus.cpp 336 0x7ffff786efcf
14 IBonusBearer::hasBonusOfType HeroBonus.cpp 348 0x7ffff786f362
15 CArmedInstance::updateMoraleBonusFromArmy CObjectHandler.cpp 6837 0x7ffff77e097e
16 CArmedInstance::armyChanged CObjectHandler.cpp 6883 0x7ffff77e1215
17 non-virtual thunk to CArmedInstance::armyChanged() CObjectHandler.cpp 6884 0x7ffff77e123c
18 CCreatureSet::putStack CCreatureSet.cpp 339 0x7ffff75a3187
19 CMapLoaderH3M::readCreatureSet CMapService.cpp 1824 0x7ffff74b497b
20 CMapLoaderH3M::readObjects CMapService.cpp 1327 0x7ffff74af6b6
21 CMapLoaderH3M::init CMapService.cpp 166 0x7ffff74ab8c9
22 CMapLoaderH3M::loadMap CMapService.cpp 106 0x7ffff74ab1fd
23 CMapService::loadMap CMapService.cpp 22 0x7ffff74aa77e
24 CGameState::init CGameState.cpp 926 0x7ffff75b9657
25 CClient::newGame Client.cpp 345 0xaa92a1
26 startGame CMT.cpp 905 0xb8bba3
...
No tags attached.
Issue History
2013-01-20 22:50IvanNew Issue
2013-01-20 22:50IvanStatusnew => assigned
2013-01-20 22:50IvanAssigned To => Warmonger
2013-01-22 09:57WarmongerNote Added: 0003305
2013-01-22 11:58TowNote Added: 0003308
2013-01-22 18:34IvanNote Added: 0003312
2013-01-22 18:35IvanStatusassigned => closed
2013-01-22 18:35IvanAssigned ToWarmonger =>
2013-01-22 18:35IvanResolutionopen => no change required

Notes
(0003305)
Warmonger   
2013-01-22 09:57   
Not reproductible, map works for me even under various mod settings.
(0003308)
Tow   
2013-01-22 11:58   
Works for me as well.

From the given stacktrace it seems that locking a mutex causes crash.
Mutex is defined as a static variable in function so it should be properly constructed. I don't what can crash there.
(0003312)
Ivan   
2013-01-22 18:34   
looks to be OK after svn update + full rebuild. Closing.