Server Crashed +REP
#1

Yesterday server crashed, and I looked up in the logs and I found this:

[09:22:48] [debug] Server crashed while executing LSGW.amx
[09:22:48] [debug] AMX backtrace:
[09:22:48] [debug] #0 native format () from sampsvr-port_2557
[09:22:48] [debug] #1 000d61f8 in ?? (1, 1, 0) from LSGW.amx
[09:22:48] [debug] #2 00064e2c in ?? (1, 5010, 1, 0, 19969840) from LSGW.amx
[09:22:48] [debug] #3 0000dbf0 in public OnDialogResponse (1, 5010, 1, 0, 19969840) from LSGW.amx
[09:22:48] [debug] Native backtrace:
[09:22:48] [debug] #0 b742ee8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[09:22:48] [debug] #1 b7427bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[09:22:48] [debug] #2 b7428dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[09:22:48] [debug] #3 b7429226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[09:22:48] [debug] #4 b742eadc in ?? () from plugins/crashdetect.so
[09:22:48] [debug] #5 b772240c in ?? ()
[09:22:48] [debug] #6 080a4232 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #7 080a4bcd in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #8 080d5f19 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #9 080dc9c0 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #10 080950b4 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #11 b742a94b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[09:22:48] [debug] #12 b742d8f8 in ?? () from plugins/crashdetect.so
[09:22:48] [debug] #13 b7431916 in amx_Exec () from plugins/crashdetect.so
[09:22:48] [debug] #14 b7429be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[09:22:48] [debug] #15 b742d659 in ?? () from plugins/crashdetect.so
[09:22:48] [debug] #16 b7379f1a in ?? () from plugins/streamer.so
[09:22:48] [debug] #17 080a667f in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #18 080b2864 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #19 08071d38 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #20 08071e32 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #21 0807bc20 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #22 080ae9fd in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #23 080aebc2 in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #24 080a9e9a in ?? () from ./sampsvr-port_2557
[09:22:48] [debug] #25 b7480e66 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[09:22:48] [debug] #26 0804b4e1 in ?? () from ./sampsvr-port_2557


The OnDialogResponse Code is Here.

Please help me and I will +REP.
Reply
#2

Anyone please?
Reply
#3

There are 39 uses of format. That's quite a few to check.

Create a file called "pawn.cfg" in your compiler directory. Add "-d3" to it. Recompile your gamemode and make the server crash again. It should give you the line number which crashed.

If your unable to find the reason then, post your log and the line.
Reply
#4

Now the server logs keeps spamming with this:

[23:00:53] [debug] AMX backtrace:
[23:00:53] [debug] #0 00073c74 in ?? (... <5 arguments>) at D:\SA-MP Things\SAMP 0.3.7\gamemodes\LSGW.pwn:7777
[23:00:53] [debug] #1 00011a58 in public OnPlayerTakeDamage (playerid=1, issuerid=65535, Float:amount=3.30000, weaponid=54, bodypart=3) at D:\SA-MP Things\SAMP 0.3.7\pawno\include\YSI\y_hooks/impl.inc:2346
[23:00:59] [debug] Run time error 4: "Array index out of bounds"
[23:00:59] [debug] Accessing element at index 65535 past array upper bound 499
Reply
#5

No bumping but:

