SA-MP Forums Archive
Script[gamemodes/****.amx]: Run time error 7: "Stack underflow" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Script[gamemodes/****.amx]: Run time error 7: "Stack underflow" (/showthread.php?tid=94588)



Script[gamemodes/****.amx]: Run time error 7: "Stack underflow" - Chaprnks - 30.08.2009

Can someone explain more about this error? Never seen it before and there doesn't seem to be another post with this error code. The loading of the script was successful just a few minutes before. I've seen stack overflow, but not underflow.

Code:
SA:MP Dedicated Server
----------------------
v0.2X, ©2005-2008 SA:MP Team

[15:57:17]
[15:57:17] Server Plugins
[15:57:17] --------------
[15:57:17] Loading plugin: dns.dll
[15:57:17]
*** DNS Plugin v2.2 by Incognito loaded ***

[15:57:17] Loaded.
[15:57:17] Loading plugin: ysf.dll
[15:57:17]

[15:57:17] ===============================
[15:57:17] YSF 0.2.00 loaded
[15:57:17] © 2008 Alex "******" Cole
[15:57:17] Server version: 0.2X
[15:57:17] Operating System: Windows
[15:57:17] ===============================

[15:57:17] Loaded.
[15:57:17] Loading plugin: mysql.dll
[15:57:17]

-------------------------------------
MySQL plugin has been loaded
Version: 1.0.3
Initialized on SA:MP Windows 0.2X
-------------------------------------

[15:57:17] Loaded.
[15:57:17] Loaded 3 plugins.

[15:57:17]
[15:57:17] Filter Scripts
[15:57:17] ---------------
[15:57:17] Loading filter script 'ostream.amx'...
[15:57:17] Loaded 1 filter scripts.

[15:57:18] Uptime: 1097905 Threads: 1 Questions: 367393 Slow queries: 0 Opens: 10167 Flush tables: 1 Open tables: 13 Queries per second avg: 0.334
[15:57:18] MySQL has been initialized and successfully loaded
[15:57:18] Script[gamemodes/****.amx]: Run time error 7: "Stack underflow"



Re: Script[gamemodes/****.amx]: Run time error 7: "Stack underflow" - paytas - 30.08.2009

http://en.wikipedia.org/wiki/Stack_(data_structure)


Re: Script[gamemodes/****.amx]: Run time error 7: "Stack underflow" - Chaprnks - 31.08.2009

Quote:
Originally Posted by paytas
Thanks for attempting to help. I've tried to understand the underflow and overflow examples, although they don't seem to correspond with anything in pawno.

Code:
  int pop(STACK *ps)
  {
    if(empty(ps)){
      printf("Error: stack underflow");
      exit(EXIT_FAILURE);
    } else 
      return(ps->items[(ps->top)--]);
  }


  void push(int x, STACK *ps)
  {
    if(ps->top == STACKSIZE-1){
      printf("Error: stack overflow");
      exit(EXIT_FAILURE);
    } else 
      ps->items[++(ps->top)] = x;
      
    return;
  }