Skip to content
Latchkey

What Is a Stack Frame?

A stack frame is the region of the call stack pushed when a function is invoked and popped when it returns. It stores the call arguments, local variables, saved registers, and the address to return to. The chain of active frames forms the call stack that debuggers and stack traces display.

Why it matters

Stack frames are why local variables are cleaned up automatically on return and why deep or infinite recursion causes stack overflow. Reading frames is central to interpreting stack traces during debugging.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →