Server crash problem
#9

Quote:
Originally Posted by iThePunisher
[12:52:09] [debug] Run time error 4: "Array index out of bounds"
[12:52:09] [debug] Accessing element at index 999 past array upper bound 2
the server crashes due to that.
this can be caused by something like this
pawn Код:
new vect[5];//0 - 4
for(new i=0; i<6; i++)//throws an out of bounds error during crash detect scan
        printf("%d",vect[i]);//cuz vect's boundaries are ranging from 0 to 4 (not 5)
        //it'll loop 0 to 5 until it crashes at i = 5 if we say i<6
//it'll be like: print, print, print, print, print, CRASHHHHH
now these things cannot be detected during compilation.
pawncc won't run loops to check if theyre allright.

but on the other hand, something like this
pawn Код:
new vect[5];
new x = vect[5];
will be detected during compilation cuz the compiler
knows the boundaries of vect are from 0 to 4 after "new vect[5]".
So if it's scanning something like "new x = vect[5]", itll look up
the boundaries of "vect" in the pool and "barks" if its out of range.

you'd get this error message
Код:
error 32: array index out of bounds (variable "vect")
what you must do is check your script for "bad" loops,
which could cause the accessing of an invalid element as described above.
Reply


Messages In This Thread
Server crash problem - by iThePunisher - 17.11.2014, 09:45
Re: Server crash problem - by dominik523 - 17.11.2014, 10:24
Re: Server crash problem - by Sew_Sumi - 17.11.2014, 10:31
Re: Server crash problem - by dominik523 - 17.11.2014, 10:34
Re: Server crash problem - by Kyance - 17.11.2014, 11:50
Re: Server crash problem - by Clarck - 17.11.2014, 12:10
Re: Server crash problem - by denNorske - 18.11.2014, 12:17
Re: Server crash problem - by iThePunisher - 22.11.2014, 10:41
Re: Server crash problem - by CutX - 22.11.2014, 11:12
Re: Server crash problem - by denNorske - 22.11.2014, 14:11

Forum Jump:


Users browsing this thread: 2 Guest(s)