liveBook · Manning

Stack overflow

Also called StackOverflowError

A stack overflow is a runtime failure caused by exhausting the available capacity of a program’s call stack.

How 2 Manning books explain it

Embedded Software with Rust

Stack overflow is the exhaustion of a thread's stack space by nested calls, local data, or other stack allocation.

How it is used
Addresses silent memory corruption in resource-constrained, single-stack bare-metal firmware.
How deep it goes
Explains overflow mechanics and layered defenses, including linker layout and MPU registers, while deferring multi-task stack management.
Examples
Uses a recursive function with a 1 KiB local buffer, a flip-link configuration, and a 32-byte MPU guard.
What you can do after
Operate and configure flip-link and MPU guards to turn stack overflows into diagnosable faults.

Read how Embedded Software with Rust explains stack overflow →

100 Java Mistakes and How to Avoid Them

A stack overflow is exhaustion of the call stack caused by excessive or unbounded nested execution.

How it is used
Warns against recursion whose excessive depth or repeated state exhausts a thread’s call stack.
How deep it goes
Explains JVM-dependent limits, tail-call elimination, loop rewrites, and cyclic traversal, without providing a fixed safe recursion depth.
Examples
Uses tail-recursive string search, tree traversal, button delegation, and self-referential lists.
What you can do after
Diagnose/debug with it by separating deep finite recursion from unchanged-state recursion and cyclic traversal.

Read how 100 Java Mistakes and How to Avoid Them explains stack overflow →

Also covered in

What to know first

Related concepts

Questions about stack overflow

What is stack overflow?

A stack overflow is a runtime failure caused by exhausting the available capacity of a program’s call stack.

Which Manning books explain stack overflow?

Embedded Software with Rust and 100 Java Mistakes and How to Avoid Them.

What should I know before learning stack overflow?

Manning books that teach stack overflow usually introduce recursion, performance, Rust and stack pointer first.

What is stack overflow also called?

Stack overflow is also called StackOverflowError.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.