I know that the maximum size of a program stack which can be used on my machine is 8192 kbytes (according to ulimit -a | grep "stack size"
).
I also know that Linux uses ASLR. I use a 64-bit system with the gcc compilerflag -m32
.
Is it therefore true that the total amount of local variables can only take up a maximum of 8192 kbytes? Is it possible that it touches the heap before this maximum is taken up? Or will the heap take care of not growing too much?
What is the possible range of addresses of local variables according to ASLR? Can I create a local variable at address 0xf740d25a, 0x7ffXXXXX, 0xaXXXXXX or 0x1XXX where X is any hexadecimal digit?