Discovering which critical sections threads are in

Eric Pouech pouech-eric at
Wed Jun 11 15:31:39 CDT 2003

> The null ebp at the top is kind of odd, I think this stack might be the
> result of a demarshalled RPC call. But anyway. As you can see it's
> blocking on a critical section, but I don't know how to find out which
> thread has got suck inside it. I tried putting trace statements in
> Rtl(Enter/Leave)CriticalSection, oops, not a good idea, waaaay too much
> spew there to be useful.
> So, what I'd like to know is whether there is any way to find out which
> thread has entered that critical section. Also, is this even a good
> idea, or is there a better way to debug thread deadlocks?
> thanks -mike
normally there's a message printed out when a critsect times out like:
section 0x12345678 myCS wait timed out, retrying (60 sec) tid=xxxx
and the tid gives you the thread id of the thread holding the cs
then, you can use it for example in 'bt <tid>' to get a backtrace of 
that particular thread and look at what it's doing


Eric Pouech

More information about the wine-devel mailing list