Identify Stack Overflow
Learn how to identify stack overflow, stack boundaries, and reconstruct stack trace.
What is stack overflow?
When an application runs out of memory in the call stack, a stack overflow occurs. It can happen due to an overuse of stack, like in the case of infinite or deep recursion, or when a local variable—like an array—that uses more space than the size of the call stack is declared.
Application source code
We have created a multi-threaded application that encounters a stack overflow and times out during its execution:
As you can see, calling procF will result in infinite recursion, filling up the stack quickly.
Loading the core dump
We will load the core dump file with the following command:
gdb -c core.App6 -se App6
The above command will output the following to the terminal:
Logging the GDB output
It is a ...