[+REP] Server Crash (Crash detect errors)
#1

Hello, my server gets random crashed quite a few time now.

i decided to load "crashdetect" plugin, and got so many errors in the log.

Also, after the crash the server ping can be seen but on connecting in (it kicks the player)

So here are the errors, i get in the crash.

1 possible reason i found out is when any player gets more then 2b cash, server crashes.

Also, see the following serverlog errors

Code:
[15:30:54] [debug] Run time error 4: "Array index out of bounds"
[15:30:54] [debug]  Accessing element at index 65535 past array upper bound 499
[15:30:54] [debug] AMX backtrace:
[15:30:54] [debug] #0 00137284 in ?? (1, 65535, 1079194420, 54, 3) from DEATHMATCH.amx
[15:30:54] [debug] #1 0001126c in public OnPlayerTakeDamage (1, 65535, 1079194420, 54, 3) from DEATHMATCH.amx

[15:31:11] [debug] Run time error 4: "Array index out of bounds"
[15:31:11] [debug]  Accessing element at index 65535 past array upper bound 499
[15:31:11] [debug] AMX backtrace:
[15:31:11] [debug] #0 00137284 in ?? (1, 65535, 1079194420, 54, 3) from DEATHMATCH.amx
[15:31:11] [debug] #1 0001126c in public OnPlayerTakeDamage (1, 65535, 1079194420, 54, 3) from DEATHMATCH.amx
This is repeated 999 times in the whole log, i just copied twice.

And now after crash, i see this in the serverlog

[15:33:59] [connection] (player ip) requests connection cookie.
[15:34:08] Kicking (player ip) because they didn't logon to the game.
[15:34:30] Kicking (player ip) because they didn't logon to the game.
[15:34:42] [connection] (player ip) requests connection cookie.


it is also repeated, when everyplayer joins.

Server restart fixes it, but the errors (onplayertakedamange) continous

Help me please..

and tell me if you need my "OnPlayerTakeDamge" Code.
Reply
#2

In OnPlayerTakeDamage callback, check if issuerid is not INVALID_PLAYER_ID and then you can safely use it in arrays ([issuerid] <-).
Reply
#3

Ok, Thanks. I'll try it

Please tell me one more thing.

What if player gets a lot of money? (probably billions)

i saw manytimes it also crashes the server. how to fix it.

Like moneybar ($999999999), how can i set a default amount in my script.


More errors in serverlog as well

Code:
[16:55:24] [debug] Run time error 4: "Array index out of bounds"
[16:55:24] [debug]  Accessing element at negative index -1
[16:55:24] [debug] AMX backtrace:
[16:55:24] [debug] #0 00133340 in ?? (-1) from DEATHMATCH.amx
[16:55:24] [debug] #1 00133278 in ?? (-1, -1) from DEATHMATCH.amx
[16:55:24] [debug] #2 00133028 in ?? (1, 2) from DEATHMATCH.amx
[16:55:24] [debug] #3 000a1cdc in public Itter_OnPlayerDisconnect (1, 1) from DEATHMATCH.amx
[16:55:24] [debug] #4 0001a03c in ?? (1, 1) from DEATHMATCH.amx
[16:55:24] [debug] #5 0000de08 in public Streamer_OnPlayerDisconnect (1, 1) from DEATHMATCH.amx
[16:55:24] [debug] #6 native CallLocalFunction () from sampsvr-port_8888
[16:55:24] [debug] #7 000081c0 in public SSCANF_OnPlayerDisconnect (1, 1) from DEATHMATCH.amx
[16:55:24] [debug] #8 native CallLocalFunction () from sampsvr-port_8888
[16:55:24] [debug] #9 000006ac in public OnPlayerDisconnect (1, 1) from DEATHMATCH.amx
[16:55:24] [part] maminjuqi has left the server (1:1)


17:04:11] [debug] Run time error 4: "Array index out of bounds"
[17:04:11] [debug]  Accessing element at negative index -1
[17:04:11] [debug] AMX backtrace:
[17:04:11] [debug] #0 00133340 in ?? (-1) from DEATHMATCH.amx
[17:04:11] [debug] #1 00133278 in ?? (-1, -1) from DEATHMATCH.amx
[17:04:11] [debug] #2 00133028 in ?? (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #3 000a1cdc in public Itter_OnPlayerDisconnect (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #4 0001a03c in ?? (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #5 0000de08 in public Streamer_OnPlayerDisconnect (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #6 native CallLocalFunction () from sampsvr-port_8888
[17:04:11] [debug] #7 000081c0 in public SSCANF_OnPlayerDisconnect (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #8 native CallLocalFunction () from sampsvr-port_8888
[17:04:11] [debug] #9 000006ac in public OnPlayerDisconnect (3, 2) from DEATHMATCH.amx
[17:04:11] [debug] #10 native Kick () from sampsvr-port_8888
[17:04:11] [debug] #11 000276c8 in public KickExTimer (3) from DEATHMATCH.amx
[17:04:11] [part] toradoR has left the server (3:2)
Please help
Reply
#4

It ranges the money to 999,999,999 as max and that will not crash the server unless you use valstr (which can be fixed using format instead). It's most likely a scripting issue so if you can reproduce it and post crashdetect's result, we can fix it.
Reply
#5

Tell me about the errors, i posted. "OnPlayerDisconnect" one.

Please dude, i dont know how to fix crashdetect problems.
Reply
#6

You should compile with -d3 flag so we can get more details such as functions that are shown as ?? and lines: https://github.com/Zeex/samp-plugin-...ith-debug-info
Also if you don't use 4.15.1 crashdetect version, update it: https://github.com/Zeex/samp-plugin-...etect/releases

Re-run the server and if you get information with [debug] prefix in server log, post them here.
Reply
#7

I'm using latest crashdetect plugin.


I try to follow these methods to debug and tell you what's next.
Thanks for your reply.
Reply
#8

The first link I posted says exactly. All you have to do is create a pawn.cfg file* into pawno folder and write -d3 in it. Re-compile the script and run the server.

* If you cannot create a .cfg file, copy server.cfg and re-name it, clear everything inside.
Reply
#9

i see this after compling with -d3

Header size: 19740 bytes
Code size: 1764432 bytes
Data size: 43125912 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements:44926468 bytes
Reply
#10

Those are shown on compiling with -d3 but we need those with [debug] prefix in server log only.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)