int main()
{
- VALGRIND_CREATE_BLOCK(0x1000, 0x1000, "magic foople zone");
- *(char *)0x1000 = 'x';
- return 0;
+ char magic_foople_zone[0x1000];
+ VALGRIND_CREATE_BLOCK(magic_foople_zone, 0x1000, "magic foople zone");
+ VALGRIND_MAKE_MEM_NOACCESS(magic_foople_zone, 0x1000);
+ magic_foople_zone[0] = 'x';
+ return 0;
}
Invalid write of size 1
- at 0x........: main (describe-block.c:6)
+ at 0x........: main (describe-block.c:8)
Address 0x........ is 0 bytes inside a magic foople zone of size 4,096 client-defined
- at 0x........: main (describe-block.c:5)
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
at 0x........: main (describe-block.c:6)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
- The main thread stack size used in this run was ....
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
malloc/free: in use at exit: ... bytes in ... blocks.