> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/etc/system-internals/call-stacks.md).

# Call stacks

호출 스택은 프로그램이 함수들을 호출할 때, 각 함수의 실행 상태를 순서대로 쌓는 메모리 공간입니다.

대부분의 현태 CPU 아키텍처에서 스택은 높은 주소에서 낮은 주소로 내려가기 때문에, 실제 함수의 호출 순서와 반대인 LIFO(Last in first out) 구조를 가집니다.

<figure><img src="/files/lnXHVFiG5pNctToWgCkF" alt=""><figcaption><p><a href="https://velog.io/@rany/Data-Structure-3.-%EC%8A%A4%ED%83%9D">https://velog.io/@rany/Data-Structure-3.-%EC%8A%A4%ED%83%9D</a></p></figcaption></figure>

&#x20;`func1 → func2 → func3` 와 같이 순서대로 실행되는 함수를 빌드하여 호출 스택을 확인하면 스택의 제일 높은 주소에 func3이 있는 것이 확인됩니다.

<figure><img src="/files/wGTN4ehK30TLwW7H9Z6L" alt=""><figcaption></figcaption></figure>
