v 25, Bugs/Crashes reporting thread

Status
Not open for further replies.
@DH: ouch... if it were me, i'd be trying to run a debug dll on load to see where its having problems specifically... might lead to finding a fix. I realize though that you probably don't have a debug dll so I'm not sure how I'd approach it from your system.

No, I have not set up C++ yet. I am having enough problems setting up everything else.:)
 
You know... if its crashing, you'd have a minidump you could post (even on load I believe.) That could help us figure out the problem if its simple enough even if we don't fully 'get' the caching mechanism.
 
Would setting the Tribal Guardian's movement rate to .1 or even .01 (or less) prevent him from moving without causing the divide by 0?

I don't think you can... its an integer setting that would round out to 1 or be ignored completely if you tried... could possibly even cause a bug.
 
What are the Civics that give Fixed Borders? The pedia says Despotism, Monarchy, Federal, Communist, Fascist, Vassalage, Parliament, President, Nationalist, Planned, Corporatist, and State Church.
But there is no more Communist, and Federal, President, Nationalist, Planned, Corporatist and State Church do not have Fixed borders.
 
Is there some particular reason the Tribal Guardian guy is not set to be DOMAIN_IMMOBILE? Units set to have this domain are, by definition, immobile. You can set their movement to 1 and they won't go anywhere.
 
Is there some particular reason the Tribal Guardian guy is not set to be DOMAIN_IMMOBILE? Units set to have this domain are, by definition, immobile. You can set their movement to 1 and they won't go anywhere.

Probably because I was in a hurry and did not know about that solution.

Edit Someone else is going to need to do it. I still cant get C2C to run :(
 
@Koshling/AIAndy: Two questions about debugging this.

1. How do you make a breakpoint conditional upon being on a specific unit?
Add the breakpoint, then right click on it and add a condition.

2. What function in the Property code controls the property quantities created by Promotions?
The property solver gathers all active property manipulators by looping over all game objects and then checking all potential property manipulators on that game object. That last part is done in CvGameObject.cpp, for promotions in CvGameObjectUnit::foreachManipulator.
After that all manipulators are treated the same so if the manipulator on the promotion is gathered, it will work.
 
Is there some particular reason the Tribal Guardian guy is not set to be DOMAIN_IMMOBILE? Units set to have this domain are, by definition, immobile. You can set their movement to 1 and they won't go anywhere.

Wait, such a thing exists? I should probably change that, thanks.:goodjob: Although it would make sense to also change the DLL to also avoid any chance of dividing by 0 there.
 
@Koshling:

I was playing along fine when all of the sudden the game crashed. This is more interesting though because when I read the minidump, the error was integer division by 0 in this equation

Code:
int iMoves = (iRouteCost*stepDistance(iFromX, iFromY, iToX, iToY) + iMin - 1)/iMin;
(line 2604 of the CvGameCoreUtils)

I would bet much money that iMin is being returned as 0. My question is, what is necessary to apply a sticky-tape bandage to this? This code has been there for many versions, and this is the first crash I've seen involving it. The previous functions were part of your pathing engine (CvPathGenerator), but I suspect that making it check somewhere to make sure that iMin isn't 0 would fix things.

Edit: Here is what I get in the debug window after loading the minidump.

Edit2: Could this have anything to do with the Tribal Guardian? It has 0 moves, and some have reported crashes with it. This was during the AI's turn though, so I wasn't clicking on it or anything.

Edit3: Would this be a good fix?
PHP:
                    int iMoves = 0;
					if (iMin != 0)
					{
						iMoves = (iRouteCost*stepDistance(iFromX, iFromY, iToX, iToY) + iMin - 1)/iMin;
					}
					else 
					{
						iMoves = 0;
					}

I know that it would solve the crash, but would it mess up anything else?

Edit4: No, that would cause a crash later on in the code. Would checking for maxMoves being 0 and if so leaving the case loop work, or would that cause a WfOC? The function if you are wondering is NewPathHeuristicFunc().

I'd need to kow more abou the context it happens in to be certain, but I think your proposed solution I'd fine EXCEPT that instead of returning 0 when the divisor is 0 you should return MAX_INT most likely to get sensible behavior.

To breakpoint a specific unit you would have to kow why it's unit id is. This is displayed (if you have chipotle enabled) by shift hover (or maybe ctrl hover, I can't remember), or if you know it from having crashed and being in the debugger at a point later in the process that's fine too. Anyway, once you k ow the unit id just set the breakpoint on m_iId being equal to that value.
 
