This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC - detect static data overruns
On Thu, Aug 07, 2003 at 05:04:39PM -0700, Fred Fish wrote:
> I'd like to get some general comments about whether or not the
> following hack seems like something that should be cleaned up and
> officially submitted for inclusion in gcc.
>
> An extremely common problem is overrunning allocated memory, both
> static and dynamic allocations. There are tools that help with
> dynamically allocated memory, such as Electric Fence, but I've not
> seen much for helping to detect overruns in static data.
>
> As it turns out, a very simple patch to gcc to put guard words with
> known data patterns after every static allocation catches a lot of
> these static data overruns. Attached is a quickie patch I whipped up
> to test this with a mips-elf toolchain, and it immediately found
> dozens of overruns in the code base I'm working with.
>
> If there's enough interest, I'll try to clean things up and submit
> an official patch.
Does mudflap (on tree-ssa) detect this? I imagine so.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer