MantisBT - VCMI
View Issue Details
0001627VCMIAI - Battlespublic2013-12-23 14:462022-09-16 20:15
KroArtem 
Tow 
normalminorhave not tried
resolvedunable to reproduce 
x86_64Ubuntu13.10
0.94 
0.next 
0001627: AI crashed when only one spell was used
I've started battle, hero casted a spell and the battle was over. Then vcmi crashed.

Warning: an orphaned child!
battleCanCastSpell called when no battle!

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdd5f6700 (LWP 11762)]
0x00007ffff492dd73 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*)
    () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff492dd73 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff79f8298 in operator++ (this=<synthetic pointer>)
    at /usr/include/c++/4.8/bits/stl_tree.h:270
0000002 __find<std::_Rb_tree_const_iterator<EBattleStackState::EBattleStackState>, EBattleStackState::EBattleStackState> ([email protected]: 32767,
    __last=..., __first=...) at /usr/include/c++/4.8/bits/stl_algo.h:140
0000003 find<std::_Rb_tree_const_iterator<EBattleStackState::EBattleStackState>, EBattleStackState::EBattleStackState> ([email protected]: 32767, __last=...,
    __first=...) at /usr/include/c++/4.8/bits/stl_algo.h:4441
0000004 vstd::contains<std::set<EBattleStackState::EBattleStackState, std::less<EBattleStackState::EBattleStackState>, std::allocator<EBattleStackState::EBattleStackState> >, EBattleStackState::EBattleStackState> (c=...,
    [email protected][email protected]: EBattleStackState::WAITING)
    at /build/buildd/vcmi-0.94+svn3369/lib/../Global.h:262
0000005 0x00007ffff7a47abd in CStack::waited (this=<optimized out>,
    [email protected]=0)
    at /build/buildd/vcmi-0.94+svn3369/lib/BattleState.cpp:964
0000006 0x0000000000508e93 in CBattleInterface::blockUI (
    [email protected]=0x7fffce36f300, on=<optimized out>)
    at /build/buildd/vcmi-0.94+svn3369/client/battle/CBattleInterface.cpp:1908
0000007 0x000000000050d8d6 in CBattleInterface::setActiveStack (
    [email protected]=0x7fffce36f300, stack=<optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /build/buildd/vcmi-0.94+svn3369/client/battle/CBattleInterface.cpp:1662
0000008 0x00000000005186e3 in CBattleInterface::activateStack (
    [email protected]=0x7fffce36f300)
    at /build/buildd/vcmi-0.94+svn3369/client/battle/CBattleInterface.cpp:1692
0000009 0x00000000005188b3 in CBattleInterface::stackActivated (
    [email protected]=0x7fffce36f300, [email protected]=0x7fff50ea9e90)
    at /build/buildd/vcmi-0.94+svn3369/client/battle/CBattleInterface.cpp:1028
0000010 0x00000000005cc521 in CPlayerInterface::activeStack (
    [email protected]=0x7fffcd69fcb8, stack=0x7fff50ea9e90)
    at /build/buildd/vcmi-0.94+svn3369/client/CPlayerInterface.cpp:777
0000011 0x00000000005b4ec0 in CClient::waitForMoveAndSend (this=0x7fffcc000a90,
    color=...) at /build/buildd/vcmi-0.94+svn3369/client/Client.cpp:120
0000012 0x00000000006a63ca in operator() (a1=..., p=<optimized out>,
    this=<optimized out>) at /usr/include/boost/bind/mem_fn_template.hpp:165
0000013 operator()<boost::_mfi::mf1<void, CClient, PlayerColor>, boost::_bi::list0>
    (a=<synthetic pointer>, f=..., this=<optimized out>)
    at /usr/include/boost/bind/bind.hpp:313
0000014 operator() (this=<optimized out>)
    at /usr/include/boost/bind/bind_template.hpp:20
0000015 boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, CClient, PlayerColor>, boost::_bi::list2<boost::_bi::value<CClient*>, boost::_bi::value<PlayerColor> > > >::run (this=<optimized out>)
    at /usr/include/boost/thread/detail/thread.hpp:117
---Type <return> to continue, or q <return> to quit---
0000016 0x00007ffff6dfd94a in ?? ()
   from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
0000017 0x00007ffff6bdcf6e in start_thread (arg=0x7fffdd5f6700)
    at pthread_create.c:311
0000018 0x00007ffff40d19cd in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(gdb)
R1
Issue History
2013-12-23 14:46KroArtemNew Issue
2013-12-23 14:46KroArtemStatusnew => assigned
2013-12-23 14:46KroArtemAssigned To => Tow
2013-12-23 14:51WarmongerNote Added: 0004200
2013-12-23 14:52KroArtemNote Added: 0004201
2014-01-12 18:21KroArtemNote Added: 0004317
2014-01-12 20:29KroArtemNote Added: 0004318
2022-03-22 15:29PovelitelTag Attached: R1
2022-09-16 20:15PovelitelNote Added: 0008351
2022-09-16 20:15PovelitelStatusassigned => resolved
2022-09-16 20:15PovelitelFixed in Version => 0.next
2022-09-16 20:15PovelitelResolutionopen => unable to reproduce

Notes
(0004200)
Warmonger   
2013-12-23 14:51   
It could be helpful to tell the details, such as WHICH spell was cast under what confitions.
(0004201)
KroArtem   
2013-12-23 14:52   
Unfortunately I don't remember, though it's not that hard to reproduce. I'll try to give additional info in case I'll have this crash again.
(0004317)
KroArtem   
2014-01-12 18:21   
Reproduced it with latest trunk. It crashed when I killed the latest enemy creature with spell. (still don't know _what_ spell was cast).
(0004318)
KroArtem   
2014-01-12 20:29   
Ok, it was "Lightning bolt" but I'm pretty sure it doesn't depend on used spell.
(0008351)
Povelitel   
2022-09-16 20:15   
Lightning bolt works correctly. Reproducibility failed