Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating a debug heap when not in debugger?

24 views
Skip to first unread message

DanKegel

unread,
Nov 21, 2009, 3:29:10 PM11/21/09
to
I know that when I start my app under windbg, the process heap is
created with HEAP_TAIL_CHECKING_ENABLED, etc.
I'd like to turn that on *outside* of windbg.
I've tried using gflags to turn on "heap tail checking"
(and every other kind of checking) for my image, but
it seems those flags are utterly ignored if not
running in a debugger.

I even tried calling RtlCreateHeap and passing it
HEAP_TAIL_CHECKING_ENABLED
for flags. No joy.

Hmm. Can one call RtlDebugCreateHeap() to do this?

opedroso

unread,
Nov 23, 2009, 9:05:40 AM11/23/09
to

Hi Dan,

Using gflags.exe to enabled heap tail checking works fine for me.
I use the following command line:

gflags -i myapp.exe +htc

This causes myapp.exe to generate an INT 3 when it encounters a double
free. Unless I executed "windbg -I" (which install windbg as my
postmortem debugger of choice), I don't even get to notice this is
happening. Myapp just disappears when the double free takes place.

Hope this helps,
Osiris

0 new messages