Announcement

Collapse
No announcement yet.

DEBUG: Protra's special units crash (rev689)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DEBUG: Protra's special units crash (rev689)

    DEBUG.exe isn't giving me the pop-up
    but civ3log worked and this is what it said:
    Code:
       ArmyData.cpp@6258: Army 0xd000000a Executing order 24 @ (11,77), turn=0
       SlicFunc.cpp@542 : Slic_Text: A {player[0].civ_name_singular} {unitrecord[0].name} has established an embassy with us in our city of {city[0].name}.
       SlicFunc.cpp@542 : Slic_Text: Our {unitrecord[0].name} has established a new embassy in the {player[0].civ_name_singular} city of {city[0].name}.
        ObjPool.cpp@102 : ObjPool: Inserting object id c0000001
        SelItem.cpp@1491: POS 10 77 : DROP
        SelItem.cpp@1492:  ai 10 87
        SelItem.cpp@1493:  xy 0 77
        SelItem.cpp@1494: zoc 0x2, owner 1
        SelItem.cpp@1495: 
      civ3_main.cpp@1447: Exception: 'Access Violation' thrown.
      civ3_main.cpp@1449: Exception Stack Trace:
      0x004ab729  [public: unsigned int __thiscall Director::ProcessActiveEffects(void) + 0x89]
      0x004a770a  [public: void __thiscall Director::Process(void) + 0x3a]
      0x0046e3cf  [public: int __thiscall CivApp::ProcessUI(unsigned int,unsigned int &) + 0x22f]
      0x0046e90e  [public: int __thiscall CivApp::Process(void) + 0xce]
      0x00462ca8  [int __stdcall CivMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int) + 0x3c8]
      0x00462291  [WinMain@16 + 0x81]
      0x00b8c3f3  [WinMainCRTStartup + 0x1b3]
      0x7c816fd7  [\177zlib1_NULL_THUNK_DATA + 0x7b5ae807]
    
        c3debug.cpp@320 : Assertion (errcode == AUI_ERRCODE_OK) Failed in File:C:\Documents and Settings\e\My Documents\svncode\trunk\ctp2_code\ui\aui_common\aui_mouse.cpp, Line:850
        c3debug.cpp@321 : Stack Trace: '  0x004587a0  [char * __cdecl c3debug_StackTrace(void) + 0x20]
      0x00453211  [void __cdecl c3debug_Assert(char const *,char const *,int) + 0x61]
      0x00898da2  [public: virtual enum AUI_ERRCODE __thiscall aui_Mouse::ReactToInput(void) + 0x1d2]
      0x008e5fa7  [public: virtual enum AUI_ERRCODE __thiscall aui_DirectMouse::ReactToInput(void) + 0x17]
      0x00898771  [unsigned long __stdcall MouseThreadProc(void *) + 0x71]
      0x7c80b683  [\177zlib1_NULL_THUNK_DATA + 0x7b5a2eb3]

    I did hit debug when it tried to get me to send the error message to microsoft (not much good that would do... is there a way to direct it to us?)

    but MSVC took me to spritesys\director.cpp (line in bold):

    Code:
    uint32 Director::ProcessActiveEffects(void)
    {
    	ListPos			actorPos;
    	EffectActor	*   actor;
    
    	if (m_activeEffectList->IsEmpty()) return 0;
    
    	m_processingActiveEffects = TRUE;
    
    	ListPos         pos = m_activeEffectList->GetHeadPosition();
    	for (size_t i = m_activeEffectList->L(); i > 0; --i) 
        {
    		actorPos = pos;
    
    		actor = m_activeEffectList->GetNext(pos);
    		if (actor) {
    		[b]	actor->Process(); [/b]
    		}
    	}
    
    	m_processingActiveEffects = FALSE;
    
    	pos = m_activeEffectList->GetHeadPosition();
    	for (size_t n = m_activeEffectList->L(); n > 0; --n) 
        {
    		actorPos = pos;
    
    		actor = m_activeEffectList->GetNext(pos);
    		if (actor && actor->GetKillNow()) {
    			m_activeEffectList->DeleteAt(actorPos);
    			delete actor;
    		}
    	}
    
    	return 0;
    }
    the method it points to is:
    Code:
    void Director::Process(void)
    {
    	UpdateTimingClock();
    
    	static uint32 nextTime = 0;
    
    	if (GetTickCount() > nextTime) {
    		
    		
    		
    		
    		HandleNextAction();
    
    		
    
    		ProcessActiveUnits();
    		ProcessActiveEffects();
    
    		ProcessTradeRouteAnimations();
    		if(g_tiledMap)
    			g_tiledMap->ProcessLayerSprites(g_tiledMap->GetMapViewRect(), 0);
    
    		nextTime = GetTickCount() + 75;	
    	}
    }

    ...and I'm not sure what the problem is
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    Originally posted by E
    ...and I'm not sure what the problem is
    It is not the Process method, but it is rather the Actor-pointer. It is not the NULL-pointer. It points to some place in memory, but there is no valid object.

    But actually this isn't the root of the problem, either. The GetNext method returns that invalid Actor-pointer, because it is saved in m_activeEffectList. But the refference is still invalid, maybe someone deleted the actual Actor-object without doing it properly, or without modifying m_activeEffectList.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #3
      Just wondering E is there any changes that could be made in the userprofle that would halt the bug.Debug slic yes or no has made no differance.
      If not im playing a older version for now.Have to computors and both have CTP2 on them.

      Comment


      • #4
        i think its in the code, not in the userprofile. so for now rev689 is broken when it comes to special units. Are you playing 663b? and they work in that one?

        that will help us narrow down when the error was made


        edit
        @ Martin:
        revision 688

        Some BOOL to bool replacements and added IsOnSameContinent method:
        modified trunk/ctp2_code/gs/world/wldgen.cpp
        modified trunk/ctp2_code/gs/world/World.h
        modified trunk/ctp2_code/gs/world/WrldCont.cpp
        modified trunk/ctp2_code/robot/pathing/unitastar.cpp
        modified trunk/ctp2_code/gfx/spritesys/director.cpp

        Martin do you think changing the bools might have done it? I'll test tomorrow if you don't comment on it.
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment


        • #5
          Well I relaod CtP2 again with the three files for the playtest.Then loaded build 663b.Had the same crash when I used the diplomat unit to make a embassy.
          I cant recall any of the other builds in the past doing this. So it seems its not build 689 only.

          Comment


          • #6
            Again I made a fresh install og CTP2 with just the Playtest and this time there was no problems using the diplomat.So it seems its a problem with the build.

            Comment


            • #7
              Originally posted by E
              Martin do you think changing the bools might have done it? I'll test tomorrow if you don't comment on it.
              Why do you think that changing one line that only changes a BOOL to a bool is a problem? Actually you should look at the changes first. Use TortoiseMerge for that.

              And why do you think that the problem is located in director.cpp if m_activeEffectList->GetNext(pos); returns a pointer on a memory address that does not contain a valid object? The conclusion is that the problem is inside of GetNext or even further in object class of GetNext.

              Well for now you can go back to some revision earlier and figure out which one is affected.

              -Martin
              Civ2 military advisor: "No complaints, Sir!"

              Comment


              • #8
                Originally posted by Protra3211
                Again I made a fresh install og CTP2 with just the Playtest and this time there was no problems using the diplomat.So it seems its a problem with the build.

                Thanks Protra that narrows it down to atleast to september 9th, 2006.


                still poking around... maybe here was the change...


                Originally posted by Fromafar
                Revision 636 Memory leak repaired, ProjectileActor (undefined class) references removed.

                Modified: ctp2_code\ctp\civctp.dsp
                Added: ctp2_code\gfx\spritesys\DirectorActions.cpp
                Modified: ctp2_code\gfx\spritesys\director.cpp
                Modified: ctp2_code\gfx\spritesys\directoractions.h
                or here

                Originally posted by Fromafar
                Revision 660

                Converted BOOL to bool, added const, corrected includes, and other minor clean-ups.
                Modified: ctp2_code\gfx\gfx_utils\Queue.h
                Modified: ctp2_code\gfx\spritesys\Actor.cpp
                Modified: ctp2_code\gfx\spritesys\Actor.h
                Modified: ctp2_code\gfx\spritesys\EffectActor.cpp
                Modified: ctp2_code\gfx\spritesys\GoodActor.h
                Modified: ctp2_code\gfx\spritesys\SpriteFile.h
                Modified: ctp2_code\gfx\spritesys\UnitActor.cpp
                Modified: ctp2_code\gfx\spritesys\battleviewactor.cpp
                Modified: ctp2_code\gfx\spritesys\battleviewactor.h
                Modified: ctp2_code\gfx\spritesys\goodactor.cpp
                Modified: ctp2_code\gfx\spritesys\spritefile.cpp
                Modified: ctp2_code\gfx\spritesys\workeractor.cpp
                Modified: ctp2_code\gfx\spritesys\workeractor.h
                Modified: ctp2_code\gfx\tilesys\tiledmap.cpp
                Modified: ctp2_code\gfx\tilesys\tiledmap.h
                Last edited by Ekmek; February 26, 2007, 18:31.
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • #9
                  Well its between 635 and 646.

                  I reverted to 635 and no problem, jumped ahead to 646 becaus ethere are so many compiler problems and got the crash. I then went bck to 636 and had to do asing revert on unitcontrolpanel to 646 and test it.

                  It crashed. So 636 is the problem. Now I don't what to do about it. It might be the projectile actor removal. I see that civctp.dsp was modified amd i have had no luck trying to get MSVC6.0 to recognize my religion cdb so I dont think I can undo the changes in rev 636. not sure what to do next.
                  Last edited by Ekmek; February 28, 2007, 13:38.
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #10
                    Re: DEBUG: Protra's special units crash (rev689)

                    Originally posted by E
                    Code:
                    c3debug.cpp@320 : Assertion (errcode == AUI_ERRCODE_OK) Failed in ... aui_mouse.cpp
                    Maybe the problem is in your mouse. I think the tachyon modulation must be wrongly polarised .

                    The crash doesn't occur with my local test version, but this version has some changes that have not been committed yet. I would guess that the memory leak repair is not working correctly without additional changes to (copy) constructors.

                    Comment

                    Working...
                    X