http://en.wikipedia.org/wiki/Call_stack

http://en.wikipedia.org/wiki/Stack_buffer_overflow 

call stack and stack buffer overflow 

Stack_buffer_overflow里提到的frame pointer 的位置不一样,不同的系统实现应该是不一样的。

运行时的栈是从高地址向低地址分配的,堆是从低地址向高地址分配的,如:


 1}

 结果类似是这样的:

1call stack and stack buffer overflow20fa58
2call stack and stack buffer overflow20fa4c
3call stack and stack buffer overflow20fa40
4call stack and stack buffer overflow20fa34
5call stack and stack buffer overflow354bb8
6call stack and stack buffer overflow354bf8

update Apr. 26, 2011:

apue 2nd 7.6. Memory Layout of a C Program:

The stack grows from higher-numbered addresses to lower-numbered addresses on this particular architecture(x86).

call stack and stack buffer overflow

相关文章: