MantisBT - VCMI
View Issue Details
0000966VCMIMechanics - Battlespublic2012-05-23 16:022014-05-30 17:41
James van Bhradok 
Ivan 
highcrashsometimes
closedfixed 
0.88b 
0.89 
0000966: Crash occurs at the end of the battle.
Crash occurs at the end of the battle.
No tags attached.
related to 0000948closed Warmonger Add enemy unit movement shadow (like in King's Bounty - The Legend ) 
? scr01.bmp (1,775,054) 2012-05-23 16:52
https://bugs.vcmi.eu/file_download.php?file_id=944&type=bug
Issue History
2012-05-23 16:02James van BhradokNew Issue
2012-05-23 16:52James van BhradokFile Added: scr01.bmp
2012-05-23 17:05James van BhradokNote Added: 0002531
2012-05-23 17:38majaczekNote Added: 0002533
2012-05-23 20:07douggie_mNote Added: 0002535
2012-05-23 20:15douggie_mNote Edited: 0002535bug_revision_view_page.php?bugnote_id=2535#r1666
2012-05-23 20:24douggie_mNote Added: 0002536
2012-05-23 20:25douggie_mNote Edited: 0002536bug_revision_view_page.php?bugnote_id=2536#r1668
2012-05-24 15:20IvanNote Added: 0002538
2012-05-24 15:20IvanRelationship addedrelated to 0000948
2012-05-24 18:41TowNote Added: 0002543
2012-05-24 18:47douggie_mNote Added: 0002544
2012-05-24 20:24douggie_mNote Added: 0002546
2012-05-25 11:52IvanNote Added: 0002548
2012-05-25 11:52IvanAssigned To => Ivan
2012-05-25 11:52IvanStatusnew => feedback
2012-05-25 19:03douggie_mNote Added: 0002559
2012-05-25 19:22douggie_mNote Edited: 0002559bug_revision_view_page.php?bugnote_id=2559#r1670
2012-05-25 19:48IvanNote Added: 0002563
2012-05-25 19:48IvanStatusfeedback => resolved
2012-05-25 19:48IvanFixed in Version => 0.89
2012-05-25 19:48IvanResolutionopen => fixed
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0002531)
James van Bhradok   
2012-05-23 17:05   
For some reason I can not edit my post, so I posted here.

 While wins in the battle, Crash message pops up as shown in the picture send. This does not occur when you lose.
(0002533)
majaczek   
2012-05-23 17:38   
I confirm. It occured to me after 7-th battle for me on vcmi0.88b
(0002535)
douggie_m   
2012-05-23 20:07   
(edited on: 2012-05-23 20:15)
This is a sever issue. I got it too.

If devs would like to see gdb bt-s and such, just ping me.

CStupidAI [0x11b755f0]: battleStacksAttacked called
CStupidAI [0x11b755f0]: battleAttack called
CStupidAI [0x11b755f0]: battleStacksAttacked called
CStupidAI [0x11b755f0]: actionFinished called
CStupidAI [0x11b755f0]: battleEnd called
Warning: an orphaned child!
battleGetStacks called when there is no battle!
Connection has been requested to be closed.
Sent closing signal to the server
Segmentation fault
username@g5:~$ *** glibc detected *** /usr/bin/vcmiserver: double free or corruption (fasttop): 0x109487a0 ***
======= Backtrace: =========
/lib/powerpc-linux-gnu/libc.so.6(+0x854e4)[0xeca44e4]
/lib/powerpc-linux-gnu/libc.so.6(cfree+0x8c)[0xeca9abc]
/usr/lib/powerpc-linux-gnu/libstdc++.so.6(_ZdlPv+0x2c)[0xef2b65c]
/usr/lib/powerpc-linux-gnu/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x24)[0xef9f0a4]
/usr/lib/powerpc-linux-gnu/libstdc++.so.6(+0xe811c)[0xef9f11c]
/usr/lib/powerpc-linux-gnu/libstdc++.so.6(_ZNSsD1Ev+0x50)[0xef9f1e0]
/usr/bin/vcmiserver(_ZN8VCMIDirsD1Ev+0x24)[0x10350ba8]
/lib/powerpc-linux-gnu/libc.so.6(__cxa_finalize+0x1c4)[0xec5e0c4]
/usr/lib/vcmi/libvcmi.so.0(+0x50ff08)[0xf7d1f08]
/usr/lib/vcmi/libvcmi.so.0(+0xaf4974)[0xfdb6974]
/lib/ld.so.1(+0xfee8)[0xf7b09ee8]
....

(0002536)
douggie_m   
2012-05-23 20:24   
(edited on: 2012-05-23 20:25)
Okay, it is 100% reproducible, so...

