Help with CTD CvRouteModelInfo::isAnimated

wotan321

Emperor
Joined
Oct 25, 2001
Messages
1,228
Location
NC, USA
I do not know how to troubleshoot into the DLLs, so I am asking for help on a crash I just can't crack. This happens every time on a certain turn in a modded version of the WW2 1939 Mod.

Any help is appreciated in figuring out what is causing the crash.

Here is what Windbg gives me:

STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
0019f648 04312ded 3f460690 3f44a988 ffffffff CvGameCoreDLL!CvRouteModelInfo::isAnimated+0xa30
0019f664 0431304a 04313056 ffffffff 0042a0bd CvGameCoreDLL!CvUnit::getSubUnitsAlive+0x12e1d
0019f668 04313056 ffffffff 0042a0bd 00000000 CvGameCoreDLL!CvUnit::getSubUnitsAlive+0x1307a
0019f684 044bfbeb ffffffff 042db963 003e0037 CvGameCoreDLL!CvUnit::getSubUnitsAlive+0x13086
0019f7ac 04344a65 3f44a988 37f69140 03e3d584 CvGameCoreDLL!CvDllTranslator::initializeTags+0x1636b
0019f83c 042dc1da 4ed10f38 03e3d584 00000000 CvGameCoreDLL!CvSpaceShipInfo::getArtType+0x26895
0019fc98 042a55fe 00000004 03e3d584 0019fec8 CvGameCoreDLL!CvSelectionGroup::autoMission+0x51a
0019fcdc 0418d269 00000000 03d1c910 004da11c CvGameCoreDLL!CvPlayerAI::AI_maxGoldPerTurnTrade+0x6d6e
0019fec8 00686bc8 77579640 004d6f46 011e3549 CvGameCoreDLL!CvGame::setName+0x1249
0019ff80 77573744 fffda000 77573720 cac6f406 Civ4BeyondSword+0x286bc8
0019ffcc 776c0d3f 1055d7cf 00000000 0019ffec kernel32!BaseThreadInitThunk+0x24
0019ffe4 776cd7ef 00000000 00000000 008f47fa ntdll!wcstombs+0x8f
0019ffe8 00000000 00000000 008f47fa fffda000 ntdll!FinalExceptionHandlerPad63


SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: cvgamecoredll!CvRouteModelInfo::isAnimated+a30

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: CvGameCoreDLL

IMAGE_NAME: CvGameCoreDLL.dll

DEBUG_FLR_IMAGE_TIMESTAMP: 4c5b46a9

STACK_COMMAND: .ecxr ; kb

BUCKET_ID: INVALID_POINTER_READ_cvgamecoredll!CvRouteModelInfo::isAnimated+a30

PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ_cvgamecoredll!CvRouteModelInfo::isAnimated+a30

FAILURE_PROBLEM_CLASS: INVALID_POINTER_READ

FAILURE_EXCEPTION_CODE: c0000005

FAILURE_IMAGE_NAME: CvGameCoreDLL.dll

FAILURE_FUNCTION_NAME: CvRouteModelInfo::isAnimated

FAILURE_SYMBOL_NAME: CvGameCoreDLL.dll!CvRouteModelInfo::isAnimated

FAILURE_BUCKET_ID: INVALID_POINTER_READ_c0000005_CvGameCoreDLL.dll!CvRouteModelInfo::isAnimated

ANALYSIS_SOURCE: UM

FAILURE_ID_HASH_STRING: um:invalid_pointer_read_c0000005_cvgamecoredll.dll!cvroutemodelinfo::isanimated

FAILURE_ID_HASH: {6d6535d7-5919-6a17-5f35-a4ab2b181fbc}
 
Donno, im a noob coder myself, but the original looks like this :
PHP:
¨bool CvRouteModelInfo::isAnimated() const
{
	return m_bAnimated;
}
and afaik it checks to see if the road nifs have animations or are static (in CIV4RouteModelInfos.xml in XML/Art folder)
So check if all <RouteModelInfo> have <Animated>0</Animated>
if not then try to set them to 0 an see what happens
 
Thank-you, vincentz.

All are <Animated>0</Animated>. The only difference between this CIV4RouteModelInfos.xml and the BtS file is the .nif files. Could this crash be caused by a missing .nif file? The crash occurs late in the game.

Again, thank-you.
 
I went in and deleted the mod copy of \Art\CIV4RouteModelInfos.xml, cleared out the cache. Still get the crash.
 
enable chipotle in the ini. use alt+z to switch civs and see exactly when the crash occours. could lead to specifying when it happens
also, if you go into world builder, save as scenario and load the scenario, does the crash still happens?
 
Good thinking. I tried saving it as a scenario then launching the scenario, but it crashed first turn.

I will try the cheat to switch civs. I'll say one thing for mysteries, they are quite educational. I am learning new troubleshooting ideas for this issue. Thanks.

So what sort of things should I check on once playing as one of the other civs?
 
if it doesnt crash after a full rotation of civs, then my guess is its in the AI dll, though could be something with a unit it uses.
If it does crash, then at least you can see which civs it crashed at, and by deleting the civs units, you can narrow the issue down further.
Typically a crash like that would either be with the dll, or a broken art imho.
it could also be a broken event.
 
