Help server crash
#1

Hi, i have some problems with server on start i got this
Код:
[00:49:38] [debug] Run time error 4: "Array index out of bounds"
[00:49:38] [debug]  Accessing element at index 350 past array upper bound 349
[00:49:38] [debug] AMX backtrace:
[00:49:38] [debug] #0 003d655c in public OnQueryFinish () from mazz.amx
[00:49:38] [debug] Run time error 4: "Array index out of bounds"
[00:49:38] [debug]  Accessing element at index 351 past array upper bound 349
[00:49:38] [debug] AMX backtrace:
[00:49:38] [debug] #0 003d655c in public OnQueryFinish () from mazz.amx
server works normal untill it crash and i got this error

Код:
 [debug] Run time error 5: "Invalid memory access"
 [debug] AMX backtrace:
 [debug] #0 00000f58 in public OnPlayerCommandText () from sneg.amx
 [debug] Server crashed while executing mazz.amx
 [debug] AMX backtrace:
 [debug] #0 00001258 in public OnPlayerCommandText () from mazz.amx
 [debug] System backtrace:
 [debug] #0 f70d9f41 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
 [debug] #1 f70d041f in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
 [debug] #2 f70ce963 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
 [debug] #3 f70d93c1 in ?? () from plugins/crashdetect.so
 [debug] #4 ffffe600 in ?? ()
 [debug] #5 080d3aac in ?? () from ./samp03svr
 [debug] #6 f70dea33 in amx_Exec () from plugins/crashdetect.so
 [debug] #7 f70cf622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
 [debug] #8 f70d7699 in ?? () from plugins/crashdetect.so
 [debug] #9 0806f902 in ?? () from ./samp03svr
 [debug] #10 0807fe6c in ?? () from ./samp03svr
 [debug] #11 080adbe1 in ?? () from ./samp03svr
 [debug] #12 080adcd2 in ?? () from ./samp03svr
 [debug] #13 080b79c0 in ?? () from ./samp03svr
 [debug] #14 0807d736 in ?? () from ./samp03svr
 [debug] #15 0807d962 in ?? () from ./samp03svr
 [debug] #16 08077c23 in ?? () from ./samp03svr
 [debug] #17 00232e9c in __libc_start_main () from /lib/libc.so.6
 [debug] #18 0804b4c1 in __gxx_personality_v0 () from ./samp03svr
Reply
#2

The crash information is quite straightforward in my opinion. You could start looking at arrays with size of 350. This means the maximal index they can be accessed at is 349, going beyond that gives undefined results. Running crashdetect once in a while is good to iron out such mistakes although in most cases they should not produce a crash right away without the detection plugin.
Reply
#3

i shoud change all arrays with size of 350 to 349 or ?
Reply
#4

Check all strings/things where you have new ...[350]; or in a loop use < 350 eg. sizeof() not <= 350
Reply
#5

I still have this error after some time and server crashes

Код:
[13:29:37] [debug] Server crashed while executing mazz.amx
[13:29:37] [debug] AMX backtrace:
[13:29:37] [debug] #0 000010f4 in public OnPlayerCommandText () from mazz.amx
[13:29:37] [debug] System backtrace:
[13:29:37] [debug] #0 f715ff41 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[13:29:37] [debug] #1 f715641f in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[13:29:37] [debug] #2 f7154963 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[13:29:37] [debug] #3 f715f3c1 in ?? () from plugins/crashdetect.so
[13:29:37] [debug] #4 ffffe600 in ?? ()
[13:29:37] [debug] #5 080d3aac in ?? () from ./samp03svr
[13:29:37] [debug] #6 f7164a33 in amx_Exec () from plugins/crashdetect.so
[13:29:37] [debug] #7 f7155622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[13:29:37] [debug] #8 f715d699 in ?? () from plugins/crashdetect.so
[13:29:37] [debug] #9 0806f902 in ?? () from ./samp03svr
[13:29:37] [debug] #10 0807fe6c in ?? () from ./samp03svr
[13:29:37] [debug] #11 080adbe1 in ?? () from ./samp03svr
[13:29:37] [debug] #12 080adcd2 in ?? () from ./samp03svr
[13:29:37] [debug] #13 080b79c0 in ?? () from ./samp03svr
[13:29:37] [debug] #14 0807d78d in ?? () from ./samp03svr
[13:29:37] [debug] #15 0807d962 in ?? () from ./samp03svr
[13:29:37] [debug] #16 08077c23 in ?? () from ./samp03svr
[13:29:37] [debug] #17 00232e9c in __libc_start_main () from /lib/libc.so.6
[13:29:37] [debug] #18 0804b4c1 in __gxx_personality_v0 () from ./samp03svr
Reply
#6

Its easy to detect, it looks as some cmd cause it, you can 1. Just use each cmd in a row to find which cause it or put print(cmdtext); under OnPlayerCommandText, so you can see last used cmd before server crashed.
Reply
#7

SAMP crashsamp program for shutdown server - onplayercommand
crashsamp
anyone knows protection for it ?
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)