无法在 WinDbg 中加载 SOS
背景:我是 WinDbg 的新手,并尝试第一次运行它。我想检查从 Windows Server 2008 (x86) 上的 IIS 7 中托管的正在运行的 ASP.NET 4 站点获取的内存转储,并将其下载到我的本地计算机。
我安装了调试工具并第一次启动WinDbg,打开崩溃转储。我去了文件|符号文件路径并将路径设置为*srv*c:\symbols*http://msdl.microsoft.com/download/symbols*
并等待所有符号加载。
当尝试加载 SOS 时,我遇到了问题。首先,我尝试了以下命令...
.loadby sos mscorwks
...并收到响应无法找到模块“mscorwks”
。
在浏览网页后,我尝试通过执行以下命令来加载 mscorwks...
sxe ld mscorwks.dll
g
...并收到响应“'g'中没有可运行的调试程序错误”
我复制了 SOS.dll (来自 C:\Windows\Microsoft.NET \Framework\v4.0.30319) 进入 WinDbg 目录,然后尝试...
.load sos
...并收到错误...
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.
我不太确定如何继续。我只想加载 SOS 并挖掘这个转储文件。任何帮助将不胜感激。
仅供参考...我正在尝试使用 64 位版本的 Windbg 在 64 位版本的 Windows 7 上打开转储文件。
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:\Windows\Microsoft.NET\Framework\v4.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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
CLR 运行时 dll 在 .NET 4 中已重命名为 clr.dll。因此,为了加载正确版本的 SOS,您需要调整 .loadby 命令。另外
,如果您使用的是 64 位,则应该安装 32 位版本的 Windows 调试工具 以及调试 32 位应用程序。它们并行安装,因此在同一台计算机上同时安装 32 位和 64 位版本没有问题。
我建议不要复制 SOS.dll。 SOS 需要匹配框架的确切版本,因此只要您使用
.loadby
从框架目录加载它,就万事大吉了。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.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.WinDbg 命令“g”表示[继续]
由于您正在打开转储文件,因此无法“继续”,它只包含进程内存。
因此,消息“No runnable debuggees error in 'g'”在您的情况下是合乎逻辑的,因为进程没有运行。
关于加载正确版本的 SOS,请根据 .NET 版本使用以下命令。
.NET 4 及更高版本 .loadby sos
.NET 3.5 和 2
.loadby sos mscorwks
.NET 1.0 和 1.1
.load clr10\sos
The WinDbg command 'g' means [Continue]
Since you're opening a dump-file there is no way to 'continue', it only contains the process memory.
So the message " No runnable debuggees error in 'g' " is logical in your case since the process is not running.
Concerning loading the correct version of SOS use the following command depending on the .NET version.
.NET 4 and higher .loadby sos
.NET 3.5 and 2
.loadby sos mscorwks
.NET 1.0 and 1.1
.load clr10\sos
上面的答案需要改进,因为随着时间的推移,处理 sos 加载变得更容易了。
JOHN ROBBINS 有一篇不错的文章 围绕它,看到 Microsoft 符号服务器在符号文件路径中配置并在 Windbg 提示符下运行 !analyze -v,这将起到下载相关 sos 文件的作用。
要验证,请在提示符下运行 .chain,您将看到加载的 dll。
Answers above need improvement, since over the course of time things has been easier to handle sos loading.
JOHN ROBBINS has nice article around it, See that Microsoft symbol servers are configured in symbol file path and run !analyze -v on windbg prompt, this will do the trick it will download relevant sos files.
To verify run .chain on the prompt and you will see the loaded dll.
刚刚在加载 SOS 时遇到了类似的问题,并收到“找不到指定的模块”。想出了一个不同的解决方案,所以如果这里的解决方案对您没有帮助,请尝试一下:
.loadby sos clr - 找不到指定的模块
Just came across a similar issue loading SOS and was getting "specified module could not be found". Came up with a different solution so if the solutions here don't help you, try this out:
.loadby sos clr - specified module could not be found