I want to detect stack overflow or corruption in my code. Hence, i wrote a small program where stack overflow i开发者_开发技巧s simulated. I compiled it using the command:
gcc overflow.c -g -fstack-protector-all
However, upon executing the binary i got segmentation fault but no other information. Can anybody please help me where did i go wrong?
If ulimit -c
is set to a value much bigger than zero, a core dump named core
is written; you can see the backtrace via running gdb program core
and then typing backtrace
at the prompt.
精彩评论