Operating systems · Memory management

Stack Overflow (computing)

In Spanish: Desbordamiento de Pila
See in the galaxyCopy link
Updated: 12/11/2026Reading: 2 min

Description

Stack overflow is an error that occurs when a program uses more stack space than has been allocated. The stack is a data structure used to store information temporarily, such as local variables and function return addresses. Each time a function is called, space is reserved on the stack for its local variables and, when the function finishes, this space is released. However, if a program makes too many recursive function calls or if large amounts of memory are used on the stack, the stack limit can be exceeded, causing an overflow. This type of error can result in unexpected behavior, such as data corruption, program crashes, or even security vulnerabilities that can be exploited by attackers. Stack overflow is a common problem in programming languages that do not automatically manage memory, such as C and C++, and is a critical aspect to consider in secure and robust software development.

History

The concept of stack overflow has existed since the beginnings of programming in low-level languages, such as assembly and C, in the 1970s. One of the most notable incidents occurred in 1988 with the Morris worm, which exploited a stack overflow in Unix systems, leading to greater awareness of security in programming. Over the years, various techniques and tools have been developed to detect and prevent this type of error, including static code analysis and defensive programming techniques.

Uses

Stack overflow is primarily used as a term in the field of programming and computer security. It is fundamental in identifying vulnerabilities in applications, especially in those that use programming languages that do not automatically manage memory. Developers must be alert to this type of error to ensure the stability and security of their applications.

Examples

A classic example of stack overflow is the case of a recursive function that does not have an adequate exit condition. For example, a function that calls itself without a limit can cause a stack overflow. Another case is the excessive use of large local variables in a function, which can quickly exhaust the available stack space.

Glosarix on your device

Install
×
Enable Notifications Ok No