Server changing variables randomly (memory bug?)
#1

Hello, it's been a while!

My server is experiencing an issue where after a period of time, variables are just randomly being changed/bugged. I believe it is a memory issue?

I will offer a reward (money if I am allowed) for anyone that helps me nail down this issue.


Anyway, for example:

pawn Code:
new iWeather = 0;

// a timer every 24 minutes
iWeather = randomEx( 10, 12 )

// another timer every second
SetPlayerWeather( playerid, iWeather );
Now randomly, out of nowhere. This weather variable is being changed to some negative value and bugging out the server.

ANOTHER EXAMPLE:
pawn Code:
/* ** Random Messages ** */
static const
    g_randomMessages[ 45 ] [ 137 ] =
    {
        { "{8ADE47}Stephanie:"COL_WHITE" You can buy ropes at Supa Save or a 24/7 store to tie people up!" },
        { "{8ADE47}Stephanie:"COL_WHITE" Save us on your favourites so you don't miss out on the action!" },
        // 43 others ...
    }
;

public timer( )
{
    if( ( g_iTime = gettime( ) ) > g_randomMessageTick ) {
        SendClientMessageToAll( -1, g_randomMessages[ random( sizeof( g_randomMessages ) ) ] );
        g_randomMessageTick = g_iTime + 30;
    }
}
This constant array only just dumps random messages in my server periodically. However, it sometimes only just prints NOTHING. Like literally, the constant value is changed by itself during runtime.

-----

Advanced

according to a stack trace, seems that last line before my server crashes is here
https://github.com/compuphase/pawn/b...amx/amx.c#L582

-----

This issue occurs to many variables and consequentially, the server crashes.

Crashdetect provides me some information such as:
Code:
[10:42:56] [debug] AMX backtrace:
[10:42:56] [debug] #0 native memcpy () from samp03svr
But when I comment the code, other things get even more buggy. I've rolled back to an older version of my server and this still persists oddly.

If you know any potential reasons for this to cause (or fixes), please tell me.

I'll reward contributors that help me to fix the issues.


Ask me if you need more information, and what kind of information.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)