[Plugin] CrashDetect

Why not show us the whole code of that part?
Also, this should be posted in scripting discussion, but not this topic. This is a thread for crashdetect plugin, but not a thread for asking scripting questions.
Reply

Are you using any other plugins? They can cause this problem if they don't have the latest version of sampgdk.
Reply

Solved my problem, I hadn't passed the -d3 flag correctly.
When I tried putting it in the pawn. cfg (http://forum.sa-mp.com/showpost.php?...32&postcount=7) it worked.
Reply

pawn Код:
[07/12/2011 19:33:19]   Loaded.
[07/12/2011 19:33:19]  Loading plugin: crashdetect
[07/12/2011 19:33:19]   It looks like amx_Exec() is already hooked by RouteConnectorPlugin.dll.
[07/12/2011 19:33:19]   The runtime error detection feature will be disabled during this run.
[07/12/2011 19:33:19]   Loaded.
erm, how can I bypass this, I need the runtime error detection and RouteConnectorPlugin
Reply

Код:
[09:16:42]:
[09:16:42]: --- crashdetect 3.6.11.0 loaded
[09:17:54]: Server crash caused by native format() called at address 0x682C in 'gamemodes/RAS.amx'
[09:17:54]: Call stack (most recent call first):
[09:22:00]:
??
Reply

Quote:
Originally Posted by 0x5A656578
Посмотреть сообщение
What is more interesting is to find how this managed to happen... And you can! Just compile that script with symbolic information (pass -d3 flag to the compiler), you will get this:

Код:
[18:18:21] The server has been crashed by fread at line 13 in crash.pwn.
[18:18:21] Stack trace of gamemodes\crash.amx (most recent call first):
[18:18:21] #2: function2 on line 8 in crash.pwn
[18:18:21] #1: function1 on line 4 in crash.pwn
[18:18:21] #0: main (entry point) in crash.pwn
4char
Reply

pretty helpful plugin
Reply

[00:26:30]: Additional information:
[00:26:30]: Array max index is 3 but accessing an element at 4
[00:26:30]: Call stack (most recent call first):
[00:26:30]: public PingKick()
[00:26:57]: Script[gamemodes/rp.amx]: During execution of PingKick():
[00:26:57]: Script[gamemodes/rp.amx]: Run time error 4: "Array index out of bounds"



Quote:

forward PingKick();
public PingKick()
{
if(ServerInfo[MaxPing] != 0)
{
PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;

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

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

PlayerInfo[i][PingCount]++;
if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
{
PlayerInfo[i][PingTime] = TimeStamp();
PlayerInfo[i][PingCount] = 1;
}
else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
{
new Sum, Average, x, string[128];
while (x < PING_MAX_EXCEEDS) {
Sum += PlayerInfo[i][pPing][x];
x++;
}
Average = (Sum / PING_MAX_EXCEEDS);
format(string,sizeof(string),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string);
Kick(i);
}
}
else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
{
PlayerInfo[i][BotPing]++;
if(PlayerInfo[i][BotPing] >= 3) BotCheck(i);
}
else
{
PlayerInfo[i][BotPing] = 0;
}
}
}
}

Solution?
Reply

Try this:

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

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

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

PlayerInfo[i][PingCount]++;
if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
{
PlayerInfo[i][PingTime] = TimeStamp();
PlayerInfo[i][PingCount] = 1;
}
else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
{
new Sum, Average, x, string[128];
while (x < PING_MAX_EXCEEDS) {
Sum += PlayerInfo[i][pPing][x];
x++;
}
Average = (Sum / PING_MAX_EXCEEDS);
format(string,sizeof(string),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string);
Kick(i);
}
}
else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
{
PlayerInfo[i][BotPing]++;
if(PlayerInfo[i][BotPing] >= 3) BotCheck(i);
}
else
{
PlayerInfo[i][BotPing] = 0;
}
}
}
}
Reply

pawn Код:
stock SendClientMessageFormatted(playerid, color, fstring[], {Float, _}:...)
{
    static const STATIC_ARGS = 3;
    new n = (numargs() - STATIC_ARGS) * BYTES_PER_CELL;
    if(n)
    {
        new message[144], arg_start, arg_end;
        #emit CONST.alt        fstring
        #emit LCTRL          5
        #emit ADD
        #emit STOR.S.pri        arg_start

        #emit LOAD.S.alt        n
        #emit ADD
        #emit STOR.S.pri        arg_end
        do
        {
            #emit LOAD.I
            #emit PUSH.pri
            arg_end -= BYTES_PER_CELL;
            #emit LOAD.S.pri      arg_end
        }
        while(arg_end > arg_start);

        #emit PUSH.S          fstring
        #emit PUSH.C          144
        #emit PUSH.ADR         message

        n += BYTES_PER_CELL * 3;
        #emit PUSH.S          n
        #emit SYSREQ.C         format

        //n += BYTES_PER_CELL;
        #emit LCTRL          4
        #emit LOAD.S.alt        n
        #emit ADD
        #emit SCTRL          4

        if(playerid == INVALID_PLAYER_ID)
        {
            #pragma unused playerid
            return SendClientMessageToAll(color, message);
        } else {
            return SendClientMessage(playerid, color, message);
        }
    } else {
        if(playerid == INVALID_PLAYER_ID)
        {
            #pragma unused playerid
            return SendClientMessageToAll(color, fstring);
        } else {
            return SendClientMessage(playerid, color, fstring);
        }
    }
}
pawn Код:
Server crash caused by native format() called at line 29411
pawn Код:
#emit SYSREQ.C         format

        n += BYTES_PER_CELL;//29411
