Samp server freeze/stuck
#1

Hello, I have a bad problem...

After sometime I started the server he stuck (all players remain online) and you can't use a command or connect to the server, players remain online but can't do anything and if they use /q they will exit from the server but server will show same amount of players.

Server doesn't restart just stay freezed...

In server_log don't show anything.
Reply
#2

Can you please provide me with a screenshot of your server.cfg and the game where it freezes?
Reply
#3

Looks like the problem is a command.
I ckecked 3 times when freezed and last OnPlayerCommandReceived was /members.

This is the command:

CMD:members(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
if(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pRank] >= 6)
{
new aim[4000],
query[300],
test[300],
test1[300],
test2[300],
test3[300],
test4,
aimtotal[4000],
result[300],
idd,
mid=0;
format(query, sizeof(query), "SELECT * FROM `users` WHERE `users`.`Member` = '%d' ORDER BY `users`.`Rank` DESC LIMIT 50", PlayerInfo[playerid][pMember]);
new Cache: membresult = mysql_query(SQL, query);
for(new i, j = cache_get_row_count (); i != j; ++i)
{
cache_get_field_content(i, "name", result); format(test, 300, result);
cache_get_field_content(i, "Rank", result); format(test1, 300, result);
cache_get_field_content(i, "lastOn", result); format(test2, 300, result);
cache_get_field_content(i, "FWarn", result); format(test3, 300, result);
test4 = cache_get_field_content_int(i, "FactionJoin");
idd = cache_get_field_content_int(i, "id");
Selected[playerid][mid] = idd;
new id = GetPlayerID(test);
if(id != INVALID_PLAYER_ID)
{
format(aim, sizeof(aim), "%s%s - %s\tonline right now\t%s/3 fw\t%d days\n", aim, test1, test, test3, GetDaysFromTimestamp(test4));
}
else
{
format(aim, sizeof(aim), "%s%s - %s\t%s\t%s/3 fw\t%d days\n", aim, test1, test, test2, test3, GetDaysFromTimestamp(test4));
}
mid++;
}
cache_delete(membresult);
format(aimtotal, sizeof(aimtotal), "Rank - Name\tLast Login\tFW\tDays in faction\n%s",aim);
if(PlayerInfo[playerid][pRank] >= 6)
{
ShowPlayerDialog(playerid,DIALOG_MEMBERS,DIALOG_ST YLE_TABLIST_HEADERS,"Faction members",aimtotal,"Select","Exit");
}
else
{
ShowPlayerDialog(playerid,DIALOG_MEMBERS,DIALOG_ST YLE_TABLIST_HEADERS,"Faction members",aimtotal,"Exit","");
}
}
return 1;
}

What is the problem with it?
For now I removed this command but I need it.
Reply
#4

Very, very very unoptimized code, I'd suspect a stack & heap collision. Consider optimizing your script/command to avoid this.
Reply
#5

Yes I figured that.

Now I get crashes...