I'd need to kow more abou the context it happens in to be certain, but I think your proposed solution I'd fine EXCEPT that instead of returning 0 when the divisor is 0 you should return MAX_INT most likely to get sensible behavior.

To breakpoint a specific unit you would have to kow why it's unit id is. This is displayed (if you have chipotle enabled) by shift hover (or maybe ctrl hover, I can't remember), or if you know it from having crashed and being in the debugger at a point later in the process that's fine too. Anyway, once you k ow the unit id just set the breakpoint on m_iId being equal to that value.

1. Regarding the divide-by-0 error yes, that makes sense, I'll do that.

2. Cool thanks, now I'll be able to see whether or not there is a calculation error with Properties or a display error with them (see JosEPh's posts about the Policing promotion for background on that).
 
Thanks for the minidump DH! I'll take a look at that later today when I have some time to work on things.

Wow... now that is some interesting stuff about breaking on a particular unit... I almost want to try it out just to go through the motions and see it work! Neat!

Max int? Isn't that an absolutely huge 6-7 digit number? I'm not following that numerical logic very well. Wouldn't it be closer to the intention of dividing by 0 to run the division but establish the divisor as 1? I don't doubt that you're right... just don't get how that works.

The AI selection mentioned is a good fix, yes, but what bothers me is... well let's put it this way, this has let me know I'm going to be creating bugs I didn't know I was going to be creating ;)... So without finding every situation where we have a divide by 0 if a unit has a 0 move and the ai figures it should be moved, I need to prepare to run across this problem. So, if you want to only temporarily change a unit's AI to immobile and then, when the condition is removed, allow it to revert back to its original, is there a standard method for establishing and retracting such a temporary ai change?
 
Thanks for the minidump DH! I'll take a look at that later today when I have some time to work on things.

Wow... now that is some interesting stuff about breaking on a particular unit... I almost want to try it out just to go through the motions and see it work! Neat!

Max int? Isn't that an absolutely huge 6-7 digit number? I'm not following that numerical logic very well. Wouldn't it be closer to the intention of dividing by 0 to run the division but establish the divisor as 1? I don't doubt that you're right... just don't get how that works.

The AI selection mentioned is a good fix, yes, but what bothers me is... well let's put it this way, this has let me know I'm going to be creating bugs I didn't know I was going to be creating ;)... So without finding every situation where we have a divide by 0 if a unit has a 0 move and the ai figures it should be moved, I need to prepare to run across this problem. So, if you want to only temporarily change a unit's AI to immobile and then, when the condition is removed, allow it to revert back to its original, is there a standard method for establishing and retracting such a temporary ai change?

iMoves is supposed to be the number of turns it will take the unit to get somewhere if I understand it correctly, so setting it to MAX_INT would work. I changed the TG to DOMAIN_IMMOBILE to stop that particular crash, but I'm going to harden the DLL against any other instances where this might occur.
 
SVN starts but get this error:
Tag:DOMAIN_IMMOBILE in Info class was incorrect
Current XML file is:
modules\ls612\NormalUnit\EarlyUnits_CIV4UnitInfos.xml

Also, Joan of Arc is still bugged. She just floats across the map with no animation and when I click on her, there are no icons displaying for her to do anything.
 
SVN starts but get this error:
Tag:DOMAIN_IMMOBILE in Info class was incorrect
Current XML file is:
modules\ls612\NormalUnit\EarlyUnits_CIV4UnitInfos.xml

Also, Joan of Arc is still bugged. She just floats across the map with no animation and when I click on her, there are no icons displaying for her to do anything.

Sorry, fixed now.
 
Whom ever changed the MainInterface on the cost, pls change it back to HALF of what it is not, it gets i the way on ALL advisors.
(pic 1)

Invisible units are still showing up when nothing is around?? (pic 2)


On a good note, i am glad to see a Barbarian unit in the Ren Era just pop out of no where, nice!!!! (pic 3)
 
Whom ever changed the MainInterface on the cost, pls change it back to HALF of what it is not, it gets i the way on ALL advisors.
(pic 1)

Invisible units are still showing up when nothing is around?? (pic 2)


On a good note, i am glad to see a Barbarian unit in the Ren Era just pop out of no where, nice!!!! (pic 3)

In regard to picture 2, you have visibility from every tile you own, so this is probably correct.
 
Status
Not open for further replies.
Back
Top Bottom