Re: [ASAP] Stack corruption

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Tim Robinson (tim.gaat.freeserve.co.uk_at_nowhere.com)
Date: 12/19/04


Date: Sun, 19 Dec 2004 16:18:20 +0000

Alexander Grigoriev wrote:
> I'm afraid page heap only works for HeapAlloc functions, not CRT allocation
> (especially the debug one, where it reserves some guard space).
> It's better just to set in the debugger a data breakpoint at the allocation
> end, immediately after allocating the array. This way, the VC debugger will
> stop the program.

Pageheap works fine for CRT allocations, because unless you have VC++ 5
compatibility turned on, malloc and new go straight to HeapAlloc.

Though you're correct in saying that it works best on Release builds.

-- 
Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/


Relevant Pages

  • Re: [ASAP] Stack corruption
    ... > I'm afraid page heap only works for HeapAlloc functions, not CRT allocation ... where it reserves some guard space). ... This way, the VC debugger will ...
    (microsoft.public.dotnet.languages.vc)
  • Re: [ASAP] Stack corruption
    ... > I'm afraid page heap only works for HeapAlloc functions, not CRT allocation ... where it reserves some guard space). ... This way, the VC debugger will ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [ASAP] Stack corruption
    ... > I'm afraid page heap only works for HeapAlloc functions, not CRT allocation ... where it reserves some guard space). ... This way, the VC debugger will ...
    (microsoft.public.vc.mfc)