Following is what I did
1) Open Gflags.exe and set the image name,checked the Enable Application
verifier and set the stackBacktrace to 10
2)Open Windbg and set the symbol path,source path and image path
3)Opened my application through windbg
4) gave the !htrace -enable command
5) Allowed the application to run to create handle leak
6)gave the !htrace -diff command
7)The output was someting like this
0:005> !htrace -diff
Handle tracing information snapshot successfully taken.
0x79 new stack traces since the previous snapshot.
Ignoring handles that were already closed...
Outstanding handles opened since the previous snapshot:
--------------------------------------
Handle = 0x00000000000001d4 - OPEN
Thread ID = 0x0000000000001190, Process ID = 0x00000000000011a8
0x0000000077ef0e6a: ntdll!NtCreateEvent+0x000000000000000a
--------------------------------------
Displayed 0x1 stack traces for outstanding handles opened since the previous
snapshot.
how can I see the sourcecode/function calls of my code which lead to the
event creation?
!htrace <handle>
Output of !htrace -diff
Handle = 0x0000000000000340 - OPEN
Thread ID = 0x00000000000013c8, Process ID = 0x0000000000001198
0x0000000077ef0e6a: ntdll!NtCreateEvent+0x000000000000000a
Output of !htrace <handle> command for teh above handle
0:003> !htrace 0x0000000000000340
Handle = 0x0000000000000340 - OPEN
Thread ID = 0x00000000000013c8, Process ID = 0x0000000000001198
0x0000000077ef0e6a: ntdll!NtCreateEvent+0x000000000000000a
Parsed 0x404 stack traces.
Dumped 0x1 stack traces.
Any help on what I am missing/doing wrong that these commands are not giving
the expected output
Thanks
Anitha
"cap...@yahoo.co.uk" wrote:
> On 9 Feb, 14:48, Anitha <Ani...@discussions.microsoft.com> wrote:
> > Hi,
> > I am trying to use the htrace command to detect handle leak in my program.I
> > created a sample program in C# that creates events and leak event handles..
lookis like you have a native frame:
0x0000000077ef0e6a: ntdll!NtCreateEvent+0x000000000000000a
thats it load the right SOS and check !clrstack works then try again
What Windows version are you using? I expect deeper stack traces than the
ones from your example below only on Windows Vista SP1 or newer OS versions
for x64 systems. x86 worked better even before Vista SP1.
Dan
−−
This posting is provided "AS IS" with no warranties, and confers no rights.
"Anitha" <Ani...@discussions.microsoft.com> wrote in message
news:15BE83DF-D4BB-4B18...@microsoft.com...