weird bug

Put your bugs you find in osRose here

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

weird bug

Postby hoegarden31 on Sun Apr 01, 2012 9:30 pm

Hello, today i've a really weird bug. The worldserver craches on this code :

  1. // Send a packet to this client
  2. void CClientSocket::SendPacket( CPacket *P )
  3. {
  4.     // :WARNING: IF WE ADD A CRYPT FUNCTION HERE WE MUST COPY THE
  5.     //             PACKET AND NOT USE THE ORIGINAL, IT WILL FUCK UP
  6.     //             THE SENDTOALL FUNCTIONS
  7.  
  8.     //LMA: Stupid check.
  9.     if(this==NULL)
  10.     {
  11.         Log(MSG_WARNING,"Trying to SendPacket with NULL Socket (trapped).");
  12.         return;
  13.     }


I don't know what it do, but in the logs, all i see is the warning, and then i've a nice window with 'worldserver crashed' ...
What happened ?
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: weird bug

Postby PurpleYouko on Mon Apr 02, 2012 2:20 pm

That piece of code traps an error and returns code operation to the parent function without doing anything at all.

You need to trace it back to find out where that code is being called from. Obviously something that comes immediately after this function call is crashing due to an "untrapped" NULL socket error.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: weird bug

Postby hoegarden31 on Mon Apr 09, 2012 2:03 am

Problem is that there are 100 lines of code who call this function. So i don't know where to start. Can't i just make it so that when it's null, adding a piece of code so that whatever comes after don't crash ?
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: weird bug

Postby PurpleYouko on Mon Apr 09, 2012 1:54 pm

That's exactly what that bit of code is there for.
It detects a NULL packet prevents the server from attempting to send it.
Code is then returned to the place that called the sendpacket function and promptly crashes right there immediately after the function call.
It's not possible to do anything in the function that will prevent the NULL packet causing a crash elsewhere.

Have you tried running the server in debug mode to find the actual line that crashes?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 7 guests