[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.
[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]:
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 |
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; } } } } |
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;
}
}
}
}
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);
}
}
}
Server crash caused by native format() called at line 29411
#emit SYSREQ.C format
n += BYTES_PER_CELL;//29411
pawn Код:
pawn Код:
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)
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); |
#include <a_samp>
public OnFilterScriptInit()
{
new x = 100,a[10];
a[x] = 1;
return 1;
}
[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()
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 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 |
I compile my gamemode with -d3 flag and still don't show the lines when server crash.
|
#if debug != 2
#error FAIL
#endif
C:\Documents and Settings\user\My Documents\RAS&MAP&FS&SERVERS\RAS\gamemodes\RAS.pwn(12) : fatal error 111: user error: FAIL
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);//