alloca is bad?

Christopher Faylor cgf@redhat.com
Sat Nov 11 16:13:00 GMT 2000


On Sat, Nov 11, 2000 at 07:51:36PM +0000, Fernando Nasser wrote:
>Someone said that heap corruption was harder to track than stack
>corruption.
>
>I couldn't disagree more.  Many (most?) of the times the function tries
>to return and gets a buggy return address and frame pointer.
>It then crashes and you have no idea where it happened.

Someone, i.e., me, has pointed out that stack overruns happen when you
use auto arrays and pointers to auto variables.  I don't see how you can
use this as an argument unless you are advocating that we should only
use static variables.

cgf


More information about the Gdb mailing list