The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: firechief | Created: 2017-09-12 14:12:29
Subject: Getting a strange crash in Mouse
I'm not sure if what the debugger's telling me is true or not. The crash is reported at line 94 in TeamInfo.cpp. The only potential problem I can see there is if m_items.size() isn't returning the correct value, leading to access outside the bounds of the array on line 94.

But that's just a guess ... its possible the debugger's lying to me, and maybe its not even mouse causing the crash. All I know is that I get about 10 laps in before it segfaults.
Last Edited: 2017-09-12 14:12:29 by firechief
    Author: timfoden | Created: 2017-09-12 14:58:43
    Subject: Re: Getting a strange crash in Mouse
    Damn Mouse isn't having a good time of it for this race... quite a lot of new code though, I guess.

    Looking at the code, its a new function for this race, and I think it does have a bug.

    I believe that this line:

    if( IsTeamMate(m_items[i]->pCar, pCar) )

    Should read:

    if( m_items[i] && IsTeamMate(m_items[i]->pCar, pCar) )

    Give that a go and see if it helps.

    Cheers, Tim.
    Last Edited: 2017-09-12 14:58:43 by timfoden
      Author: firechief | Created: 2017-09-12 15:03:20
      Subject: Re: Getting a strange crash in Mouse
      Thanks, will give it a try - I assume the same change is necessary in Tiger as well.

      Edit: 57 laps in, and no crash!

      PS: Well, plenty of crashes, but none of the segfault variety ;)
      Last Edited: 2017-09-12 15:54:26 by firechief
        Author: timfoden | Created: 2017-09-12 16:24:26
        Subject: Re: Getting a strange crash in Mouse
        > change is necessary in Tiger

        Yes it is.

        > Edit: 57 laps in, and no crash!

        Good!

        > PS: Well, plenty of crashes...

        Haha. I guess this was to be expected :)
        Last Edited: 2017-09-12 16:24:26 by timfoden