dll debug error plz help

keldath

LivE LonG AnD PrOsPeR
Joined
Dec 20, 2005
Messages
7,578
Location
israel
hi all,

im trying to locate a crash in my mod,

i ran debug and this is the error i get:

> CvGameCoreDLL.dll!CvGlobals::getDefineINT(const char * szName=0x0018f540) Line 2817 + 0xf bytes C++

and it points me here.

int CvGlobals::getDefineINT( const char * szName ) const
{
int iReturn = 0;
GC.getDefinesVarSystem()->GetValue( szName, iReturn );
return iReturn;
}


it says something about integer cant devide by zeo.


anyone can save me?
 
It looks like it is trying to use a value it thinks is defined in one of the xxxGlobalDefines.xml files and either the value does not exist or it has a value of 0. This is then being used as the divisor in an arithmetic expression where it is invalid to use 0 as a divisor hence the error.

I would start by looking in any any custom code you have for a GC.getDefineINT("xxx") call that used as a divisor and then checking that the xxx is defined and has a non-zero value.

If you look at the stack trace when you are debugging you may be able to narrow down where the call is being used better.
 
INTERESTING,

i thought it has someting to do with this file.

but i couldn't pinpoint.

what is stack trace?


during loading and sometimes during game, theres a few sdk errors appearing from time to time, i was able to fix some but others - im not so sure.

thank you for the help so far!
:)

**
another thing - sometimes after long runof auto ai i get "waiting for other civs" probably some infinite ai loop? how can i trace those? it wont give any error in the debug, just stuck.
 
The stack trace (or call stack) is in the window at the right of the bottom pane in Visual Studio when you are stepping through the code or are at a break point. It gives a list of the methods, in order, that called the method with the line the run cursor is at.

There is a tutorial by asaf that has some hints on how to use it here

If you go backwards through the methods you should be able to find a location with a division and from there maybe you can identify the which value is the culprit.
 
hello all,

i have a ctd on this pint - this is the debug error - something about advisors.

i have no idea wheres the ctd problem, but if i change in the vs the -1 value to 1, the gamepasses the breaking point.

attachment.php


some1 can help?
 
Was there meant to be some code / error message in your post? You need to show us the method that the error is occurring in, and the specific line of code that throws the error.
 
Are you attaching Visual Studio to the program whilst it is running as described in the asaf tutorial I pointed you to? That should take you to the line of the source code that is causing the problem. The code in your screenshots are warnings rather than errors, and though they probably are related to the root cause are not enough to go on.

If you attach VS to the program then it can take you right to the line that caused the crash.
 
well,
im am doing exactly what asafs guide instrycts, im am attaching the procces, when the error comes up - i press on the debug option then it takes me to vs and asks me to continuie or create break point - so i do create and it marked the code part that causes the crash.

i understand the the 2 first messages are just warnings, but the third one takes me to the crash section i the source file - as i pasted on the first picture it sais something on advisors.

furthir more - in the autos tab - it have 2 options - "this" that is a parant, and a line about advisors or something - that one has a -1 value in it - and as the error sais - e > -1, i guess its related - so i changed the -1 value - withting the vs to 1 value - and the crash didnt happen, it finished the turn.
i cant read the source of the problem, i can get to the break point , sure, but i cant translate what i see there to the xmls - cause the problems lyes somewhere in my xml.
that is what i wish, to understand how to pinpoint the xml file that causes the problem, and maybe even the line.

:)
 
When VS takes you to the crashing code, yuo can do two things:
1. Check the values of the variables (e.g. szName) - either hover over them or open Locals or Auto windows.
2. Open the callstack window - select all in it (Ctrl+A), copy and paste it here.

Both of these should give you (and us) a lot of information to work with.
 
WELL here it is:

