http://dotnetdebug.net/2005/06/07/identifying-deadlocks-in-managed-code/

Basically you find the CLR stack trace of all your threads that are
currently waiting (that's the Index column I believe - I always forget this
one for some reason), you find the CLR stack trace of all the threads that
own a lock (that's the Monitor Held column), then look at your code and
figure out how it happened (perhaps there's an easier way, but I do it this
way).

I've never used SOSEX, but I'm good enough at causing deadlocks that I'm
sure I'll be using it sometime in the near future. :)

Adam..

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Peter Osucha
Sent: Friday, February 22, 2008 8:07 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Multiple Threads and app lockup

Thanks, Steve, for the link.  I'm finding the debugger more difficult to
understand than I had hoped.  Any good documentation/link that I can
read so I more clearly understand what the listings of a !syncblk (or
!dlk) command mean?

Peter

PDB symbol for mscorwks.dll not loaded
Index SyncBlock MonitorHeld Recursion Owning Thread Info  SyncBlock
Owner
  128 0018b57c           11         1 00227008   cc0  25   013077f8
System.IO.Ports.SerialStream
  152 0018bbac           15         1 001f70e8   c70  19   01306138
System.IO.Ports.SerialStream
  154 0018bc0c           11         1 001e7728   c68  18   01308d1c
System.IO.Ports.SerialStream
  160 0018bd2c            3         1 001e7728   c68  18   012fcf98
System.Object
  165 0018b6fc            1         1 00237008   c8c  23   012fe134
System.Object
  166 0018be7c            1         1 001f70e8   c70  19   012fabf8
System.Object
  171 0018beac            1         1 00227008   cc0  25   012fbdfc
System.Object
  173 0018bdec            7         1 00237008   c8c  23   0130a370
System.IO.Ports.SerialStream
-----------------------------
Total           175
CCW             2
RCW             1
ComClassFactory 0
Free            45



-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson
Sent: Thursday, February 21, 2008 9:46 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Multiple Threads and app lockup

On Thu, Feb 21, 2008 at 3:48 PM, Adam Sills <[EMAIL PROTECTED]>
wrote:

> If you have a deadlock caused by locks, you can load the sos dll and
run
> !SyncBlk to find all waiting threads and also find out which code
holds
> the
> locks.
>

Shameless plug: Easier yet, try the !dlk command of my SOSEX extension
(free
download).  It does all the work for you when it comes to finding
SynkBlk
deadlocks.

http://www.stevestechspot.com/SOSEXUpdatedV11Available.aspx

--
Steve Johnson

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to