Thanks. I will follow up on that and report back. When I saved the scenario I added the options NO EVENTS, and it still crashed, so I don't suspect an event.
 
Okay... it turns out that 4 of the 15 civs, when not played by the AI, do not crash on the next turn. I am going to go back and examine what they may have in common.
 
You might want to insert this in CvEventManager. It will tell you who has played its turn:
Spoiler :
Code:
	def onEndPlayerTurn(self, argsList):
		'Called at the end of a players turn'
		iGameTurn, iPlayer = argsList
		pPlayer = gc.getPlayer(iPlayer)
### isenchine added to display who is currently playing
		message = pPlayer.getCivilizationShortDescription(0)
		CyInterface().addImmediateMessage(message,None)
		print(message)
### isenchine end
Note that the display is not always refreshed on time but it can narrow down the problematic player. Then you can see what is about to be produced in its cities.

One thing that is not clear to me: did you change the dll? If not, you might not have access to a debug dll which can be helpful also.
 
isenchine, thank-you. I continue to be impressed with the support within the Civ4 community.

I have not changed the dll. I have not used a a debug.dll

I was using windbg, which is new to me, and came up with this line prior to the crash

Warning: DirectSound playback reset due to non-moving playback cursor (buggy sound driver) time: 4337500 play: 18728 write: 21372.

I am not sure if it has anything to do with the CTD but it is there.

I have not determined why those 5 civs work and none of the others do. I am not even sure logically what that tells me.... if it was just one civ that makes some sense, but more than one?

Again, all help is much appreciated.


I will try amending the civEventManager.
 
A-Ha!

So the pythondbg.log file told me that the last thing it did was a Soviet B-25 was shot down.

I went in and got rid of all B-25s in the game, then the game till crashed but the last line of the pythondbg.log was the player right before the Soveit Union which means it crashed BEFORE the end of the Soviet Union's turn. So the problem is with the Soviet Union Civ. So I then went in and deleted ALL the Soviet Union's units but one cavalry unit, then went Alt-z'd my way back to the original civ where the crashes occurred, and there was no crash. Then, there was a brief bit of singing and dancing about... but back to work.

Which unit is the problem? It must be a unit that activates AFTER a B-25, and I assume a west-most city with one B-25 in it since seems to play from left to right. Or am I incorrect?
 
If it's art (and it's often art the cause of a crash - but not only) you can check if every unit, building, etc has a proper entry in their respective ArtDef file.

For that, see the ArtDef Checker utility in my signature.
 
Thank-you isenchine.

I used the app, it found no missing files. I also used civchecker, it found no problems.

But, by dividing the crashing civs units and narrowing down the potential problems, I found the unit causing the problem. Now, to figure out what about the unit is the issue.
 
Um.. okay, I am confused.

If I take the unit I made out of the savegame, there are no crashes.

If I leave him in, CTD.

I changed the art file, still crashed. I do not see any difference between this guy and any other unit except the name. What else could be causing it? The civunitclass files are not unusual either.
 
For whatever reason, art files could become corrupt. It happened with one unit in the WWII mod of Skyfire. But if you replaced the art, then it's something else. Is the button valid (it should be 64*64)? You do know that a leading comma in the path of the button in the ArtDef file leads to a crash, don't you (except when it refers to an Atlas of buttons)?
 
What unit was it? What was the unit about to do (loading on ship? Trying to path a long walk? Attacking another unit? Etc)
Is it a unit class that you added to the mod?
As isenchine said, a crash like that is usually graphics related one way or another.
 
It seems to be fixed. A heartfelt thanks to you all for guiding me to a solution. I feel really good about what I learned from this adventure. The crash in the mod first popped up a year of so ago and I tried a few times to fix it, but always gave up due to my limited knowledge of troubleshooting CTDs.

But it looks like the problem was in the CIV4UnitClassInfos.xml file. I wanted a unique unit for my civ that I could only have one of.

<UnitClassInfo>
<Type>UNITCLASS_DIPLOMAT</Type>
<Description>TXT_KEY_UNIT_DIPLOMAT</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>1</iMaxPlayerInstances>
<iInstanceCostModifier>0</iInstanceCostModifier>
<DefaultUnit>UNIT_DIPLOMAT</DefaultUnit>
</UnitClassInfo>
Well, you can't do that.

This diplomat character is one I made up and added to the mod. When I went in and changed the settings there in the file, it worked.

So I fixed my busted mod. I learned a lot of new things and have a bit of experience working with Windbg now. And I got my faith in humanity improved due to the kindness and help heaped on me here at the forum. Wonderful stuff. Thank-you.
 
Great! :goodjob:

But I don't get it. The settings you are showing are those before the crash? Because there's nothing wrong with them. My Settlers have the same settings without problems.

Edit: and this Diplomat unit, what is it supposed to do actually, what mission?
 
I will go back and recheck the settings.

IIRC the Diplomat unit originally was part of a mod but it never worked. I went back and tried to find some python code somewhere left over but it was not there, though the old .ini file was still around. It is basically there as a really expensive unit that, if in the capital, triggers some events for fun. All that is done from the Events file and a little python.
 
Back
Top Bottom