The opposite of a stack overflow, this is condition occurs when the stack pointer moves before the head of the stack. Effectively, more things have been popped from the stack have been pushed onto the stack.

Stack underflow is a different type of condition than stack overflow. Attempting to pop off an empty stack in a program is always a bug indicating a logical design flaw. Attempting to push another value onto a full stack merely indicates a problem with a fixed length stack (or an overfull memory). Underflows are usually easier to identify and fix; however, their potential for damage is usually also much smaller.

Log in or register to write something here or to contact authors.