MantisBT - VCMI
View Issue Details
0001053VCMIAI - Battlespublic2012-08-26 06:482014-05-30 17:43
Warmonger 
Tow 
normalcrashalways
closedfixed 
PCWindows 7SP1
 
0.90.93 
0001053: Battle continues after AI clears Bank
Load attached save. Wait until Blue player attacks Cyclops Stockpile. It will defeat guards and receive reward, but later additional battle ai calls appear.
CStupidAI [0F860B00]: actionStarted called
CStupidAI [0F8602B0]: actionStarted called
CStupidAI [0F860B00]: battleStackMoved called
CStupidAI [0F8602B0]: battleStackMoved called
CStupidAI [0F860B00]: battleAttack called
CStupidAI [0F8602B0]: battleAttack called
CStupidAI [0F860B00]: battleStacksAttacked called
CStupidAI [0F8602B0]: battleStacksAttacked called
CStupidAI [0F860B00]: actionFinished called
CStupidAI [0F8602B0]: actionFinished called
                Player 1: I won the Starting battle of Drakon attacking Drakon the Beastma
ster at 215 202 0!
CStupidAI [0F860B00]: battleEnd called
CStupidAI [0F860B00]: destroyed
CStupidAI [0F8602B0]: battleEnd called
Warning: an orphaned child!
                Adding query 400 - Hero Drakon got level 9. Total queries count: 1
                I'll answer the query 400 giving the choice 0
                Attempted answering query 400 - Hero Drakon got level 9. Request id=258. W
aiting for results...
                Adding query 401 - Commander Commando of Hero Drakon got level 9. Total qu
eries count: 2
                I'll answer the query 401 giving the choice 0
                Attempted answering query 401 - Commander Commando of Hero Drakon got leve
l 9. Request id=259. Waiting for results...
                Adding query 402 - Blocking dialog query with 0 components - You have foun
d a Cyclops Stockpile. Do you wish to attack the guards?. Total queries count: 3
                I'll answer the query 402 giving the choice 1
                Attempted answering query 402 - Blocking dialog query with 0 components -
You have found a Cyclops Stockpile. Do you wish to attack the guards?. Request id=260. Wa
iting for results...
                Removing query 400 - Hero Drakon got level 9. Total queries count: 2
                Removing query 401 - Commander Commando of Hero Drakon got level 9. Total
queries count: 1
                Removing query 402 - Blocking dialog query with 0 components - You have fo
und a Cyclops Stockpile. Do you wish to attack the guards?. Total queries count: 0
Opening StupidAI
Loaded Stupid AI 0.1
CStupidAI [0F860A58]: created
CStupidAI [0F860A58]: init called, saving ptr to IBattleCallback
CStupidAI [0F860A58]: battleStart called
CStupidAI [0F8602B0]: battleStart called
CStupidAI [0F860A58]: battleNewRoundFirst called
CStupidAI [0F8602B0]: battleNewRoundFirst called
CStupidAI [0F860A58]: battleNewRound called
CStupidAI [0F8602B0]: battleNewRound called
CStupidAI [0F860A58]: activeStack called
Disaster happened.
Reason: 0xc0000005 - EXCEPTION_ACCESS_VIOLATION at 0023:65EE3D12
Attempt to read from 0x00000000
Thread ID: 1168 [4456]
Crash info will be put in VCMI_client.exe_crashinfo.dmp
No tags attached.
parent of 0000955closed Tow Rare crash when AI attacks creature bank 
has duplicate 0001063closed Tow Visiting the Crypt at end of the movement leads to issues: second visit, crash 
has duplicate 0001251closed Tow Dragon Utopia double visit 
related to 0001249closed Tow AI crash during end turn 
rar Crash_conservatory.rar (1,241,600) 2012-08-31 07:18
https://bugs.vcmi.eu/file_download.php?file_id=1048&type=bug
rar Crash_crypt.rar (465,114) 2012-08-31 07:18
https://bugs.vcmi.eu/file_download.php?file_id=1049&type=bug
rar Freeze_Griffin_Conservatory.rar (1,124,156) 2012-08-31 07:18
https://bugs.vcmi.eu/file_download.php?file_id=1050&type=bug
Issue History
2012-08-26 06:48WarmongerNew Issue
2012-08-26 06:48WarmongerStatusnew => assigned
2012-08-26 06:48WarmongerAssigned To => Tow
2012-08-26 06:48WarmongerFile Added: BankCrash.rar
2012-08-26 07:04WarmongerAdditional Information Updatedbug_revision_view_page.php?rev_id=1848#r1848
2012-08-26 19:17TowNote Added: 0002932
2012-08-26 19:17TowStatusassigned => resolved
2012-08-26 19:17TowFixed in Version => 0.dev
2012-08-26 19:17TowResolutionopen => fixed
2012-08-26 19:19TowFixed in Version0.dev =>
2012-08-28 19:27WarmongerNote Added: 0002946
2012-08-28 19:27WarmongerStatusresolved => feedback
2012-08-28 19:27WarmongerResolutionfixed => reopened
2012-08-28 19:28WarmongerFile Deleted: BankCrash.rar
2012-08-28 19:28WarmongerFile Added: BankCrash2.rar
2012-08-28 19:29WarmongerNote Edited: 0002946bug_revision_view_page.php?bugnote_id=2946#r1862
2012-08-30 15:52TowNote Added: 0002953
2012-08-31 07:17WarmongerFile Deleted: BankCrash2.rar
2012-08-31 07:18WarmongerFile Added: Crash_conservatory.rar
2012-08-31 07:18WarmongerFile Added: Crash_crypt.rar
2012-08-31 07:18WarmongerFile Added: Freeze_Griffin_Conservatory.rar
2012-08-31 07:19WarmongerNote Added: 0002955
2012-08-31 07:19WarmongerStatusfeedback => assigned
2012-08-31 10:56TowNote Added: 0002956
2012-08-31 11:38IvanNote Added: 0002957
2012-08-31 13:44TowNote Added: 0002958
2012-08-31 16:30ZamolxisNote Added: 0002960
2012-08-31 16:41TowNote Added: 0002962
2012-08-31 16:59ZamolxisFile Added: VCMI_Tests_2012.h3m
2012-08-31 17:01IvanNote Added: 0002965
2012-08-31 17:09ZamolxisNote Added: 0002966
2012-08-31 17:10ZamolxisNote Edited: 0002966bug_revision_view_page.php?bugnote_id=2966#r1868
2012-08-31 17:35TowNote Added: 0002968
2012-08-31 17:45ZamolxisNote Added: 0002969
2012-08-31 18:05ZamolxisNote Edited: 0002969bug_revision_view_page.php?bugnote_id=2969#r1870
2012-08-31 21:59ZamolxisFile Deleted: VCMI_Tests_2012.h3m
2012-08-31 22:00ZamolxisNote Edited: 0002969bug_revision_view_page.php?bugnote_id=2969#r1871
2012-09-28 11:49WarmongerRelationship addedparent of 0000955
2013-01-28 07:52WarmongerRelationship addedparent of 0001191
2013-01-28 14:16WarmongerRelationship addedhas duplicate 0001063
2013-03-30 15:39WarmongerRelationship addedhas duplicate 0001251
2013-04-01 13:55IvanRelationship addedrelated to 0001249
2013-04-20 11:39TowNote Added: 0003492
2013-04-20 11:39TowStatusassigned => resolved
2013-04-20 11:39TowFixed in Version => 0.93
2013-04-20 11:39TowResolutionreopened => fixed
2013-04-21 12:06TowRelationship deletedparent of 0001191
2014-05-30 17:43beegeeStatusresolved => closed

Notes
(0002932)
Tow   
2012-08-26 19:17   
Hmm... when trying to fix this issues, I found and fixed three serious bugs. Not sure which was that or if it really fixed, but I'm not able to reproduce crash anymore.
So seems to be fixed in r2848.

By the way, the attached save seems to be corrupted — creatures are missing bonuses with damage values. They deal 0 damage and thus battle goes on indefinitely. However my saves work fine, so I believe it's something on your side.
(0002946)
Warmonger   
2012-08-28 19:27   
(edited on: 2012-08-28 19:29)
It still happens often for me, crash in bank with level-up on AI turn.

Uploaded another save, but not sure if AI will trigger the crash again.
Didn't happen on tiny test map for thousands of turns, though.

