Author Topic: Crashes on doubleclicking  (Read 693 times)

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
Crashes on doubleclicking
« on: March 04, 2005, 02:09:44 pm »
Hi,

For \"testing\" purposes, I have been doubleclicking on my \"avatar\".
I am compiling a modified version of PS.

It crashes.

Looking at the bt this is what I can determine:

  msvcr71d.dll!_NMSG_WRITE(int rterrnum=10)  Line 195 C
   msvcr71d.dll!abort()  Line 44 + 0x7 C
   msvcr71d.dll!_assert(const char * expr=0x0070eba8, const char * filename=0x0070ebb4, unsigned int lineno=559)  Line 306 C
>  psclient.exe!csArray,csArrayMemoryAllocator >::Get(unsigned int n=2)  Line 559 + 0x1f    C++
     psclient.exe!csArray,csArrayMemoryAllocator >::operator[](unsigned int n=2)  Line 585    C++
     psclient.exe!psEntityTypes::BuildDfltBehaviors()  Line 122 + 0x28   C++
     psclient.exe!psMainWidget::OnMouseDown(int button=1, int keyModifier=0, int x=502, int y=439)  Line 250 + 0x26  C++
     psclient.exe!PawsManager::HandleMouseDown(iEvent & event={...})  Line 279 + 0x27    C++
     psclient.exe!PawsManager::HandleEvent(iEvent & event={...})  Line 213 + 0xc C++
     psclient.exe!psEngine::HandleEvent(iEvent & ev={...})  Line 606 + 0x12  C++
     psclient.exe!psEngine::EventHandler::HandleEvent(iEvent & ev={...})  Line 209   C++
     psclient.exe!csEventQueue::Dispatch(iEvent & e={...})  Line 250 + 0x26  C++
     psclient.exe!csEventQueue::Process()  Line 233  C++
     psclient.exe!csDefaultRunLoop(iObjectRegistry * r=0x00b166c8)  Line 82  C++
     psclient.exe!main(int argc=1, char * * argv=0x00b14cb0)  Line 1881 + 0x9    C++
     psclient.exe!mainCRTStartup()  Line 398 + 0x11  C
   KERNEL32.DLL!7c59893d()    


In psmainwidget

it is here ->
csString psEntityTypes::BuildDfltBehaviors()
{
    csString dflt;
    for (size_t i=0; i < types.Length(); i++)
    {
        if (i > 0)
            dflt += \"|\";
        dflt += types->commands[types->usedCommand];
    }
    return dflt;
}


more exactly this line -> dflt += types->commands[types->usedCommand];

i is equal to 0


Then, if we go further, i go to array.h

 /// Get an element (non-const).
  T& Get (size_t n)
  {
    CS_ASSERT (n < count);
    return root[n];
  }

CS_ASSERT is the point.
n = 2 and count = 2.
There it crashes.

Would it be like that also in a debug version of PS or have I introduced some problem somewhere?

Ary
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess

AryHann

  • Veteran
  • *
  • Posts: 1244
  • WonderWoman
    • View Profile
(No subject)
« Reply #1 on: March 07, 2005, 09:05:41 am »
I got a suspect, and I check it:
in entityinter.xml the value of one of the default commands was \"wrong\", or better, it was higher than the lenght of the array of the possible commands.

Changing that made it good.

Btw, I really don\'t understand why it is necessary to build all the types behaviour. Wouldn\'t it be enough to build just the default behaviour of the type that is necessary to check?

Ary
PS: are the modifications concerning \"entityinter\" (of this weekend) really relevant for avoiding bugs?
« Last Edit: March 07, 2005, 09:27:57 am by AryHann »
AryHann

http://www.reflex.lth.se/culture/annelov - Virtual Annelöv -
Engine Dep. - One of Talad's Angels - Aka ww & Ahrijani's Goddess