This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Abnormal behavior of malloc in gcc-3.2.2


On Mon, 21 Nov 2005, Giovanni Bajo wrote:

I didnt get your point. I am allocating space only for 400 inregers
then as soon as in the loop if it crosses the value of 400 , it should
have given a segementation voilation ?

No. For that to happen, you need some memory checker. GCC has -fmudflap, try with that. Recent versions of glibc also have their internal memory buffer checker, it probably triggers the segmentation fault when you free the buffer which you have overflown.

Valgrind will find this error too (www.valgrind.org).


Nick


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