GetPlayerNetworkStats() crash the server
#1

I'm an owner of a large project with few servers.
Every one or two days one of our servers crashed for inexplicable reason.
I'm had installed creshdetect plugin, this detects that crash is caused by GetPlayerNetworkStats() function.

Server version: 0.3x-R2-1000p patch 1

In server.log before crash:
Код HTML:
[19/01/2014 17:54:41] [debug] Server crashed while executing rp.amx
[19/01/2014 17:54:41] [debug] AMX backtrace:
[19/01/2014 17:54:41] [debug] #0 native GetPlayerNetworkStats () [080d0e70] from samp03svr
[19/01/2014 17:54:41] [debug] #1 000b3dd0 in public Timer1 () from rp.amx
[19/01/2014 17:54:41] [debug] Native backtrace:
[19/01/2014 17:54:41] [debug] #0 f6b2d31b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #1 f6b277c2 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #2 f6b283ac in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #3 f6b28856 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #4 f6b2cf6c in ?? () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #5 f7721410 in ?? ()
[19/01/2014 17:54:41] [debug] #6 08082a26 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #7 0807e4bc in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #8 0806fde9 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #9 080d0ee3 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #10 08093e44 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #11 f6b2503c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #12 f6b2b458 in ?? () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #13 f6b2fc61 in amx_Exec () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #14 f6b27708 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #15 f6b2b1c9 in ?? () from plugins/crashdetect.so
[19/01/2014 17:54:41] [debug] #16 080dc405 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #17 080b5efb in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #18 080b16d3 in ?? () from samp03svr
[19/01/2014 17:54:41] [debug] #19 f747ee46 in __libc_start_main () from /lib32/libc.so.6
[19/01/2014 17:54:41] [debug] #20 0804b521 in ?? () from samp03svr
Pawn code:

PHP код:
public Timer1() //every second timer
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {    
                  new 
dest[512],dest2[128];
                      
GetPlayerNetworkStats(i,dest,sizeof(dest));
                  new 
= (strfind(dest,"Bytes received: ",true) + 16);
                  
strmid(dest2,dest,f,strfind(dest,"Acks rece",true,f));
                  new 
bytes strval(dest2);
                  if(
bytes > (LastBytes[i]+20000)) WarningBytes[i]++;
                  if(
WarningBytes[i] > 3)
            {
                           
printf("[Attack 2] Player %d",i);
                
Kick(i);
                                             continue;
            }
            
LastBytes[i] = bytes;
                        }
      }

When I remove this code server had not crashed.

P.S. Sorry for my bad English.
Reply


Messages In This Thread
GetPlayerNetworkStats() crash the server - by RingoRus - 22.01.2014, 16:45
Re: GetPlayerNetworkStats() crash the server - by Cypen - 24.01.2014, 15:06
Re: GetPlayerNetworkStats() crash the server - by Emmet_ - 24.01.2014, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)