OnPlayerTakeDamage code:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9 && GetPlayerTeam(playerid) != GetPlayerTeam(issuerid) && Freemod[playerid] == 0 && OnDuty[playerid] == 0)
    {
        SetPlayerHealth(playerid, 0.0);
        if(Headshotdone[playerid] == 0)
        {
        new killedname[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME], Message[128];
        GetPlayerName(playerid, killedname, MAX_PLAYER_NAME);
        GetPlayerName(issuerid, killername, MAX_PLAYER_NAME);
        format(Message, sizeof(Message), "%s (%d) Has Been Killed By A Headshot From %s (%d)!", killedname, playerid, killername, issuerid);
        SendClientMessageToAll(0x00FBFFFF, Message);
        format(Message, sizeof(Message), "You Have Been Killed By A Headshot From %s (%d)!", killername, issuerid);
        SendClientMessage(playerid, 0xFF0000AA, Message);
        format(Message, sizeof(Message), "Congratulations! You Have Killed %s (%d) By A Headshot! Received Extra 2K!", killedname, playerid);
        SendClientMessage(issuerid, 0xFFEE00FF, Message);
        F_GivePlayerMoney(issuerid, 2000);
        GameTextForPlayer(issuerid, "~r~Headshot", 5000, 4);
        GameTextForPlayer(playerid, "~r~Killed By Headshot", 5000, 3);
        }
        Headshotdone[playerid] = 1;
    }
    if(issuerid != INVALID_PLAYER_ID && Freemod[issuerid] == 0 && GetPlayerTeam(playerid) != GetPlayerTeam(issuerid) && OnDuty[playerid] == 0)
    {
    PlayerPlaySound(issuerid, 17802, 0, 0, 0);
    }
    return 1;
}
Reply
#6

Which line is 7777?
Reply
#7

I had read that invalid specifiers could cause a crash from native format though I couldn't seem to reproduce it. Anyway, it's one of these function and caused the server crash:
pawn Код:
Dialog_HouseMenu(playerid, response, listitem); // Process the main housemenu
Dialog_UpgradeHouse(playerid, response, listitem); // Process the house-upgrade menu
Dialog_GoHome(playerid, response, listitem); // Port to one of your houses
Dialog_BuyCarClass(playerid, response, listitem); // The player chose a vehicleclass from where he can buy a vehicle
Dialog_BuyCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before
Dialog_SellCar(playerid, response, listitem);
Dialog_GetCarSelectHouse(playerid, response, listitem);
Dialog_GetCarSelectCar(playerid, response, listitem);
about the run time error 4, it checks if issuerid is not INVALID_PLAYER_ID and that prevents it. I'm quite interested on what caused this.
Reply
#8

Konstantinos, I noticed that I see that run time error 4 when a player gets shot by another one.

EDIT: The server crashed right after someone disconnected..
Reply
#9

What was line 7777 that dusk asked for?
Also can you post the output of crashdetect (those in server log) after the server crash?
Reply
#10

The line 7777 is in:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9 && GetPlayerTeam(playerid) != GetPlayerTeam(issuerid) && Freemod[playerid] == 0 && OnDuty[playerid] == 0)
    {
        SetPlayerHealth(playerid, 0.0);
        if(Headshotdone[playerid] == 0)
        {
        new killedname[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME], Message[128];
        GetPlayerName(playerid, killedname, MAX_PLAYER_NAME);
        GetPlayerName(issuerid, killername, MAX_PLAYER_NAME);
        format(Message, sizeof(Message), "%s (%d) Has Been Killed By A Headshot From %s (%d)!", killedname, playerid, killername, issuerid);
        SendClientMessageToAll(0x00FBFFFF, Message);
        format(Message, sizeof(Message), "You Have Been Killed By A Headshot From %s (%d)!", killername, issuerid);
        SendClientMessage(playerid, 0xFF0000AA, Message);
        format(Message, sizeof(Message), "Congratulations! You Have Killed %s (%d) By A Headshot! Received Extra 2K!", killedname, playerid);
        SendClientMessage(issuerid, 0xFFEE00FF, Message);
        F_GivePlayerMoney(issuerid, 2000);
        GameTextForPlayer(issuerid, "~r~Headshot", 5000, 4);
        GameTextForPlayer(playerid, "~r~Killed By Headshot", 5000, 3);
        }
        Headshotdone[playerid] = 1;
    } // 7777 Line here
    if(issuerid != INVALID_PLAYER_ID && Freemod[issuerid] == 0 && GetPlayerTeam(playerid) != GetPlayerTeam(issuerid) && OnDuty[playerid] == 0)
    {
    PlayerPlaySound(issuerid, 17802, 0, 0, 0);
    }
    return 1;
}
And I already posted the output of crashdetect above..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)