fremag / MemoScope.Net

Dump and analyze .Net applications memory ( a gui for WinDbg and ClrMd )
The Unlicense
693 stars 75 forks source link

Automatic deadlocks detection #203

Open gubenkoved opened 6 years ago

gubenkoved commented 6 years ago

It would be very helpful to exercise WinDbg SOSEX plugin's automatic deadlock detection mechanism (command !dlk). It will allow catching "easy" deadlocks (which is majority of cases) very quickly.

Details about SOSEX WinDbg extension: http://www.stevestechspot.com/SOSEXANewDebuggingExtensionForManagedCode.aspx

Example of raw output of SOSEX !dlk:

0:164> !dlk
Examining SyncBlocks...
Scanning for ReaderWriterLock(Slim) instances...
Scanning for holders of ReaderWriterLock locks...
Scanning for holders of ReaderWriterLockSlim locks...
Examining CriticalSections...
Scanning for threads waiting on SyncBlocks...
Scanning for threads waiting on ReaderWriterLock locks...
Scanning for threads waiting on ReaderWriterLocksSlim locks...
Scanning for threads waiting on CriticalSections...
*DEADLOCK DETECTED*
CLR thread 0xd4 holds the lock on SyncBlock 00000249f2abbd98 OBJ:00000247ab61ae28[System.Object]
...and is waiting for the lock on SyncBlock 00000249ed62bd08 OBJ:00000248ab70e1b0[log4net.Appender.RollingFileAppender]
CLR thread 0xce holds the lock on SyncBlock 00000249ed62bd08 OBJ:00000248ab70e1b0[log4net.Appender.RollingFileAppender]
...and is waiting for the lock on SyncBlock 00000249f2abbd98 OBJ:00000247ab61ae28[System.Object]
CLR Thread 0xd4 is waiting at log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)(+0xf IL,+0x46 Native)
CLR Thread 0xce is waiting at System.Diagnostics.TraceInternal.WriteLine(System.String)(+0x17 IL,+0x86 Native) [f:\dd\NDP\fx\src\compmod\system\diagnostics\TraceInternal.cs @ 460,56]
fremag commented 6 years ago

Hi,

Thanks for the idea. Today, there is already something to see deadlocks with Blocking objects module.

I agree it's not as automatic as the feature you describe. Unfortunately, I don't have a lot of time to work on Memoscope at the moment so I keep this feature request in my todo list (unless someone sends me a pull request).

EwgenyFedotov commented 4 years ago

It would be very helpful to exercise WinDbg SOSEX plugin's automatic deadlock detection mechanism (command !dlk). It will allow catching "easy" deadlocks (which is majority of cases) very quickly.

Details about SOSEX WinDbg extension: http://www.stevestechspot.com/SOSEXANewDebuggingExtensionForManagedCode.aspx

Example of raw output of SOSEX !dlk:

Looks like http://www.stevestechspot.com isn't working anymore. Could you share this library?

gubenkoved commented 4 years ago

It would be very helpful to exercise WinDbg SOSEX plugin's automatic deadlock detection mechanism (command !dlk). It will allow catching "easy" deadlocks (which is majority of cases) very quickly. Details about SOSEX WinDbg extension: http://www.stevestechspot.com/SOSEXANewDebuggingExtensionForManagedCode.aspx Example of raw output of SOSEX !dlk:

Looks like http://www.stevestechspot.com isn't working anymore. Could you share this library?

There must have been a glitch on the site, it works for me now.

EwgenyFedotov commented 4 years ago

Details about SOSEX WinDbg extension: http://www.stevestechspot.com/SOSEXANewDebuggingExtensionForManagedCode.aspx Example of raw output of SOSEX !dlk:

Looks like http://www.stevestechspot.com isn't working anymore. Could you share this library?

There must have been a glitch on the site, it works for me now.

Home page works for me as well, but all links are broken or something. It is not possible to download any extension. For instance www.stevestechspot.com/downloads/sosex_64.zip doesn't work.