Program received signal SIGABRT, Aborted.
0x0ec5698c in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x0ec5698c in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0ec5c040 in *__GI_abort () at abort.c:92
0000002 0x0ec96d9c in __libc_message (do_abort=2, fmt=0x400 <Address 0x400 out of bounds>)
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
0000003 0x0eca44e4 in malloc_printerr (action=3, str=0xed77818 "double free or corruption (fasttop)", ptr=<optimized out>)
    at malloc.c:6283
0000004 0x0eca9abc in *__GI___libc_free (mem=<optimized out>) at malloc.c:3738
0000005 0x0ef2b65c in operator delete(void*) () from /usr/lib/powerpc-linux-gnu/libstdc++.so.6
0000006 0x0ef9f0a4 in std::string::_Rep::_M_destroy(std::allocator<char> const&) ()
   from /usr/lib/powerpc-linux-gnu/libstdc++.so.6
0000007 0x0ef9f11c in ?? () from /usr/lib/powerpc-linux-gnu/libstdc++.so.6
0000008 0x0ef9f1e0 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() ()
   from /usr/lib/powerpc-linux-gnu/libstdc++.so.6
0000009 0x10350ba8 in VCMIDirs::~VCMIDirs (this=0x10436e20, __in_chrg=<optimized out>) at ../lib/VCMIDirs.h:22
0000010 0x0ec5e0c4 in __cxa_finalize (d=0xffee924) at cxa_finalize.c:56
0000011 0x0f7d1f08 in __do_global_dtors_aux () from /usr/lib/vcmi/libvcmi.so.0
0000012 0x0fdb6974 in _fini () from /usr/lib/vcmi/libvcmi.so.0
0000013 0xf7b95ee8 in ?? () from /lib/ld.so.1
0000014 0x0ec5db44 in __run_exit_handlers (status=-8348704, listp=0x41, run_list_atexit=false) at exit.c:78
0000015 0x0ec5db8c in *__GI_exit (status=<error reading variable: value has been optimized out>) at exit.c:100
0000016 0x0ec3e7f0 in generic_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>,
    auxvec=<optimized out>, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=<optimized out>) at ../csu/libc-start.c:260
0000017 0x0ec3e9b0 in __libc_start_main (argc=<error reading variable: value has been optimized out>,
    ubp_av=<error reading variable: value has been optimized out>, ubp_ev=<optimized out>,
    auxvec=<error reading variable: value has been optimized out>,
    rtld_fini=<error reading variable: value has been optimized out>, stinfo=<optimized out>,
    stack_on_entry=<error reading variable: value has been optimized out>)
    at ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:105
0000018 0x00000000 in ?? ()

^^^^ it is backtrace from gdb attached to vcmiserver

(0002538)
Ivan   
2012-05-24 15:20   
Most probably related to 0000948

I have good news and bad news.
Good news: your backtrace looks OK. I think I know what's wrong and how to fix that.
Bad news: this is not crash from this bug. What you see is:
1) For some reason client decided to close (actual bug)
2) Client send closing signal to server and disconnected.
3) Server received signal but crashed on closing (this is what you backtrace shows)
(0002543)
Tow   
2012-05-24 18:41   
If it's reproducible, please provide steps allowing us to reproduce the issue.


@James van Bhradok
Please don't upload images in BMP format, it wastes both server space and our bandwidths. If you care about quality loss from JPG (though it's usually not an issue), there's always PNG that provides lossless compression.
(0002544)
douggie_m   
2012-05-24 18:47   
> I have good news and bad news.

There's only news, they are not good or bad, they are just news ;)

> I think I know what's wrong and how to fix that.

Cool.
(0002546)
douggie_m   
2012-05-24 20:24   
Tow> please provide steps allowing us to reproduce the issue

Well, it is very reproducible. I got it on ``All for one.h3m'' almost every time. If you can't get "crash on the end of battle", then try to recruit a new hero in tavern and try again.
(0002548)
Ivan   
2012-05-25 11:52   
Both crashes should be fixed in rev 2709. Please recheck.
(0002559)
douggie_m   
2012-05-25 19:03   
(edited on: 2012-05-25 19:22)
Haven't seen any crashes on the end of battle with rev2711.

UPD: Well, the new type of crash appeared, SIGABRT at the time of AI's turn:

        Time of looking for new exploration point was 660 ms.
        Time of Evaluating exploration possibilities was 660 ms.
        Time of looking for best exploration neighbour was 0 ms.
Looking for an another place for exploration...
        Time of looking for new exploration point was 680 ms.
        Time of Evaluating exploration possibilities was 700 ms.
        Attempting realizing goal with code EXPLORE
vcmiclient: VCAI.cpp:1719: void VCAI::tryRealize(CGoal): Assertion `0' failed.
Aborted

But this is an another issue.

(0002563)
Ivan   
2012-05-25 19:48   
Resolved then.