Run time error 8: "Heap underflow"
#1

when my server shuts down, i look server.log

Quote:

[10:16:17] [debug] #0 00000008 in public Speedo () from roleplay5.amx
[10:16:17] [debug] Run time error 8: "Heap underflow"
[10:16:17] [debug] Heap pointer (HEA) is 0x5C6458, heap bottom (HLW) is 0x81C4D0
[10:16:17] [debug] AMX backtrace:

pawn Код:
#pragma dynamic 10000
pawn Код:
SetTimer("Speedo",500,true);
pawn Код:
forward Speedo();
public Speedo()
{
    foreach(new i : Player)
    {
        if(IsPlayerConnected(i))
        {
            if (IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                new vehicleid = GetPlayerVehicleID(i);
                if (IsSpeedoVehicle(vehicleid) && !Karakter[i][pDisableSpeedo])
                {
                    static
                        Float:fDamage,
                        str[64];

                    GetVehicleHealth(vehicleid, fDamage);

                    fDamage = floatdiv(1000 - fDamage, 10) * 1.42999;

                    if (fDamage < 0.0) fDamage = 0.0;
                    else if (fDamage > 100.0) fDamage = 100.0;

                    format(str, sizeof(str), "~r~Fuel:~w~ %d%c", CoreVehicles[vehicleid][vehFuel], '%');
                    PlayerTextDrawSetString(i, pInfo[i][pTextdraws][35], str);

                    format(str, sizeof(str), "~r~Speed:~w~ %d KM/H", GetPlayerSpeed(i));
                    PlayerTextDrawSetString(i, pInfo[i][pTextdraws][36], str);

                    format(str, sizeof(str), "~r~Damage:~w~ %.0f/100%%", (fDamage > 100.0) ? (100.0) : (fDamage));
                    PlayerTextDrawSetString(i, pInfo[i][pTextdraws][37], str);

                    format(str, sizeof(str), "~r~Window:~w~ %s", (CoreVehicles[vehicleid][vehWindowsDown]) ? ("Down") : ("Up"));
                    PlayerTextDrawSetString(i, pInfo[i][pTextdraws][38], str);
                }
                for (new b = 0; b != MAX_BARRICADES; b ++)
                {
                    if (BarricadeData[b][cadeExists] && BarricadeData[b][cadeType] == 1 && IsPlayerInRangeOfPoint(i, 3.0, BarricadeData[b][cadePos][0], BarricadeData[b][cadePos][1], BarricadeData[b][cadePos][2]))
                    {
                        static
                            tires[4];

                        GetVehicleDamageStatus(vehicleid, tires[0], tires[1], tires[2], tires[3]);

                        if (tires[3] != 1111) {
                            UpdateVehicleDamageStatus(vehicleid, tires[0], tires[1], tires[2], 1111);
                        }
                        break;
                    }
                }
            }
        }
    }
}
pawn Код:
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
    return floatround(ST[3]);
}
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          23492 bytes
Code size:          2184692 bytes
Data size:          8504528 bytes
Stack/heap size:      40000 bytes; estimated max. usage=64038 cells (256152 bytes)
Total requirements:10752712 bytes
please help me
Reply
#2

Any problem at pragma dynamic or getplayerspeed?
i created a ticket about this problem to hosting and they only restarted my server for free memory but the problem not solved
Reply
#3

any problem at my code?
Reply
#4

My problem didn't solved

server.log : http://pastebin.com/29rxhV88

code : http://pastebin.com/KjBp01h1

whats problem at my code?
i did what you said

Maybe timer problem?
Reply
#5

MySQL R7 has a bug that causes heap underflows, you might want to upgrade to a newer version (there's like R40 already or so).
Reply
#6

Thanks problem solved update mysql to r39-2
Reply


Forum Jump:


Users browsing this thread: