Stack corrupted! Heap underflow
#1

Hy community,

I need your help/advice. I loaded crashdetect plugin to track down some errors in my script and somehow got into this problem:

pawn Code:
[13:05:08] Script[gamemodes/newegDB.amx]: In file 'I:\_eGaming\samp\_new_mysql-0.3d\__CORECTAT0.3c\pawno-3\include\float.inc' at line 108:
[13:05:08] Script[gamemodes/newegDB.amx]: Run time error 8: "Heap underflow"
[13:05:08] Error information:
[13:05:08]   Heap index (HEA) is 0x8B, heap bottom (HLW) is 0x3F20FC
[13:05:08] Call stack (most recent call first):
[13:05:08]   Stack corrupted!
The file float.inc is the standard file from samp(pawn) package.
the line 108 is:
pawn Code:
stock Float:operator-(Float:oper)
    return oper^Float:cellmin;                  /* IEEE values are sign/magnitude */
The problem appears on something very basic like:
pawn Code:
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health - 2.0);
if I modify the script into:

pawn Code:
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, floatsub(health, 2.0));
The problem vanished.

Does anyone have any idea why this thing happens ?
Should I use Floatadd, Floatsub, Floatmul, Floatdiv functions instead of standard operators +,-,*,/ ?

My compile output is:
pawn Code:
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          21152 bytes
Code size:          1581964 bytes
Data size:          4137212 bytes
Stack/heap size:      16384 bytes; estimated max. usage=1253 cells (5012 bytes)
Total requirements: 5756712 bytes

Done.
================ READY ================
Thank you in advance,
Mike
Reply


Messages In This Thread
Stack corrupted! Heap underflow - by xxmitsu - 07.01.2012, 10:26
Re: Stack corrupted! Heap underflow - by Vince - 07.01.2012, 12:24
Re: Stack corrupted! Heap underflow - by xxmitsu - 07.01.2012, 15:59

Forum Jump:


Users browsing this thread: 2 Guest(s)