develooper Front page | perl.perl5.porters | Postings from July 2007

Re: something to try out: gcc -fmudflap

Thread Previous
From:
Andy Dougherty
Date:
July 31, 2007 05:55
Subject:
Re: something to try out: gcc -fmudflap
Message ID:
Pine.LNX.4.64.0707310852580.3095@fractal.phys.lafayette.edu
On Tue, 31 Jul 2007, Jarkko Hietaniemi wrote:

> Apparently gcc (4) has gained a new interesting flag, -fmudflap, which
> causes gcc to instrument memory operations, so that in runtime memory
> access errors can be caught (a la valgrind, a la Purify, a la etc.)
> 
> Something like this should work:
> 
> cat > mud.c
> int main() {
>   char buf[100];
>   buf[100] = 0;
> }
> ^D
> gcc -o mud -fmudflap mud.c -lmudflap
> ./mud
> ***KABOOM***

Nice!

> I'm saying "apparently" and "should work" because none of the gccs
> I have available have this feature installed even though the gcc man
> page knows about this feature.  What happens for me is this:
> 
> cc1: error: mf-runtime.h: No such file or directory
> 
> If someone feels like looking into this (starting from what the heck
> needs to be installed), a patch for Makefile.SH and t/TEST and
> pod/perlhack.pod a la valgrind etc. would be cool.

On Debian/etch, mf-runtime.h is part of the libmudflap0-dev package.  
Perhaps you have just the runtime libmudflap0 package installed?

-- 
    Andy Dougherty		doughera@lafayette.edu

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About