This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alloca is bad?


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.

The heap contents won't make it into your stack related registers,
so when something tries to use the data and crashes you still have a starting
point (it may be much latter, but at least you have somewhere to start.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]