I'd like to use AppVerifier to find overrun of alocated memory block on the heap. I created simple application with these code: main(...) { char* m=malloc(16); memset(m,0,17); } I have set in AppVerifier test: Basic->Heaps. In Basic->Heap->Properties I have deafult values. I run application under VC++ debugger, I also tried WinDbg. Why AppVerifier does not detect memory corruption ? Peter
When a process is started under debugger the OS enables so called "debug heap" which adds guard bytes after each allocation to help catch corruptions. This however means that appverifier/pageheap are not able to detect small overruns the moment they occur, because the actual user buffer is not immediately followed by an inaccessible page. Debug CRTs also have functionality similar to the OS debug heap. You need to either increase the size of the overrun so that it crosses the page boundary, or make sure debug CRT is not used, and process is not launched under debugger (you can however attach debugger after the process has started). -- This posting is provided "AS IS" with no warranties, and confers no rights. "Peter" wrote: > I'd like to use AppVerifier to find overrun of alocated memory block on > the > heap. > I created simple application with these code: > > main(...) > { > char* m=malloc(16); > memset(m,0,17); > } > > I have set in AppVerifier test: Basic->Heaps. In Basic->Heap->Properties I > have deafult values. I run application under VC++ debugger, I also tried > WinDbg. > Why AppVerifier does not detect memory corruption ?