Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

.net 4.0 - Unable to load SOS in WinDbg

Background: I'm new to WinDbg and trying to get it running for the first time. I want to examine a memory dump I took from a running ASP.NET 4 site hosted in IIS 7 on Windows Server 2008 (x86) and downloaded to my local machine.

I installed the debugging tools and launched WinDbg for the first time, opening the crash dump. I went to File | Symbol File Path and set the path to *srv*c:symbols*http://msdl.microsoft.com/download/symbols* and waited for all the symbols to load.

When trying to load SOS, I ran into problems. First, I tried the following command...

.loadby sos mscorwks

...and received the response Unable to find module 'mscorwks'.

After scouring the web, I tried to load mscorwks by executing the following command...

sxe ld mscorwks.dll
g

...and received the response "No runnable debuggees error in 'g'"

I copied SOS.dll (from C:WindowsMicrosoft.NETFrameworkv4.0.30319) into the WinDbg directory, then tried...

.load sos

...and received the error...

The call to LoadLibrary(sos) failed, Win32 error 0n193
    "%1 is not a valid Win32 application."
Please check your debugger configuration and/or network access.

I'm not quite sure how to proceed. I just want to load SOS and dig around this dump file. Any help would be greatly appreciated.

Fyi...I am trying to open the dump file on a 64-bit version of Windows 7 with the 64-bit version of Windbg.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The CLR runtime dll was renamed to clr.dll with .NET 4. So in order to load the correct version of SOS you need to adjust your .loadby command. I.e.

.loadby sos clr

Also, if you're on 64 bit, you should install the 32 bit version of Debugging Tools for Windows as well in order to debug 32 bit apps. They install side-by-side, so there's no problem in having both the 32 bit and the 64 bit version on the same machine.

I would advice against copying SOS.dll. SOS needs to match the exact version of the framework, so as long as you load it from the framework directory using .loadby, you're all set.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...