#include #include #include #include #include #include void watch(long depth, char *map) { int i; for (i = 0; i < 0x10000; i++) { if (map[i]) { printf("Found %x at %p\n", map[i], &map[i]); exit(1); } } if (++depth % 5000 == 0) printf("now at stack depth %ld\n", depth); watch(depth, map); /* won't get here .. but stop compiler from doing tail recursion */ for (i = 0; i < 0x10000; i++) { if (map[i]) { printf("Found %x at %p\n", map[i], &map[i]); exit(1); } } } main() { char *p; p = mmap((void *)0x6008000000000000, 0x10000, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0L); printf("%p\n", p); memset(p, '\0', 0x10000); watch(0, p); return 0; }