Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Tue, 14 Aug 2007 10:40:02 -0700,    group: microsoft.public.win32.programmer.tools        back       


AppVerifier and memory block corruption   
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
date: Tue, 14 Aug 2007 10:40:02 -0700   author:   Peter

Re: AppVerifier and memory block corruption   
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 ?
date: Thu, 16 Aug 2007 20:45:44 -0700   author:   Pavel Lebedinsky [MSFT]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us