[19:07:08] [debug] OnPlayerDeath(44, 27, 24)
[19:07:08] DEATH: ‘рЬ·{й|{р(рЬ{‘р<рЬ
{‘рњрЬ
{‘рРрЬ
{рьрЬ{й|{‘рЬ¦р‘‘рЬ Яр‘рЬ¦‘рЬд.рPф:ё{й{:й|{‘‘‘‘рЬA{‘рЬМ:й|{р was killed by MatteoTAXIMETRISTUL[AIM]+ ticket degeaba with gun 24
[19:07:08] [debug] Run time error 4: "Array index out of bounds"
[19:07:08] [debug] Accessing element at index 2625537 past array upper bound 999
[19:07:08] [debug] AMX backtrace:
[19:07:08] [debug] #0 0005225c in public OnPlayerGiveDamage () from GM.amx
[19:07:08] [debug] OnPlayerDeath(44, 65535, 255)
[19:07:09] [connection] incoming connection: x:62147 id: 55
[19:07:09] [join] Catalin_112 has joined the server (55)
[19:07:17] [debug] OnPlayerDeath(27, 24, 24)
[19:07:17] DEATH: MatteoTAXIMETRISTUL[AIM] was killed by [AIM]Alexutzu7777 with gun 24
[19:07:17] [debug] Server crashed while executing GM.amx
[19:07:17] [debug] AMX backtrace:
[19:07:17] [debug] #0 native format () from samp03svr
[19:07:17] [debug] #1 000554f4 in public OnPlayerGiveDamage () from GM.amx
[19:07:17] [debug] Native backtrace:
[19:07:17] [debug] #0 f6c39e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[19:07:17] [debug] #1 f6c32bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[19:07:17] [debug] #2 f6c33dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[19:07:17] [debug] #3 f6c34226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[19:07:17] [debug] #4 f6c39adc in ?? () from plugins/crashdetect.so
[19:07:17] [debug] #5 f774d410 in ?? ()
[19:07:17] [debug] #6 080965d7 in ?? () from samp03svr
[19:07:17] [debug] #7 080dce72 in ?? () from samp03svr
[19:07:17] [debug] #8 080950e4 in ?? () from samp03svr
[19:07:17] [debug] #9 f6c3594b in ZN11CrashDetect13DoAmxCallbackEiPiS0 () from plugins/crashdetect.so
[19:07:17] [debug] #10 f6c388f8 in ?? () from plugins/crashdetect.so
[19:07:17] [debug] #11 f6c3c916 in amx_Exec () from plugins/crashdetect.so
[19:07:17] [debug] #12 f6c34be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[19:07:17] [debug] #13 f6c38659 in ?? () from plugins/crashdetect.so
[19:07:17] [debug] #14 f6ba7bc6 in ?? () from plugins/streamer.so
[19:07:17] [debug] #15 080a6a5e in ?? () from samp03svr
[19:07:17] [debug] #16 080b312b in ?? () from samp03svr
[19:07:17] [debug] #17 08071d38 in ?? () from samp03svr
[19:07:17] [debug] #18 08071e32 in ?? () from samp03svr
[19:07:17] [debug] #19 0807bc50 in ?? () from samp03svr
[19:07:17] [debug] #20 080aed3d in ?? () from samp03svr
[19:07:17] [debug] #21 080aef02 in ?? () from samp03svr
[19:07:17] [debug] #22 080aa13a in ?? () from samp03svr
[19:07:17] [debug] #23 f7497bf6 in __libc_start_main () from /lib32/libc.so.6
[19:07:17] [debug] #24 0804b4e1 in ?? () from samp03svr

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[19:07:27] password = "" (string)
[19:07:27]
[19:07:27] Server Plugins
[19:07:27] --------------
[19:07:27] Loading plugin: mysql.so
[19:07:27] >> plugin.mysql: R39-6 successfully loaded.
[19:07:27] Loaded.
[19:07:27] Loading plugin: sscanf.so
[19:07:27]

[19:07:27] ===============================

[19:07:27] sscanf plugin loaded.

[19:07:27] Version: 2.8.1

[19:07:27] © 2012 Alex "******" Cole

[19:07:27] ===============================

[19:07:27] Loaded.
[19:07:27] Loading plugin: crashdetect.so
[19:07:27] CrashDetect v4.15.1 is OK.
[19:07:27] Loaded.
[19:07:27] Loading plugin: streamer.so
[19:07:27]

** Streamer Plugin v2.8.1 by Incognito loaded **

[19:07:27] Loaded.
[19:07:27] Loading plugin: wp.so
[19:07:27]
[19:07:27] ==================
[19:07:27]
[19:07:27] Whirlpool loaded
[19:07:27]
[19:07:27] ==================
[19:07:27]
[19:07:27] Loaded.
[19:07:27] Loaded 5 plugins.

[19:07:27]
[19:07:27] Ban list
[19:07:27] --------
[19:07:27] Loaded: samp.ban
[19:07:27]
[19:07:27]
[19:07:27] Filterscripts
[19:07:27] ---------------
[19:07:27] Loaded 0 filterscripts.

[19:07:27] [connection] x:57276 requests connection cookie.
[19:07:27]
[19:07:27]
[19:07:27]
[19:07:27] =======================================
[19:07:27] | |
[19:07:27] | YSI version 3.09.0684 |
[19:07:27] | By Alex "******" Cole |
[19:07:27] | |
[19:07:27] =======================================
[19:07:27]
[19:07:27] ---------- SERVER START ----------
[19:07:27] [debug] OnGameModeInit()
[19:07:27] mysql_connect: 1
[19:07:27] ----------------------------------------------------
[19:07:27] Script: Romania Roleplay - Based on Saints Roleplay
[19:07:27] Status: Loaded, running version RPG Romania 1.001
[19:07:27] ----------------------------------------------------
[19:07:27] Number of vehicle models: 0
[19:07:27] [LOADING] 14 groups loaded.
[19:07:27] [connection] x:62220 requests connection cookie.
[19:07:27] [LOADING] 478 vehicles loaded.
[19:07:27] [connection] x:63626 requests connection cookie.
[19:07:27] [connection] x:50948 requests connection cookie.
[19:07:27] [connection] x:51667 requests connection cookie.
[19:07:27] [connection] x:51212 requests connection cookie.
[19:07:28] [connection] x:53995 requests connection cookie.
[19:07:28] [connection] x:54630 requests connection cookie.
[19:07:28] [connection] x:49867 requests connection cookie.
[19:07:28] [connection] x:59499 requests connection cookie.
[19:07:28] [connection] x:65171 requests connection cookie.
[19:07:28] [LOADING] 104 houses loaded.
[19:07:28] [LOADING] 48 turfs loaded.
[19:07:28] [LOADING] 54 businesses loaded.
[19:07:28] [LOADING] 105 models loaded.
[19:07:28] [LOADING] 14 clans loaded.
[19:07:28] [LOADING] 2 sVars loaded.
[19:07:28] Players registered: 1550
Reply
#6

Show us OnPlayerGiveDamage
Reply
#7

http://pastebin.com/TyzcdQHq
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)