T
Tomás Ó hÉilidhe
When mudflap detects a dodgy memory access, I want it to kill the
program straight away and tell me about the dodgy memory access. I
*don't* want it to continue on with execution of the program.
I'm running Linux on x86 (Ubuntu 8.10). Here's my failed attempt at
getting it to work:
toe ~ $ MUDFLAP_OPTIONS='-viol-abort -print-leaks -check-
initialisation -abbreviate -backtrace=4'
toe ~ $ cat code.c
int main(void)
{
int arr[5];
int *p;
for (p = arr; p != arr+11; ++p)
*p = 15;
return 0;
}
toe ~ $ gcc -g -fmudflap -lmudflap -o code code.c
toe ~ $ ./code
*******
mudflap violation 1 (check/write): time=1229149585.144550
ptr=0xbfecd97c size=4
pc=0xb7fc08ed location=`code.c:8:9 (main)'
/usr/lib/libmudflap.so.0(__mf_check+0x3d) [0xb7fc08ed]
./code(main+0xb6) [0x804883a]
/usr/lib/libmudflap.so.0(__wrap_main+0x4f) [0xb7fc134f]
Nearby object 1: checked region begins 1B after and ends 4B after
mudflap object 0x9c08040: name=`code.c:3:9 (main) arr'
bounds=[0xbfecd968,0xbfecd97b] size=20 area=stack check=0r/5w
liveness=5
alloc time=1229149585.144530 pc=0xb7fc12ed
number of nearby objects: 1
*******
mudflap violation 2 (check/write): time=1229149585.145060 ptr=0x13
size=4
pc=0xb7fc08ed location=`code.c:8:9 (main)'
/usr/lib/libmudflap.so.0(__mf_check+0x3d) [0xb7fc08ed]
./code(main+0xb6) [0x804883a]
/usr/lib/libmudflap.so.0(__wrap_main+0x4f) [0xb7fc134f]
Nearby object 1: checked region begins 19B after and ends 22B after
mudflap object 0x9c07160: name=`NULL'
bounds=[(nil),(nil)] size=1 area=no-access check=0r/0w liveness=0
alloc time=1229149585.144429 pc=0xb7fc12ed
number of nearby objects: 1
Segmentation fault
toe ~ $
Anyone know how to get this to work? By the way I searched the web for
a mudflap forum but couldn't find one.
program straight away and tell me about the dodgy memory access. I
*don't* want it to continue on with execution of the program.
I'm running Linux on x86 (Ubuntu 8.10). Here's my failed attempt at
getting it to work:
toe ~ $ MUDFLAP_OPTIONS='-viol-abort -print-leaks -check-
initialisation -abbreviate -backtrace=4'
toe ~ $ cat code.c
int main(void)
{
int arr[5];
int *p;
for (p = arr; p != arr+11; ++p)
*p = 15;
return 0;
}
toe ~ $ gcc -g -fmudflap -lmudflap -o code code.c
toe ~ $ ./code
*******
mudflap violation 1 (check/write): time=1229149585.144550
ptr=0xbfecd97c size=4
pc=0xb7fc08ed location=`code.c:8:9 (main)'
/usr/lib/libmudflap.so.0(__mf_check+0x3d) [0xb7fc08ed]
./code(main+0xb6) [0x804883a]
/usr/lib/libmudflap.so.0(__wrap_main+0x4f) [0xb7fc134f]
Nearby object 1: checked region begins 1B after and ends 4B after
mudflap object 0x9c08040: name=`code.c:3:9 (main) arr'
bounds=[0xbfecd968,0xbfecd97b] size=20 area=stack check=0r/5w
liveness=5
alloc time=1229149585.144530 pc=0xb7fc12ed
number of nearby objects: 1
*******
mudflap violation 2 (check/write): time=1229149585.145060 ptr=0x13
size=4
pc=0xb7fc08ed location=`code.c:8:9 (main)'
/usr/lib/libmudflap.so.0(__mf_check+0x3d) [0xb7fc08ed]
./code(main+0xb6) [0x804883a]
/usr/lib/libmudflap.so.0(__wrap_main+0x4f) [0xb7fc134f]
Nearby object 1: checked region begins 19B after and ends 22B after
mudflap object 0x9c07160: name=`NULL'
bounds=[(nil),(nil)] size=1 area=no-access check=0r/0w liveness=0
alloc time=1229149585.144429 pc=0xb7fc12ed
number of nearby objects: 1
Segmentation fault
toe ~ $
Anyone know how to get this to work? By the way I searched the web for
a mudflap forum but couldn't find one.