(0002953)
Tow   
2012-08-30 15:52   
I spent quite a while trying to reproduce this but I'm unable. I don't think it is the same bug as originally reported, since... it seems pretty well fixed. :P

When the crash happens again, please try capturing the stacktrace from debugger, saving whole log files, and so on. I need more information to investigate and I can't get them being unable to reproduce the issue.
(0002955)
Warmonger   
2012-08-31 07:19   
Uploaded some crash dumps.

Also, similiar issue happens when neutral creatures flee, but battle is started nonetheless. Didn't reproduce it today yet.
(0002956)
Tow   
2012-08-31 10:56   
To read crashdumps I need your debug symbols (.pdb files) for the exact build you used.
[By exact build I mean that .pdb must come from the very same compilation as the exe that generated dump — even rebuilding same sources generates incompatible symbols.]

I'll look into logs in the meantime.
Look to be a race condition between post-battle callbacks and client-handling connection thread.
(0002957)
Ivan   
2012-08-31 11:38   
I got some crashes with "Armageddon rains, everyone dies" scenario.
Server have tendency to crash in
CGameHandler::checkForBattleEnd()
because gs->curB is null. (don't have full stacktrace right now).
Looks like race condition to me.

I thought that this was same as 0000294 and haven't reported it.
(0002958)
Tow   
2012-08-31 13:44   
I doubt it is related, since the crashes here are related to creature bank handling. (unless it is bigger race condition bug affecting all battles)
But I'll investigate the Armageddon scenario as well, VCMI should never crash.
(0002960)
Zamolxis   
2012-08-31 16:30   
In regards to the original report: does Blue attack Cyclops Stockpile at the end of his movement points? There's a bug in VCMI 0.88 & 0.89 when attacking the Crypt, that after victory & reward a 2nd battle (with no enemy) is called. One of the conditions to reproduce it, is that hero has to enter the Crypt with the last of his movement points. > Does that sound like a bug that would have been corrected by Tow's fixes in r2848, or should I create a separate report?
(0002962)
Tow   
2012-08-31 16:41   
@Ivan
When using Armageddon to kill I did observe the crash... but on the client side, caused by the stack queue fail to update. Fixed in r2869. Now I can't observe any crash after casting Armageddon.


@Zamolxis
Great to see you again! :)
Fix from r2848 corrected bugs that I introduced when rewriting battle callbacks recently. The bug you describe... well, it looks very similar to the issue Warmonger is reporting here, it may be the same bug. I'll try reproducing that last movement points condition.
(0002965)
Ivan   
2012-08-31 17:01   
Tried same scenario, same hero, same battle - no crash. Probably was fixed recently.
(0002966)
Zamolxis   
2012-08-31 17:09   
(edited on: 2012-08-31 17:10)
@Tow
Nice to be back (though by far not at the end of my hurdles with the house renovations, so it's hard to predict how active I'll be able to be here in the near future)
Take Ivor in the map I just attached to reproduce:
- send him south-east on the road just before FoW, then the underground gate
- attack halflings, but let them flee
- attack nearest Crypt on the upper row (should be reachable with last move)
- win the battle, take the skill, but then, instead of reward, you're asked if you want to attack again... and then follow some more buggy behaviors.

Let me know if you can still reproduce. If not, I'll create a separate (more detailed) report with screenshots & crashdump.

(0002968)
Tow   
2012-08-31 17:35   
Thanks, well done. I managed to reproduce issue with SVN build. After levelling-up another battle was offered. However there was no enemy when it started... I managed to go through it without crash but it's obviously a bug (and 0.89 or AI-only battle may crash).

I guess it's rather related to getting a level in creature bank than to last movement points. At the second attempt, there was less creatures in crypt, Ivor didn't level-up and the bug didn't show up.
(0002969)
Zamolxis   
2012-08-31 17:45   
(edited on: 2012-08-31 22:00)
If I end turn anywhere on the path, and continue next day (not end of movement), the bug is not reproducible. Anyway, it's clearly a different one that what has been fixed so far then, so I'll create a separate report. We can discuss more there.

EDIT: 0001063 created (map deleted here and attached over there)

(0003492)
Tow   
2013-04-20 11:39   
Fixed in r3336.