[Plugin] CrashDetect

Show the PingKick function to us.
Reply

pawn Код:
public PingKick()
{
    if(ServerInfo[MaxPing] != 0)
    {
        PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;

        for(new i=0; i<MAX_PLAYERS; i++)
        {
            Informacion[i][pPing][PingPos] = GetPlayerPing(i);

            if(GetPlayerPing(i) > ServerInfo[MaxPing])
            {
                if(Informacion[i][PingCount] == 0) Informacion[i][PingTime] = TimeStampxd();

                Informacion[i][PingCount]++;
                if(TimeStampxd() - Informacion[i][PingTime] > PING_TIMELIMIT)
                {
                    Informacion[i][PingTime] = TimeStampxd();
                    Informacion[i][PingCount] = 1;
                }
                else if(Informacion[i][PingCount] >= PING_MAX_EXCEEDS)
                {
                    new Sum, x, string[128];
                    while (x < PING_MAX_EXCEEDS) {
                        Sum += Informacion[i][pPing][x];
                        x++;
                    }
                    format(string,sizeof(string),"-Fantasilandia- kickeo a %s por exeder el ping maximo de %d de ping.", PlayerName2(i), ServerInfo[MaxPing] );
                    SendClientMessageToAll(red,string);
                    TogglePlayerControllable(i,false);
                    TextDrawShowForPlayer(i, FondoNegro);

                    new wea[500];
                    new PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(i, PlayerName, MAX_PLAYER_NAME);
                    new year,month,day; getdate(year, month, day);
                    new hour,minute,second; gettime(hour,minute,second);

                    format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\
                    \n\n{FFFFFF}Admin: Fantasilandia\
                    \n{FFFFFF}Razon: Tienes %d de ping y lo maximo es %d.\
                    \n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\
                    \n\n{FFFFFF}* Porfavor cancela las descargas y vuelve a entrar."
,PlayerName,GetPlayerPing(i),ServerInfo[MaxPing], day,month,year, hour, minute, second);
                    ShowPlayerDialog(i, 8000, DIALOG_STYLE_MSGBOX, " *          ", wea, "OK", "");

                    for(new p = 0; p < MAX_PLAYERS; p++) {
                    if(IsPlayerConnected(p)) {
                    PlayerPlaySound(p,1140,0.0,0.0,0.0);}}
                    Kick(i);
                }
            }
        }
    }
Reply

Compile your script with -d3 flag (see the first post for how) and it will show you exact location i.e. function name and line number
Reply

Try this.
I was same problem.

I changed 5th line.
pawn Код:
public PingKick()
{
    if(ServerInfo[MaxPing] != 0)
    {
           if(++PingPos >= PING_MAX_EXCEEDS) PingPos = 0;

        for(new i=0; i<MAX_PLAYERS; i++)
        {
            Informacion[i][pPing][PingPos] = GetPlayerPing(i);

            if(GetPlayerPing(i) > ServerInfo[MaxPing])
            {
                if(Informacion[i][PingCount] == 0) Informacion[i][PingTime] = TimeStampxd();

                Informacion[i][PingCount]++;
                if(TimeStampxd() - Informacion[i][PingTime] > PING_TIMELIMIT)
                {
                    Informacion[i][PingTime] = TimeStampxd();
                    Informacion[i][PingCount] = 1;
                }
                else if(Informacion[i][PingCount] >= PING_MAX_EXCEEDS)
                {
                    new Sum, x, string[128];
                    while (x < PING_MAX_EXCEEDS) {
                        Sum += Informacion[i][pPing][x];
                        x++;
                    }
                    format(string,sizeof(string),"-Fantasilandia- kickeo a %s por exeder el ping maximo de %d de ping.", PlayerName2(i), ServerInfo[MaxPing] );
                    SendClientMessageToAll(red,string);
                    TogglePlayerControllable(i,false);
                    TextDrawShowForPlayer(i, FondoNegro);

                    new wea[500];
                    new PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(i, PlayerName, MAX_PLAYER_NAME);
                    new year,month,day; getdate(year, month, day);
                    new hour,minute,second; gettime(hour,minute,second);

                    format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\
                    \n\n{FFFFFF}Admin: Fantasilandia\
                    \n{FFFFFF}Razon: Tienes %d de ping y lo maximo es %d.\
                    \n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\
                    \n\n{FFFFFF}* Porfavor cancela las descargas y vuelve a entrar."
,PlayerName,GetPlayerPing(i),ServerInfo[MaxPing], day,month,year, hour, minute, second);
                    ShowPlayerDialog(i, 8000, DIALOG_STYLE_MSGBOX, " *          ", wea, "OK", "");

                    for(new p = 0; p < MAX_PLAYERS; p++) {
                    if(IsPlayerConnected(p)) {
                    PlayerPlaySound(p,1140,0.0,0.0,0.0);}}
                    Kick(i);
                }
            }
        }
    }
Reply