> CvGameCoreDLL.dll!CvPlayer::canTrain(UnitTypes eUnit=31, bool bContinue=false, bool bTestVisible=false, bool bIgnoreCost=false) Line 6110 + 0x55 bytes C++
CvGameCoreDLL.dll!CvCity::canTrain(UnitTypes eUnit=31, bool bContinue=false, bool bTestVisible=false, bool bIgnoreCost=false, bool bIgnoreUpgrades=false) Line 1878 + 0x28 bytes C++
CvGameCoreDLL.dll!CvPlayerAI::AI_updateGoldToUpgradeAllUnits() Line 21280 + 0x1a bytes C++
CvGameCoreDLL.dll!CvPlayerAI::updateCacheData() Line 343 C++
CvGameCoreDLL.dll!CvPlayer::setTurnActive(bool bNewValue=true, bool bDoTurn=true) Line 10982 C++
CvGameCoreDLL.dll!CvPlayer::setTurnActive(bool bNewValue=false, bool bDoTurn=true) Line 11146 C++
CvGameCoreDLL.dll!CvPlayer::setAutoMoves(bool bNewValue=false) Line 11300 C++
CvGameCoreDLL.dll!CvGame::updateMoves() Line 7323 C++
CvGameCoreDLL.dll!CvGame::update() Line 2196 C++
Civ4BeyondSword.exe!00415321()
[Frames below may be incorrect and/or missing, no symbols loaded for Civ4BeyondSword.exe]
KernelBase.dll!756faf21()
Civ4BeyondSword.exe!006846f7()
Civ4BeyondSword.exe!00411a7d()
Civ4BeyondSword.exe!00686bc8()
Civ4BeyondSword.exe!004d6f46()
Civ4BeyondSword.exe!008f497f()
kernel32.dll!76e433aa()
ntdll.dll!779a9ef2()
ntdll.dll!779a9ec5()
Civ4BeyondSword.exe!00790074()
Civ4BeyondSword.exe!00790074()
Civ4BeyondSword.exe!0078006f()
Civ4BeyondSword.exe!0078006f()
Civ4BeyondSword.exe!0078006f()
Civ4BeyondSword.exe!0078006f()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0069006c()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0075006c()
Civ4BeyondSword.exe!0075006c()
Civ4BeyondSword.exe!0075006c()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0073005f()
Civ4BeyondSword.exe!0073005f()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064002e()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0064006e()
Civ4BeyondSword.exe!0064006e()

tried to read what i can - unit 31 -is an axeman...thats all i can understand :(
 
and the crash cause:

> CvGameCoreDLL.dll!CvGlobals::getAdvisorInfo(AdvisorTypes e=-1) Line 884 + 0x36 bytes C++
CvGameCoreDLL.dll!CvDLLButtonPopup::launchProductionPopup(CvPopup * pPopup=0x56f86d48, CvPopupInfo & info={...}) Line 1165 + 0x27 bytes C++
CvGameCoreDLL.dll!CvDLLButtonPopup::launchButtonPopup(CvPopup * pPopup=0x56f86d48, CvPopupInfo & info={...}) Line 896 + 0x10 bytes C++
Civ4BeyondSword.exe!00550f43()
[Frames below may be incorrect and/or missing, no symbols loaded for Civ4BeyondSword.exe]
Civ4BeyondSword.exe!00508580()
Civ4BeyondSword.exe!00a3fd0b()
Civ4BeyondSword.exe!004d6f46()
Civ4BeyondSword.exe!008f497f()
kernel32.dll!76e433aa()
ntdll.dll!779a9ef2()
ntdll.dll!779a9ec5()
Civ4BeyondSword.exe!00790074()
Civ4BeyondSword.exe!00790074()


with this: at the locals.

bIgnoreAlways false bool
+ this 0x04f756b0 class CvGlobals gGlobals {m_bGraphicsInitialized=true m_bDLLProfiler=false m_bLogging=true ...} CvGlobals * const
e -1 AdvisorTypes
 
hey platy,

well i thought about it - and i was looking in the unitinfo - i saw some "none" on advisors - but they where only animals i think.

but it might be something like that - when i change the value via vs from -1 to 1, the game passes the crash point - and the first think i get - is a pop up of a city finished building something.

mmm wait, when i come to think of it - buildings have assigned advisors to them also right? maybe i have something missing there , ill take a look.

if any of you can still help before i get home :) that would be cool.
 
Back
Top Bottom