Questions tagged [stackunderflow]

A stack underflow occurs when trying to remove an object from the operand stack, but the stack is empty.

A is a last in first out (LIFO) abstract data type. Elements can only be added to and removed from the peak (end) of the stack.

When the pop() method is used on an empty stack, the program will give a stack underflow error as there is no element to be removed.

See also:

17 questions
26
votes
10 answers

Provoke stack underflow in C

I would like to provoke a stack underflow in a C function to test security measures in my system. I could do this using inline assembler. But C would be more portable. However I can not think of a way to provoke a stack underflow using C since stack…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
19
votes
4 answers

How can a stack underflow happen in C++?

What is a simple example in C++ that causes a stack underflow in the case of invoking and returning from method calls? I am familiar with the calling convention, i.e thiscall, stdcall and the cdecl and way they would clean the stack. Wouldn't a…
Vishnu Pedireddi
  • 2,142
  • 4
  • 25
  • 34
16
votes
1 answer

Python unpickling stack underflow

I've been working on a python application, where the client sends a clock signal to the server and the server responds with an audio signal. I have two buttons, one to start the clock and one to pause the track. Main Class # function I call when I…
boortmans
  • 1,138
  • 2
  • 24
  • 40
12
votes
9 answers

How to debug a runtime stack underflow error?

I'm really struggling to resolve a stack underflow that I'm getting. The traceback I get at runtime is: VerifyError: Error #1024: Stack underflow occurred. at flash.events::EventDispatcher/dispatchEventFunction() at…
Russ
  • 10,835
  • 12
  • 42
  • 57
5
votes
1 answer

What could cause a Block stack underflow in python?

The Application Context We are developing an experimental web Framework using "solely" WebOb. We are handling concurrent requests and it's basically a quite simple integration of WebOb. We are hosting our application on webfaction.com The thing is…
David Dugué
  • 155
  • 2
  • 9
3
votes
1 answer

Stack underflow on multiple string concatenations using Gforth

From Rosetta code, I'm using the following as a way to concatenate strings in Forth. s" hello" pad place pad count type s" there!" pad +place pad count type Using this code, I'd like to be able to concatenate multiple strings together. However,…
David
  • 2,080
  • 5
  • 29
  • 44
3
votes
3 answers

How to avoid stackunderflow (use variable # of arguments) in PostScript

I have a simple function with two variables as /func { /var1 exch def /var2 exch def ... process ... } def (var2)(var1)func I want to make var2 optional. However, if not providing var2, it results in stackunderflow error. How can I make a if…
Googlebot
  • 15,159
  • 44
  • 133
  • 229
1
vote
1 answer

Why am I getting a Stack underflow (error 1024) in release build?

I had this strange problem with stack underflow errors happen only in the release build of Flex Builder project. I looked around the web to find a solution, but while I found some related posts, nothing really helped my out. So here is this question…
ADB
  • 2,319
  • 1
  • 24
  • 35
1
vote
2 answers

Stack underflow problem using PIC assembly on a PIC16F84A

I have a small project for a course I am doing that requires us to produce a PWM signal using PIC assembly language. To try and simplify things I have set the high time to 5ms and the low time to 15ms so I can call the same delay sub routine…
iwasjohn
  • 11
  • 2
1
vote
1 answer

Exception in Kaitai Struct Code " java.nio.BufferUnderflowException"

I very newer to kaitai-struct and java. i have parsed .ksy file to target language java,, but after compiling in eclipse ide i am getting " java.nio.BufferUnderflowException". can someone help me.
1
vote
6 answers

Why does not stack overflow/underflow trigger an run-time error?

I use this code snippet: // stackoverflow.c #include #include #include int main(int argc, char** argv) { int i; int a[10]; // init a[-1] = -1; a[11] = 11; printf(" a[-1]= = %d, a[11] = %d\n",…
xjsXjtu
  • 161
  • 2
  • 8
1
vote
1 answer

Android GLException : stack underflow

GL stack underflow happens at glPopMatrix(); I can't figure out the problem I have.. But I just guess push & pop Matrix... I know Popping the stack with nothing on it can occur 'stack underflow... but I don't think I got that problem.. please give…
1
vote
1 answer

glPushName + glPopName stack overflow and underflow

Can anybody explain me how to use glPushName and glPopName. I like to use them instead of glLoadName, but I laways get GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW errors. (First, under then overflow). Example code would help me too. Note #1: My…
drahnr
  • 6,782
  • 5
  • 48
  • 75
0
votes
1 answer

My custom made Stack class is always throwing StackIsUnderflowing Exception : Why?

I have a custom made Stack class that doesn't manipulate arrays but ArrayList. My Stack class has push, pop and size methods. I am tracking the index through an index instance variable. I created an array to hold three elements. These three…
user991511
0
votes
1 answer

Conway's Game of Life Buffer Underflow

I'm pretty new to C and I've heard of Buffer Overflow before but I've never heard of a stack buffer underflow. I've been trying to read up on it and from what I understand, I'm allocating too much memory? I just want to be sure I understand the…
Manav
  • 3
  • 2
1
2