Reply

Quote:
Originally Posted by Kar
Посмотреть сообщение
pawn Код:
stock SendClientMessageFormatted(playerid, color, fstring[], {Float, _}:...)
{
    static const STATIC_ARGS = 3;
    new n = (numargs() - STATIC_ARGS) * BYTES_PER_CELL;
    if(n)
    {
        new message[144], arg_start, arg_end;
        #emit CONST.alt        fstring
        #emit LCTRL          5
        #emit ADD
        #emit STOR.S.pri        arg_start

        #emit LOAD.S.alt        n
        #emit ADD
        #emit STOR.S.pri        arg_end
        do
        {
            #emit LOAD.I
            #emit PUSH.pri
            arg_end -= BYTES_PER_CELL;
            #emit LOAD.S.pri      arg_end
        }
        while(arg_end > arg_start);

        #emit PUSH.S          fstring
        #emit PUSH.C          144
        #emit PUSH.ADR         message

        n += BYTES_PER_CELL * 3;
        #emit PUSH.S          n
        #emit SYSREQ.C         format

        //n += BYTES_PER_CELL;
        #emit LCTRL          4
        #emit LOAD.S.alt        n
        #emit ADD
        #emit SCTRL          4

        if(playerid == INVALID_PLAYER_ID)
        {
            #pragma unused playerid
            return SendClientMessageToAll(color, message);
        } else {
            return SendClientMessage(playerid, color, message);
        }
    } else {
        if(playerid == INVALID_PLAYER_ID)
        {
            #pragma unused playerid
            return SendClientMessageToAll(color, fstring);
        } else {
            return SendClientMessage(playerid, color, fstring);
        }
    }
}
pawn Код:
Server crash caused by native format() called at line 29411
pawn Код:
#emit SYSREQ.C         format

        n += BYTES_PER_CELL;//29411
Do you use format() in other areas of your script? I particularly remember there being a problem where if you used that function, you needed to use format() elsewhere in your script.
Reply

of course, maybe I need to call format before it using it? like to initialize it?

edit: the first "scmf" is in onplayerconnect, I called it after a format, and there are formats in OnGameModeInit and still crashed

pawn Код:
[08:25:54] Loaded debug info from 'gamemodes\CNR.amx'
[08:27:46] Server crash caused by native format() called at line 29422 in 'C:\Documents and Settings\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\gamemodes\CNR.pwn'
[08:27:46] Call stack (most recent call first):
[08:27:46]   File 'C:\Documents and Settings\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\gamemodes\CNR.pwn', line 10852
[08:27:46]     SendClientMessageFormatted(playerid=65535, color=-741092353, fstring[]=@0x146c3c)
[08:27:46]   File 'C:\Documents and Settings\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\gamemodes\CNR.pwn'
[08:27:46]     public Itter_OnPlayerConnect(playerid=65535)
Edit: It seems like it's only called in OnPlayerConnect..
Reply

Quote:
Originally Posted by SPAWN_METAL
Посмотреть сообщение
Is it possible to ignore some times crash function?
in my server when I'm update gamemode I close server not with rcon exit
because this is kicks all players
I use crash of server with fread:
Код HTML:
OnGameModeExit();
new d1[1];
new File:f=fopen("acco234234.cer", io_read);
fread(f,d1);
How about SendRconCommand("gmx") ?
Reply

Iґm loaded the plugin whith crashdetect ultimate version and & compile in -d3 but only says

Loaded debug info from "gamemodes\spcrt.amx"

crashdetect.log


[23:57:59]:
[23:57:59]: --- crashdetect 3.6.12 loaded.
[23:57:59]: Loaded debug info from 'gamemodes\spcrt.amx'
[23:59:01]: Unloaded.


Any Errors?
Reply

This means that you do not have errors. _.
Reply

For 3.6.12, the whole server crashes when there is an run-time error.
Test code:
pawn Код:
#include <a_samp>