the waring is ubicated in crashdetect.log Not in compile
Код:
Plugin succesfully loaded (version 3.1.3)
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
Reply

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Try this.
I was same problem.

I changed 5th line.
pawn Код:
public PingKick()
{
    if(ServerInfo[MaxPing] != 0)
    {
           if(++PingPos >= PING_MAX_EXCEEDS) PingPos = 0;

        for(new i=0; i<MAX_PLAYERS; i++)
        {
            Informacion[i][pPing][PingPos] = GetPlayerPing(i);

            if(GetPlayerPing(i) > ServerInfo[MaxPing])
            {
                if(Informacion[i][PingCount] == 0) Informacion[i][PingTime] = TimeStampxd();

                Informacion[i][PingCount]++;
                if(TimeStampxd() - Informacion[i][PingTime] > PING_TIMELIMIT)
                {
                    Informacion[i][PingTime] = TimeStampxd();
                    Informacion[i][PingCount] = 1;
                }
                else if(Informacion[i][PingCount] >= PING_MAX_EXCEEDS)
                {
                    new Sum, x, string[128];
                    while (x < PING_MAX_EXCEEDS) {
                        Sum += Informacion[i][pPing][x];
                        x++;
                    }
                    format(string,sizeof(string),"-Fantasilandia- kickeo a %s por exeder el ping maximo de %d de ping.", PlayerName2(i), ServerInfo[MaxPing] );
                    SendClientMessageToAll(red,string);
                    TogglePlayerControllable(i,false);
                    TextDrawShowForPlayer(i, FondoNegro);

                    new wea[500];
                    new PlayerName[MAX_PLAYER_NAME];
                    GetPlayerName(i, PlayerName, MAX_PLAYER_NAME);
                    new year,month,day; getdate(year, month, day);
                    new hour,minute,second; gettime(hour,minute,second);

                    format(wea,sizeof(wea),"{FFFFFF}Disculpa %s, tu has sido Kickeado del servidor!\
                    \n\n{FFFFFF}Admin: Fantasilandia\
                    \n{FFFFFF}Razon: Tienes %d de ping y lo maximo es %d.\
                    \n{FFFFFF}Fecha: %i/%i/%i Hora: %i:%i :%i\
                    \n\n{FFFFFF}* Porfavor cancela las descargas y vuelve a entrar."
,PlayerName,GetPlayerPing(i),ServerInfo[MaxPing], day,month,year, hour, minute, second);
                    ShowPlayerDialog(i, 8000, DIALOG_STYLE_MSGBOX, " *          ", wea, "OK", "");

                    for(new p = 0; p < MAX_PLAYERS; p++) {
                    if(IsPlayerConnected(p)) {
                    PlayerPlaySound(p,1140,0.0,0.0,0.0);}}
                    Kick(i);
                }
            }
        }
    }
thanks
Reply

Quote:
Originally Posted by RcoN!
Посмотреть сообщение
the waring is ubicated in crashdetect.log Not in compile
Код:
Plugin succesfully loaded (version 3.1.3)
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of PingKick:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
I'm not talking about compile warnings, it will print the error lines in log
Reply

Quote:

[00:36:15] []: During execution of CheckIRCCommand:
[00:36:15] []: Run time error 4: "Array index out of bounds"

Still getting these - no file info & no line info.. after a few moments the server crashed & crashdetect did not output any crash info (but i ran GDB so i have a full backtrace but it doesn't tell me what exactly crashed it)
Reply

Quote:
Originally Posted by JernejL
Посмотреть сообщение
Still getting these - no file info & no line info.. after a few moments the server crashed & crashdetect did not output any crash info (but i ran GDB so i have a full backtrace but it doesn't tell me what exactly crashed it)
If your using Incognito's IRC plugin make sure your text input buffers are 512 characters as thats the max for irc setting it too small can result in a server crash I had that problem before.
Reply

It's not incogito's irc plugin, it's a heavily improved & secured php "delvor bot" text based system without any plugin.
Reply

Quote:
Originally Posted by JernejL
Посмотреть сообщение
It's not incogito's irc plugin, it's a heavily improved & secured php "delvor bot" text based system without any plugin.
Hmm.. I would assume the same rules would apply if there are any commands to input text from irc to in game, does the bot truncate the input text? Have you tried to send a very long text message through any of those commands to see if it crashes?
Reply

Wahts is the error ?

Код:

Plugin succesfully loaded (version 3.1.3)
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
Exit
Plugin succesfully loaded (version 3.1.3)
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
Exit
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
gamemodes\FTS.amx: During execution of CDI_OnPlayerDeath:
gamemodes\FTS.amx: Run time error 4: "Array index out of bounds".
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
Plugin unloaded
Plugin succesfully loaded (version 3.1.3)
The error is include ChangeDeathInfo.inc
pawn Код:
#if defined _cdi_included
    #endinput
#endif
#define _cdi_included

#include <a_samp>

/*
native ChangeDeathInfo(playerid, killerid, reason, delay=30000);
native ResetDeathInfo(playerid);
*/


stock ChangeDeathInfo(playerid, killerid, reason, delay=30000)
{
    if(IsPlayerConnected(playerid))
    {
        SetPVarInt(playerid, "CDI_DeathReason", reason);
        SetPVarInt(playerid, "CDI_Killer", killerid);
        SetPVarInt(playerid, "CDI_Changed", GetTickCount());
        SetPVarInt(playerid, "CDI_ChangeDelay", delay);
        return 1;
    }
    return 0;
}

stock ResetDeathInfo(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        SetPVarInt(playerid, "CDI_DeathReason", 255);
        SetPVarInt(playerid, "CDI_Killer", INVALID_PLAYER_ID);
        SetPVarInt(playerid, "CDI_Changed", GetTickCount());
        SetPVarInt(playerid, "CDI_ChangeDelay", 0);
        return 1;
    }
    return 0;
}

public OnPlayerSpawn(playerid)
{
    ResetDeathInfo(playerid);
    return CallLocalFunction("CDI_OnPlayerSpawn", "i", playerid);
}

#if defined _ALS_OnPlayerSpawn
    #undef OnPlayerSpawn
#else
    #define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn CDI_OnPlayerSpawn
forward CDI_OnPlayerSpawn(playerid);

public OnPlayerDeath(playerid, killerid, reason)
{
    if((GetPVarInt(playerid, "CDI_DeathReason") == 255 && !IsPlayerConnected(GetPVarInt(playerid, "CDI_Killer"))) || (GetTickCount() - GetPVarInt(playerid, "CDI_Changed")) > GetPVarInt(playerid, "CDI_ChangeDelay"))
        return CallLocalFunction("CDI_OnPlayerDeath", "iii", playerid, killerid, reason);
    return CallLocalFunction("CDI_OnPlayerDeath", "iii", playerid, GetPVarInt(playerid, "CDI_Killer"), GetPVarInt(playerid, "CDI_DeathReason"));
}

#if defined _ALS_OnPlayerDeath
    #undef OnPlayerDeath
#else
    #define _ALS_OnPlayerDeath
#endif
#define OnPlayerDeath CDI_OnPlayerDeath
forward CDI_OnPlayerDeath(playerid, killerid, reason);
wahts is the error ? please helpme
Reply

Quote:
Originally Posted by JernejL
Посмотреть сообщение
Still getting these - no file info & no line info.. after a few moments the server crashed & crashdetect did not output any crash info (but i ran GDB so i have a full backtrace but it doesn't tell me what exactly crashed it)
I don't know if my problem is the same as yours, but my server will crash when there's run-time error, and no stack trace is shown.

Quote:
Originally Posted by RcoN!
Посмотреть сообщение
Wahts is the error ?

Код:
...
The error is include ChangeDeathInfo.inc
pawn Код:
//code
wahts is the error ? please helpme
The callback CDI_OnPlayerDeath is a hooked callback. You'd better search for your main script, which involves OnPlayerDeath.
Still, if you want to know where the exact line is, you can compile all your scripts with the -d2 flag. See the first post.
Reply

Quote:
Originally Posted by leong124
Посмотреть сообщение
I don't know if my problem is the same as yours, but my server will crash when there's run-time error, and no stack trace is shown.
well you can get one via GDB and see where the server crashed with this .sh file:

Код:
echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file gdb.bt" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "set logging off" -ex "quit" samp03svr
date >> crash.log
cat gdb.bt >> crash.log
it won't tell you what part of script caused it, but knowing the part of server that crashed might help you debug it.
Reply

Works like a charm. Thanks.
Reply

I get this in my crash log quite a lot, and no info after a crash:
Код:
Could not open file
Only that, no filename what so ever.
Reply

Quote:
Originally Posted by Slice
Посмотреть сообщение
I get this in my crash log quite a lot, and no info after a crash:
Код:
Could not open file
Only that, no filename what so ever.

I have gotten that once it outputted...
Код:
Could not open file 
The server has crashed due to an unexpected error.
Maybe from a plugin or samp server itself? I have been curious about that seeing as it catches everything else.
Reply

Код:
Run time error 4: "Array index out of bounds"
Array max index is 211 but accessing an element at -400
Line:

Код:
modelid = GetVehicleModel(GetPlayerVehicleID(playerid))-400;
used for:

Код:
format(vehstr,sizeof(vehstr),"~w~~>~%s",VehicleInfo[modelid][vNAME]);
Another one:

Код:
During execution of OnPlayerCommandText():
Run time error 5: "Invalid memory access"
Additional information:
No details available
Why are there run time errors? Can someone help me?
Reply

You're trying to get vehicleID, when player is not in vehicle.
Reply

Quote:
Originally Posted by Walk_M4n
Посмотреть сообщение
You're trying to get vehicleID, when player is not in vehicle.
But there is a check before

Код:
if(IsPlayerInAnyVehicle(playerid))
{
:/
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)