From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: cgf@redhat.com Cc: meissner@cygnus.com, gdb@sources.redhat.com Subject: Re: alloca is bad? Date: Fri, 10 Nov 2000 02:40:00 -0000 Message-id: <200011101040.FAA29793@indy.delorie.com> References: <20001109212032.A26464@redhat.com> <20001109213750.28987@cse.cygnus.com> <20001109222231.A26675@redhat.com> X-SW-Source: 2000-11/msg00063.html > Date: Thu, 9 Nov 2000 22:22:31 -0500 > From: Christopher Faylor > > You can, of course, have array overruns with an alloca'ed buffer just > like you can with a malloced array. IMHO, buffer overruns are irrelevant to this issue, since they happen with automatic arrays as well, and are equally hard (or simple) to track. > Hmm. I think that Purify actually does help track down stack corruption > so there is at least one tool for this. I've never used Electric Fence > but I would be surprised if it was completely trivial to use and I would > be equally surprised if linking with Electric Fence automatically > pinpointed heap problems in every case. You are right, as long as my experience goes. Malloc debuggers are anything but trivial to use, and some large programs which allocate memory all the time, such as Emacs, are practically impossible to debug using these tools, at least those of them which use page protection to catch buffer overruns.