MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002442VCMIMechanics - Battlespublic2016-05-16 16:082022-04-12 10:47
Reporter8cichy8 
Assigned ToAVS 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformpcOSdebianOS Versionjessie
Product Version0.98g 
Target VersionFixed in Version0.99 
Summary0002442: crash after town battle
DescriptionAfter town battle victory -> click on confirm button of battle summary dialog -> crash
Steps To ReproduceAttack with hero Isra on castle which is before him. If you attack immediately, then it crash every time, but if you wait some day, or move somewhere and back, then it crash only sometimes. Probably doesn't happens with other hero.
Additional InformationSaved game is attached
TagsNo tags attached.
Attached Filesbz2 file icon rand01_crash_after_castle_battle_save.tar.bz2 [^] (823,826 bytes) 2016-05-16 16:08
png file icon SiegeHelper.png [^] (549,240 bytes) 2016-07-04 22:27


patch file icon Gate-Fix.patch [^] (1,045 bytes) 2016-07-04 23:01 [Show Content]

- Relationships
duplicate of 0002445closedAVS Crash after town battle victory 
related to 0002415closedSXX Crash on castle battle 

-  Notes
(0006512)
8cichy8 (reporter)
2016-05-16 16:37

update: also happens with other hero
(0006517)
rumianom (reporter)
2016-07-04 22:28

the same issue as 0002445
and seems related to 0002415. I have attached Debugger screenshot.
(0006518)
rumianom (reporter)
2016-07-04 23:02

I have attached a patch that fixes the issue for me. Could you have look?
(0006520)
AVS (administrator)
2016-07-05 13:29
edited on: 2016-07-05 13:34

Unable to reproduce.

(0006521)
rumianom (reporter)
2016-07-05 19:53

That's weird. I did a little bit more investigation and I could reproduce the crash each time.

My system details: Ubuntu 16.04 amd64, version tested is a build of the latest develop branch commit 21fff9d


It is related to the battle finishing before the confirmation of the result and destruction of CBattleInterface. In the logs I have multiple errors about trying to access battle that already finished. (I have added couple more log statements)
--------------------------------------------------------------
battle is now B=0x7fffb00457a0
battle is now B=0x7fffb00457a0
SiegeHelper called
Opening BattleAI
Loaded Battle AI
gateStateChangedoldState=1 state=3
gateStateChangedoldState=3 state=1
Warning: an orphaned child!
battleGetHeroInfo: side 1 does not have hero!
battle is now B=0
battle is now B=0
Warning: an orphaned child!
battleGetAllObstacles called when no battle!
battleGetStacksIf called when no battle!
battleGetAllObstacles called when no battle!
battleGetGateState called when no battle!
bExitf from Battle Result
battleGetAllObstacles called when no battle!
battleGetStacksIf called when no battle!
battleGetAllObstacles called when no battle!
battleGetGateState called when no battle!
battleGetStackByPos called when no battle!
~SiegeHelper called
battleGetGateState called when no battle!
read: Connection reset by peer
----------------------------------------------------------------

It looks like many things are trying to access battle that has already finished (Client.cpp::768::battleFinished has set battle to null) to derive the rendering state.

Maybe CBattleInterface should keep track of the state in it's own instance to be able to clean SDL surfaces?

AVS on which OS did you try to reproduce the bug?
(0006522)
AVS (administrator)
2016-07-05 20:02

OS is different - win7 64, but in this case it should not matter.
(0006535)
8cichy8 (reporter)
2016-07-30 06:57

looks like your patch helped (doesn't crash - even though it still print errors)
thanks
(0006536)
AVS (administrator)
2016-08-01 15:16

Which errors?
(0006537)
AVS (administrator)
2016-08-01 15:30

patch applied in https://github.com/vcmi/vcmi/commit/6e24d1e929a902bb743b0cc4396f2f2d5e484a78/ [^]

thanks
(0006538)
8cichy8 (reporter)
2016-08-04 05:24

logs(red):

battleGetAllObstacles called when no battle!
battleGetStacksIf called when no battle!
battleGetAllObstacles called when no battle!
battleGetGateState called when no battle!
battleGetAllObstacles called when no battle!
battleGetStacksIf called when no battle!
battleGetAllObstacles called when no battle!
battleGetGateState called when no battle!
battleGetStackByPos called when no battle!
battleGetGateState called when no battle!
(0006539)
AVS (administrator)
2016-08-04 06:01

"xxx called when no battle" is a known problem, mostly harmless but not easy fixable. Not related to this issue.

- Issue History
Date Modified Username Field Change
2016-05-16 16:08 8cichy8 New Issue
2016-05-16 16:08 8cichy8 File Added: rand01_crash_after_castle_battle_save.tar.bz2
2016-05-16 16:37 8cichy8 Note Added: 0006512
2016-07-04 22:27 rumianom File Added: SiegeHelper.png
2016-07-04 22:28 rumianom Note Added: 0006517
2016-07-04 23:01 rumianom File Added: Gate-Fix.patch
2016-07-04 23:02 rumianom Note Added: 0006518
2016-07-05 13:08 AVS Relationship added duplicate of 0002445
2016-07-05 13:10 AVS Assigned To => SXX
2016-07-05 13:10 AVS Status new => assigned
2016-07-05 13:27 AVS Relationship added related to 0002415
2016-07-05 13:29 AVS Note Added: 0006520
2016-07-05 13:29 AVS Assigned To SXX => AlexVinS
2016-07-05 13:29 AVS Status assigned => feedback
2016-07-05 13:29 AVS Assigned To AlexVinS => AVS
2016-07-05 13:29 AVS Status feedback => assigned
2016-07-05 13:29 AVS Status assigned => feedback
2016-07-05 13:34 AVS Note Edited: 0006520 View Revisions
2016-07-05 19:53 rumianom Note Added: 0006521
2016-07-05 20:02 AVS Note Added: 0006522
2016-07-30 06:57 8cichy8 Note Added: 0006535
2016-07-30 06:57 8cichy8 Status feedback => assigned
2016-08-01 15:16 AVS Note Added: 0006536
2016-08-01 15:30 AVS Note Added: 0006537
2016-08-04 05:24 8cichy8 Note Added: 0006538
2016-08-04 06:01 AVS Note Added: 0006539
2016-08-04 06:02 AVS Status assigned => resolved
2016-08-04 06:02 AVS Fixed in Version => 0.99
2016-08-04 06:02 AVS Resolution open => fixed
2022-04-12 10:47 Povelitel Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean