SOS commands fail while live debugging a process which has multiple versions of CLR loaded

3.8k views Asked by At

I have a ASP.net 2.0 application that I am trying to debug live using Windbg and SOS.dll. When I attach the debugger to the process, I see it loads both 2.0 and 4.0 versions of CLR.[ mscorwks.dll and CLR.dll].I load my SOS by - .loadby sos mscorwks. After this, none of my SOS commands work. I get "Failed to request threadstore", "Unable to get info from System domain" etc.

I learnt this is due to the mismatch in the mscordacwks.dll for the different version of CLR. But all the solutions that I found on google around loading the right version of mscordacwks using cordll command failed to solve my problem. Particularly, I have used .cordll –ve –lp but doesnt seem to make any difference. Upon executing "!threads" commads again, I get

"CLR DLL status: Loaded DLL C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll

Failed to request threadstore"

I have seen another entry in stackoverflow around this problem. But luckily for him the problem disappeared before a solution was suggested and also this is not a duplicate of this entry

Any clue to help me use SOS exention with 2 versions of CLRs loaded into my process would be greatly appreciated.

MSCORDACWKS versions loading behaviour is as follows -

**0:033>** .cordll -e 
CLR DLL status: Loaded DLL C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll 
**0:033>** .cordll -ve -u -lp C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscordacwks.dll
 CLR DLL status: No load attempts 
**0:033>** .cordll -e
 CLR DLL status: No load attempts
 **0:033>** !threads 
CLRDLL: Loaded DLL C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll Failed to request ThreadStore 
5

There are 5 answers

1
Mallika Ravi On BEST ANSWER

I had a case opened on this with MS and the response I got was -

"this is an issue with the debugger and the product team is working on it now. "

I guess I will have to wait for the upcoming releases of windbg to have this fixed or explore other tools!

Thank you!

0
Jonne Kats On

I had the same problem and had contact with Microsoft. Using the latest version of windbg, the on that was released during the BUILD conference, I was able to load the .net 2 version of the data access library.

The Windbg version is included in the Windows 8 driver kit. I was able to load the mscorwks data access library using the following command:

.cordll -I mscorwks -lp <path to mscorwks dll>
0
daseny On

I'm still facing to this problem today.

I found a solution works for me (assume mscordacwks.dll & sos.dll are stored in folder "C:\sos"):

.cordll -I mscorwks -lp "C:\sos"
.loadby sos mscorwks
!clrstack

This solution works for WinDbg of follwing versions:

  1. 10.0.15063 (of Windows Kits 10)
  2. 6.2.9200 (of Windows Kits 8.0)

Has been tested on Win7 x86 & Win10 x64.

0
sali98 On

Today I also have the same problem, all the commands I could find just not work:(

Then I tried to load the dump with a older debugger, it works. My version is 6.7.5.0, fortunately some older versions are still available on my machine:)