MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002127VCMIMechanics - Adventure Mappublic2015-03-10 18:332022-04-12 11:04
ReporterWarmonger 
Assigned ToSXX 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version0.99 
Summary0002127: Possible crash when hero is hired in town that gives him primary skill bonus
DescriptionDebugger shows line
sps.id = hero->id;
In CGameHandler::changePrimSkill
When hero is recruited at town Marshchoke (Fortress)

Apparently hero pointer is not always correctly initialized at this point, or there are race conditions.
TagsNo tags attached.
Attached Files

- Relationships
related to 0002277closedSXX Random heroes always have subID of zero and don't inherit predefined options 

-  Notes
(0006679)
SXX (administrator)
2016-09-17 23:28
edited on: 2016-09-17 23:29

I got exactly same reproducible crash, but in GiveBonus::applyGs.
Object simply not exist in GS when package applied.

Investigating for fix...

(0006680)
SXX (administrator)
2016-09-18 01:04

So reason is:

- In CGameHandler::hireHero there one hero choosen from PlayerState::availableHeroes to "nh" ptr.
- Then in HeroRecruited::applyGs it's choosen from heroesPool[hid].
- After HeroRecruited applied in GH "nh" passed to other functions such as vistiCastleObjects.

Problem occur because for whatever reason heroesPool contain wrong hero there.
So while GS initialized different hero GH attempt to use hero that not on map and other netpacks fail since there is no such hero on map.
(0006681)
SXX (administrator)
2016-09-18 01:40

This one might be related to 0002277 in case it's didn't fixed everything perfectly.
Though at least random heroes have proper subID so bug might be somewhere else.
(0006683)
SXX (administrator)
2016-09-18 07:08

Fixed:
https://github.com/vcmi/vcmi/commit/635c48f889d8d642ac1fb7517222356498bd0953 [^]

More info available in 0002277.

- Issue History
Date Modified Username Field Change
2015-03-10 18:33 Warmonger New Issue
2015-03-10 18:42 Warmonger Summary Possible crash when hero is hired in town that givves him primary skill bonus => Possible crash when hero is hired in town that gives him primary skill bonus
2016-09-17 23:28 SXX Note Added: 0006679
2016-09-17 23:29 SXX Note Edited: 0006679 View Revisions
2016-09-18 01:04 SXX Note Added: 0006680
2016-09-18 01:04 SXX Assigned To => SXX
2016-09-18 01:04 SXX Status new => assigned
2016-09-18 01:39 SXX Relationship added related to 0002277
2016-09-18 01:40 SXX Note Added: 0006681
2016-09-18 07:08 SXX Note Added: 0006683
2016-09-18 07:08 SXX Status assigned => resolved
2016-09-18 07:08 SXX Fixed in Version => 0.99
2016-09-18 07:08 SXX Resolution open => fixed
2022-04-12 11:04 Povelitel Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean