Monday, May 10, 2010

Mudflap - Instrumentation of pointers

Heard of mudflap? This technology is exciting in the sense that it allows one to instrument C/C++ pointers that it finds to be error prone to cause an application to crash and its got potential. Read about the wiki and download the original paper.

It is enabled by passing -fmudflap to the compiler. For front-ends that support it (C and very simple C++ programs), it instruments all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests. Modules so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors. The instrumentation relies on a separate runtime library (libmudflap), which will be linked into a program if -fmudflap -lmudflap is given at link time. Run-time behavior of the instrumented program is controlled by the MUDFLAP_OPTIONS environment variable.

0 comments: