FAQ  •  Register  •  Login

TNL crash

<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Fri Oct 15, 2010 8:36 pm

TNL crash

Hi,

Running 013b on openSUSE 11.2 x86_64. A segmentation fault occurs when trying to host a game, every time. Running the binary through gdb it says this:

  Code:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004082f2 in TNL::StringTableEntry::getString (this=0x2000e293b8)
    at ../tnl/tnlNetStringTable.h:178
178           return StringTable::getString(mIndex);


I am not too good with C++, so I don't know how to diagnose this. Any pointers?
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Oct 16, 2010 1:50 am

Re: TNL crash

Ah, that's not good.

In gdb, you can do a stack trace with "bt"; that would be helpful. Also, you can print the values of various variables with "print", so if you see any interesting things, try printing them. In this case, I'd try "print mIndex". There may be interesting things in the frames above.

You can move the current frame up and down using the "up" and "down" commands (I think). That would put variables on different levels of the stack trace in scope.

It's a bit late tonight, but I'll try this in Ubuntu tomorrow and see if I can reproduce there. This has been on my list since you mentioned it before, but I am trying to finish up another chunk of functionality.

So much to do...

Hey, and thanks for posting, and welcome to the community!
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Oct 16, 2010 2:08 am

Re: TNL crash

I found the problem:

  Code:
return mLevelInfos[mLevelLoadIndex - 1].levelName.getString();


when mLevelLoadIndex is 0

Now to the question about why this doesn't cause problems on Windows...
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Oct 16, 2010 12:57 pm

Re: TNL crash

I'm still trying to understand the problem, but replacing this:

  Code:
string ServerGame::getLastLevelLoadName()
{
   if(getLevelNameCount() == 0)     // Could happen if there are no valid levels specified wtih -levels param, for example
      return "";
   else
      return mLevelInfos[mLevelLoadIndex - 1].levelName.getString();
}


with this:

  Code:
string ServerGame::getLastLevelLoadName()
{
   if(getLevelNameCount() == 0)     // Could happen if there are no valid levels specified wtih -levels param, for example
      return "";
   else if(mLevelLoadIndex == 0)
      return "";
   else
      return mLevelInfos[mLevelLoadIndex - 1].levelName.getString();
}


in game.cpp will fix the problem.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Oct 16, 2010 1:19 pm

Re: TNL crash

I've updated SVN for 013b and 013c with this fix. If you update your code, you should not encounter this again.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Sat Oct 16, 2010 10:35 pm

Re: TNL crash

I've updated SVN for 013b and 013c with this fix. If you update your code, you should not encounter this again.


Thanks!

I've updated my packages and they are awaiting approval to be included in the official games repo for openSUSE. I'll let you know if/when it's there.

D
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sun Oct 17, 2010 10:07 pm

Re: TNL crash

Excellent!

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 11 guests

cron