server gets stucked -
Kiets - 02.04.2012
Hi. I have a very weird problem. When i connect to server it gets stucked, nothing gets loaded. I tried to look with crashdetect plugin and i got this (i deleted a lot of lines because it's the same):
[23:43:36] [debug] Run time error 4: "Array index out of bounds"
[23:43:36] [debug] Accessing element at index 65535 past array upper bound 99
[23:43:36] [debug] Backtrace (most recent call first):
[23:43:36] [debug] #0 0003176c in public OnPlayerTakeDamage () from bfsamp.amx
[23:43:39] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[23:43:39] [debug] Stack index (STK) is 0x148730, heap index (HEA) is 0x1486F8
[23:43:39] [debug] Backtrace (most recent call first):
[23:43:39] [debug] #0 00100e74 in ?? () from bfsamp.amx
[23:43:39] [debug] #1 00100ed8 in ?? () from bfsamp.amx
.....
[23:43:40] [debug] #1140 00100ed8 in ?? () from bfsamp.amx
[23:43:40] [debug] #1141 00100ed8 in ?? () from bfsamp.amx
[23:43:40] [debug] #1142 00020238 in public OnPlayerRequestClass () from bfsamp.amx
[23:43:45] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[23:43:45] [debug] Stack index (STK) is 0x14872C, heap index (HEA) is 0x1486F8
[23:43:45] [debug] Backtrace (most recent call first):
[23:43:45] [debug] #0 00100e74 in ?? () from bfsamp.amx
[23:43:45] [debug] #1 00100ed8 in ?? () from bfsamp.amx
[23:43:45] [debug] #2 00100ed8 in ?? () from bfsamp.amx
....
[23:43:46] [debug] #1123 000c9534 in ?? () from bfsamp.amx
[23:43:46] [debug] #1124 0002a198 in public OnPlayerSpawn () from bfsamp.amx
Anyone knows what is that problem? Btw it happened when i added new things to script. I tried to comment all the things i added to see if they are causing the problem but the problem wasn't gone.
EDIT: later when i try to connect i get nothing at all, just it says "Connected to the server" and nothing else.
Re: server gets stucked -
Kiets - 02.04.2012
Anyone? Still i didn't solve the problem.
Re: server gets stucked -
Vince - 02.04.2012
Recompile with -d3 compiler flags so the function names and script lines are visible. Also it looks like you are accessing an array of 100 elements somewhere (MAX_PLAYERS redefined?) without a check for INVALID_PLAYER_ID (defined 0xFFFF, which is 65535).
Re: server gets stucked -
Kiets - 02.04.2012
Ok i fixed this problem [23:43:36] [debug] Accessing element at index 65535 past array upper bound 99.
But now i still have this:
[15:38:22] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[15:38:22] [debug] Stack index (STK) is 0x14849C, heap index (HEA) is 0x14846C
[15:38:22] [debug] Backtrace (most recent call first):
it's related to OnPlayerRequestClass call back as i see in the end
[15:38:22] [debug] #1132 00022730 in public OnPlayerRequestClass () from bfsamp.amx
Tried to debug by printing some text in console
Код:
public OnPlayerRequestClass(playerid, classid)
{
//some code here
UniqueClass[playerid] = 0;
new string[128];
print("test1");
switch(classid)
{
case 0:
{
print("test2");
SetPlayerPosEx(playerid, 367.6075,2503.9297,16.4844);
//code here..
}
}
//code here...
return 1;
}
i get only this
[15:38:22] test1
[15:38:22] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[15:38:22] [debug] Stack index (STK) is 0x14849C, heap index (HEA) is 0x14846C
[15:38:22] [debug] Backtrace (most recent call first):
Re: server gets stucked -
Kiets - 02.04.2012
Never mind, fixed this. Problem was i called same function in the same function... LOL i am dumb.
Thanks Vince anyway.