[Crash Detect Errors]
#1

[18:44:47] [debug] Run time error 4: "Array index out of bounds"
[18:44:47] [debug] Accessing element at index 50 past array upper bound 49
[18:44:47] [debug] AMX backtrace:
[18:44:47] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:45:06] [debug] Run time error 4: "Array index out of bounds"
[18:45:06] [debug] Accessing element at index 65535 past array upper bound 49
[18:45:06] [debug] AMX backtrace:
[18:45:06] [debug] #0 000c9438 in public cmd_pm () from bluegamesv1.amx
[18:45:06] [debug] #1 0000ea90 in ?? () from bluegamesv1.amx
[18:45:06] [debug] #2 000009e0 in public OnPlayerCommandText () from bluegamesv1.amx
[18:45:07] Incoming connection: 41.176.196.191:16386
[18:45:17] Incoming connection: 41.176.196.191:16390
[18:45:17] [debug] Run time error 4: "Array index out of bounds"
[18:45:17] [debug] Accessing element at index 255 past array upper bound 99
[18:45:17] [debug] AMX backtrace:
[18:45:17] [debug] #0 0006b978 in public Streamer_OnPlayerDisconnect () from bluegamesv1.amx
[18:45:17] [debug] #1 native CallLocalFunction () [080d24b0] from samp03svr
[18:45:17] [debug] #2 0000e1e8 in ?? () from bluegamesv1.amx
[18:45:17] [debug] #3 00000e58 in public OnPlayerDisconnect () from bluegamesv1.amx)
[18:45:51] [debug] Run time error 4: "Array index out of bounds"
[18:45:51] [debug] Accessing element at index 50 past array upper bound 49
[18:45:51] [debug] AMX backtrace:
[18:45:51] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:46:55] [debug] Run time error 4: "Array index out of bounds"
[18:46:55] [debug] Accessing element at index 50 past array upper bound 49
[18:46:55] [debug] AMX backtrace:
[18:46:55] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:47:59] [debug] Run time error 4: "Array index out of bounds"
[18:47:59] [debug] Accessing element at index 50 past array upper bound 49
[18:47:59] [debug] AMX backtrace:
[18:47:59] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:49:04] [debug] Run time error 4: "Array index out of bounds"
[18:49:04] [debug] Accessing element at index 50 past array upper bound 49
[18:49:04] [debug] AMX backtrace:
[18:49:04] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:49:07] [debug] Run time error 4: "Array index out of bounds"
[18:49:07] [debug] Accessing element at index 255 past array upper bound 99
[18:49:07] [debug] AMX backtrace:
[18:49:07] [debug] #0 0006b978 in public Streamer_OnPlayerDisconnect () from bluegamesv1.amx
[18:49:07] [debug] #1 0000e1e8 in ?? () from bluegamesv1.amx
[18:49:07] [debug] #2 00000e58 in public OnPlayerDisconnect () from bluegamesv1.amx
[18:50:08] [debug] Run time error 4: "Array index out of bounds"
[18:50:08] [debug] Accessing element at index 50 past array upper bound 49
[18:50:08] [debug] AMX backtrace:
[18:50:08] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:51:12] [debug] Run time error 4: "Array index out of bounds"
[18:51:12] [debug] Accessing element at index 50 past array upper bound 49
[18:51:12] [debug] AMX backtrace:
[18:51:12] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:51:25] [debug] Run time error 4: "Array index out of bounds"
[18:51:25] [debug] Accessing element at index 255 past array upper bound 99
[18:51:25] [debug] AMX backtrace:
[18:51:25] [debug] #0 0006b978 in public Streamer_OnPlayerDisconnect () from bluegamesv1.amx
[18:51:25] [debug] #1 0000e1e8 in ?? () from bluegamesv1.amx
[18:51:25] [debug] #2 00000e58 in public OnPlayerDisconnect () from bluegamesv1.amx
[18:52:16] [debug] Run time error 4: "Array index out of bounds"
[18:52:16] [debug] Accessing element at index 50 past array upper bound 49
[18:52:16] [debug] AMX backtrace:
[18:52:16] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:53:20] [debug] Run time error 4: "Array index out of bounds"
[18:53:20] [debug] Accessing element at index 50 past array upper bound 49
[18:53:20] [debug] AMX backtrace:
[18:53:20] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:53:28] [debug] Run time error 4: "Array index out of bounds"
[18:53:28] [debug] Accessing element at index 255 past array upper bound 99
[18:53:28] [debug] AMX backtrace:
[18:53:28] [debug] #0 0006b978 in public Streamer_OnPlayerDisconnect () from bluegamesv1.amx
[18:53:28] [debug] #1 0000e1e8 in ?? () from bluegamesv1.amx
[18:53:28] [debug] #2 00000e58 in public OnPlayerDisconnect () from bluegamesv1.amx
[18:53:28] [part] Dan_Petrelli has left the server (21:0)
[18:53:28] [debug] Run time error 4: "Array index out of bounds"


any ideas what r they? I'm still new to this plugin.
Reply
#2

You have lots of index out of bounds errors, here's an example.

pawn Code:
new testarray[ 50 ];
pawn Code:
testarray[ 65535 ]++;//Accessing element at index 65535 past array upper bound 49
You have so many of those, you could be doing something like this:

pawn Code:
for( new i = 0; i <= 50; ++i )
{
    testarray[ i ]++; //Accessing element at index 50 past array upper bound 49
}
Don't use "<=" (less than or equal) in loops, use "<" (less than).

So your loops should be like this:
pawn Code:
for( new i = 0; i < 50; ++i )
{
    testarray[ i ]++; //OK
}
If you make an array that is size 50, you get indexes 0-49.

A common cause for this "Accessing element at index 65535 past array upper bound 49" is not checking if killerid is equal to INVALID_PLAYER_ID.

From a_samp.inc:

pawn Code:
#define INVALID_PLAYER_ID                       (0xFFFF) // 0xFFFF is 65535
So,
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    //imagine player did /kill command - killerid is INVALID_PLAYER_ID

    //so before using killerid as an index, check it
   
    if( killerid != INVALID_PLAYER_ID )
    {
        //killerid is safe to use as an index
        gPlayerKills[ killerid ]++;
    }
    else
    {
        //killerid is not safe to use as index, the following causes an error
        gPlayerKills[ killerid ]++;////Accessing element at index 65535 past array upper bound 49
    }
   
    return 1;
}
Reply
#3

ye tbh nothing is wrong with the onplayerdeath.

Is there anyway to find those arrays inside the script? Or I have to search them manually.
Reply
#4

It gives you a generic location. For example:
Quote:

[18:45:51] [debug] AMX backtrace:
[18:45:51] [debug] #0 00080ab4 in public TimeConn () from bluegamesv1.amx
[18:46:55] [debug] Run time error 4: "Array index out of bounds"
[18:46:55] [debug] Accessing element at index 50 past array upper bound 49

You are accessing the 50th element of an array inside the TimeConn function.
Reply
#5

If you compile your mode with the -d3 compiler switch, crashdetect will tell you which lines are causing the errors.

If your not sure how to do that, create a file in the same directory as "pawncc.exe" name the file "pawn.cfg". Inside that file put this:

Code:
-d3
Recompile, and you should get different output from the compiler (stack size etc). Next time your server crashes or you access elements OOB, the output from crashdetect will tell you which line.
Reply
#6

it complies the same.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)