Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to do with "The version of SOS does not match the version of CLR you are debugging" in WinDbg?

I'm having a problem with some of my apps. It's a wcf-based app running under IIS6 in Windows 2003 Server (x86):
In Event Log I get such an error from "W3SVC-WP" source (EventID=2262):

ISAPI 'C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'. 

I'm trying figuring out what's going on. I've set up creating dump for Orphan Worker Process as described in this KB. When an deadlock occured a minidump is created.
Then I take this minidump to try to understand what's happened. Here's I'm stuck.

I run WinDbg x86, open my dump and then:

0:037> .loadby sos clr 0:037> .sympath SRV*c:\temp\symbols*http://msdl.microsoft.com/download/symbols Symbol search path is: SRV*c:\temp\symbols*http://msdl.microsoft.com/download/symbols Expanded Symbol search path is: srv*c:\temp\symbols*http://msdl.microsoft.com/download/symbols 0:037> !clrstack The version of SOS does not match the version of CLR you are debugging.  Please load the matching version of SOS for the version of CLR you are debugging. CLR Version: 4.0.30319.1 SOS Version: 4.0.30319.235 CLRDLL: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll:4.0.30319.235 f:8 doesn't match desired version 4.0.30319.01 f:8 CLRDLL: Loaded DLL c:\temp\symbols\mscordacwks_x86_x86_4.0.30319.01.dll\4BA1D9EF66f000\mscordacwks_x86_x86_4.0.30319.01.dll OS Thread Id: 0x690 (37) Unable to walk the managed stack. The current thread is likely not a managed thread. You can run !threads to get a list of managed threads in the process 

What to do with this error - "The version of SOS does not match the version of CLR you are debugging" ?

The same error ("The version of SOS does not match the version of CLR you are debugging") I'm getting when I open the minidump in VS2010.

I've read this post - http://tech-thinker.com/Forums/tabid/62/forumid/12/postid/471/scope/posts/Default.aspx, and tried installing KB2518870. It doesn't help.

like image 455
Shrike Avatar asked Sep 15 '11 12:09

Shrike


People also ask

Where can I find SOS DLL?

You can find it in C:\WINDOWS\Microsoft.NET\Framework\v4. 0.30319\sos. dll path. To get SOS automatically downloaded you need to have the Microsoft symbol servers set up in the _NT_SYMBOL_PATH environment variable.


2 Answers

This is what worked for me:

Download the following DLLs:

  • clr.dll
  • mscordacwks.dll
  • SOS.dll

from this folder on the machine that generated the dump:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Run the following command. The path to SOS.DLL should be without quotes, unescaped path delimiters:

.load path to downloaded SOS.DLL

I think a new WinDbg session is required for this to work.

like image 80
Thomas Bratt Avatar answered Oct 10 '22 23:10

Thomas Bratt


WinDbg will not be able to use the debugging adapter mscordacwks.dll unless it is the same version as the one from the original machine. You can get around this error by copying this DLL from the target machine which generated the dump to your Debugging Tools for Windows directory.

We debug .NET 2.0 applications with WinDbg. We would continually get this same error regarding mscordacwks_x86_x86_2.0.50727.3615.dll. I had to copy this file from the server onto my client and put it in the C:\Program Files\Debugging Tools for Windows (x86)\ folder. WinDbg stopped complaining after that.

If all else fails, you can try debugging with WinDbg on the same server from which you retrieved the crash dump.

like image 40
Paul Williams Avatar answered Oct 10 '22 22:10

Paul Williams