debug problem
#1

cand anybody explain to me how to fix this debug problem?
pawn Код:
[21:06:28] [debug] Run time error 4: "Array index out of bounds"
[21:06:28] [debug]  Accessing element at negative index -1
[21:06:28] [debug] AMX backtrace:
[21:06:28] [debug] #0 000bab2c in ?? () from rp.amx
[21:06:28] [debug] #1 0005af18 in public OnQueryFinish () from rp.amx
onqueryfinish :

http://pastebin.com/n1w4JyWF
Reply
#2

up...
Reply
#3

You are accessing array at index -1 in OnQueryFinish. Probably off-by-one error in counting down. Without code that's all I can say
Reply
#4

It's the code up in my first post :
http://pastebin.com/n1w4JyWF
Reply
#5

Oh, sorry, missed that link. That's a shitload of code. There's a lot of accessing arrays at indexes like
pawn Код:
[playerid - 1000]
I'm pretty sure that is a negative index
Reply
#6

you can show me in what line ? i don't find this )
Reply
#7

Compiling with debug mode might help you to find from which lines the crash was caused at, to do so:

Goto pawno directory and create a file pawn.cfg
Open the file and write in it:
pawn Код:
-d3
Save it and re-compile rp.pwn

Let's hope it's going to give few extra information, otherwise you'll need to debug it manually (by that I mean adding print messages to see where the code stops when it crashes).
Reply
#8

pawn Код:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          20564 bytes
Code size:          1819744 bytes
Data size:         21531612 bytes
Stack/heap size:     120000 bytes; estimated max. usage: unknown, due to recursion
Total requirements:23491920 bytes
i get this debug problem when i log in to the server..
Reply
#9

pawn Код:
[23:42:18] [debug] Run time error 4: "Array index out of bounds"
[23:42:18] [debug]  Accessing element at index 20044 past array upper bound 107
[23:42:18] [debug] AMX backtrace:
[23:42:18] [debug] #0 00064aa4 in public OnQueryFinish () from rp.amx
[23:43:00] Running new race
[23:43:32] [chat] [Mike_Anwan]: coaie
[23:43:37] [chat] [Mike_Anwan]: 3
[23:43:37] [chat] [Mike_Anwan]: 1
[23:43:38] [debug] Run time error 4: "Array index out of bounds"
[23:43:38] [debug]  Accessing element at index 20045 past array upper bound 107
[23:43:38] [debug] AMX backtrace:
[23:43:38] [debug] #0 00064aa4 in public OnQueryFinish () from rp.amx
[23:43:42] [chat] [Mike_Anwan]: 3
[23:43:42] [chat] [Mike_Anwan]: 1
[23:43:43] [debug] Run time error 4: "Array index out of bounds"
[23:43:43] [debug]  Accessing element at index 20046 past array upper bound 107
[23:43:43] [debug] AMX backtrace:
[23:43:43] [debug] #0 00064aa4 in public OnQueryFinish () from rp.amx
[23:43:45] [chat] [Mike_Anwan]: 3
[23:43:45] [chat] [Mike_Anwan]: 1
[23:43:46] [debug] Run time error 4: "Array index out of bounds"
[23:43:46] [debug]  Accessing element at index 20047 past array upper bound 107
[23:43:46] [debug] AMX backtrace:
[23:43:46] [debug] #0 00064aa4 in public OnQueryFinish () from rp.amx
[23:43:51] [Chat Global] Mike Anwan (0): coaie



i get this before server running for long time... and when player join the server i get this
pawn Код:
[23:46:21] Incoming connection: 79.117.193.219:4789
[23:46:21] [join] Kylie_Summers has joined the server (3:79.117.193.219)
[23:46:23] [Chat Global] Alvarez Ferreira (2): =))
[23:46:34] [debug] Run time error 4: "Array index out of bounds"
[23:46:34] [debug]  Accessing element at negative index -1
[23:46:34] [debug] AMX backtrace:
[23:46:34] [debug] #0 000bd10c in ?? () from rp.amx
[23:46:34] [debug] #1 0005d298 in public OnQueryFinish () from rp.amx

this error can cause problems if i have the players on server? if the server runs?
Reply
#10

pawn Код:
estimated max. usage: unknown, due to recursion
This is indicator that somewhere, somewhere in your script something might be screwed up (but not necessarily). Run your compiler with -v -d3 (in your pawno it's Build > Build options, third field). The block during compilation (Header size, etc.) will be shown always (-v as in verbose). Now, if you have script compiled with -d3, then crashdetect will show specific line causing your problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)