public OnFilterScriptInit()
{
    new x = 100,a[10];
    a[x] = 1;
    return 1;
}
Error code:
Код:
[2011-12-12 18:48:11] --- crashdetect 3.6.12 loaded.
[2011-12-12 18:48:20] Loaded debug info from 'filterscripts\sc_actions.amx'
[2011-12-12 18:48:20] Loaded debug info from 'filterscripts\sc_objects.amx'
[2011-12-12 18:48:21] Loaded debug info from 'gamemodes\scfri.amx'
[2011-12-12 18:49:17] The server has crashed due to an unknown error
[2011-12-12 18:49:17] Loaded debug info from 'filterscripts\test6.amx'
[2011-12-12 18:49:17] Script[filterscripts\test6.amx]: In file 'D:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test6.pwn' at line 6:
[2011-12-12 18:49:18] Script[filterscripts\test6.amx]: Run time error 4: "Array index out of bounds"
[2011-12-12 18:49:18] Additional information:
[2011-12-12 18:49:18]   Array max index is 9 but accessing an element at 100
[2011-12-12 18:49:18] Call stack (most recent call first):
[2011-12-12 18:49:18]   File 'D:\Program Files\Rockstar Games\GTA San Andreas\filterscripts\test6.pwn'
[2011-12-12 18:49:18]     public OnFilterScriptInit()
Check the attachment below if you need the dump file.
Reply

I installed the version 3.6.11.0, becouse my server sometimes crashes. I recompiled all of my used scripts with the '-d3' flag. My server starts, runs okay, but when it crashes, I only can find in the crashdetect's log, that the debug info is loaded from all script. Why it prints nothing? Should I try an other flag?

Please help me, if You can!
Thanks!
Reply

Quote:
Originally Posted by nickdodd25
Посмотреть сообщение
Would anyone know why i get these runtime errors when i load this incude by iPleomax https://sampforum.blast.hk/showthread.php?tid=277706
Код:
[19:49:44] [debug] Run time error 6: "Invalid instruction"
[19:49:44] [debug]   Invalid opcode 0x7800 at address 0xFFFFFFFB
[19:49:44] [debug] Backtrace (most recent call first):
[19:49:44] [debug] #0  public OnObjectMoved()+0xffffffff from TruckersInc.amx
[19:49:44] [debug] Run time error 6: "Invalid instruction"
[19:49:44] [debug]   Invalid opcode 0x7800 at address 0xFFFFFFFB
[19:49:44] [debug] Backtrace (most recent call first):
[19:49:44] [debug] #0  public OnObjectMoved()+0xffffffff from TruckersInc.amx
and
[18:05:47] [debug] Run time error 6: "Invalid instruction"
[18:05:47] [debug]   Invalid opcode 0x7800 at address 0xFFFFFFFB
[18:05:47] [debug] Backtrace (most recent call first):
[18:05:47] [debug] #0  public OnPlayerClickPlayer()+0xffffffff from TruckersInc.amx
[18:05:47] [debug] Run time error 6: "Invalid instruction"
[18:05:47] [debug]   Invalid opcode 0x7800 at address 0xFFFFFFFB
[18:05:47] [debug] Backtrace (most recent call first):
[18:05:47] [debug] #0  public OnPlayerClickPlayer()+0xffffffff from TruckersInc.amx
There is a few others like that but i dont have any of them in my script. It only happens when i use the include but when i comment it off its all fine.
Any ideas whats going on? The achievements still work but it just spams this, and i havent ran the server long enough to see if it crashes, its only my test server.

Thanks
Nick
Do you call any functions from that include?

Quote:
Originally Posted by Edvin
Посмотреть сообщение
I compile my gamemode with -d3 flag and still don't show the lines when server crash.
Add this code to your gamemode:

pawn Код:
#if debug != 2
    #error FAIL
#endif
If it doesn't compile you're doing something wrong...
Reply

@ZeeX_ ... it gives me this
Код:
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\gamemodes\RAS.pwn(12) : fatal error 111: user error: FAIL
?
Reply

Quote:
Originally Posted by Zeex_
Посмотреть сообщение
Do you call any functions from that include?
Yes here is the achievement i made to test.
pawn Код:
new Ach_PlayerConnect;
//in OnGameModeInti
Ach_PlayerConnect = CreateAchievement("Loyal Player","Good Job!!!~n~Thank you for Comming back to Truckers Inc!!~n~+$100000 and +10 score", 2);//2 just to test it
//now on its own
public OnPlayerAchieve(playerid, achid)
{
    if(achid == Ach_Connect)
    {
        RewardPlayer(playerid, 75000, 0); SetPlayerScore(playerid, GetPlayerScore(playerid)+10);
        SendClientMessageToAll(0xFF0000FF, "Someone Just Achieved The Loyalty Achievement!!");
    }
    return 1;
}
//now under onplayerspawn
GivePlayerAchievement(playerid, Ach_PlayerConnect, 1);//
But when i comment that off and the incude too it goes away and there is no errors, i even asked in the main thread for the incude but no one helped me yet.

Thanks
Nick
Reply


Forum Jump:


Users browsing this thread: 59 Guest(s)