views:

20

answers:

1

I'm using a 3rd party tool, which uses a 4th party plugin. Occasionally, the tool will hang when launched. Looking at the stack traces, I can see a few threads are waiting on WaitForSingleObject, and my bet is that they're blocking each other. Some of the threads start at the 3rt party tool, and some at the 4th party plugin.

What I'd like to do is file the most detailed complaint to the 3rd party tool vendor, assuming it's its fault (I don't trust their local support to get those details themselves). For that, I'd like to:

  1. Find out what are the synchronization objects currently waited on
  2. Find out who has created those synchronization objects

Tools currently at hand are VS2005, WinDbg and Process Explorer. OS is Window 7 64 bit. Any suggestions?

+1  A: 

I'm used to WinDBG, so I can give you a few things to try there. First is to get your symbols right:

.symfix c:\websymbols .reload

And your stack frame depth cranked up:

.kframes 1000

Then I'd go for !uniqstack, which will eliminate duplicate stacks and save you some time:

!uniqstack -b

Then it's a matter of picking through and trying to find the circular dependency. Unfortunately hard to give much guidance without more info about the hang. You can also try !locks to see if that figures it out for you (only going to help for critical section deadlocks).

Figuring out what synchronization objects it's waiting on is much easier from a kernel debug session, from user mode you're going to need to track down the handles and do a !handle on each. Is the exe 32bit or 64bit?

In terms of figuring out who created the objects, your best bet is to turn on handle tracing via !htrace, run the scenario, and then dump the trace log out.

Good luck,

-scott

snoone