在 Windbg 中调试挂起转储时出现问题
加载 sosex 后,出现以下错误。有什么想法吗?挂起转储来自 32 位计算机,我的是 64 位计算机。我需要安装什么东西吗?
!clrstack
CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.3623.dll, Win32 error 0n2
After I've loaded sosex, I'm getting the following error. Any ideas? The hang dump is from a 32 bit machine, mine is 64-bit. Do I need to install something?
!clrstack
CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.3623.dll, Win32 error 0n2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是您计算机上的 mscordacwks 版本与故障转储中的版本不同。这不是位数问题 - 即使您的计算机是 64 位,您也安装了 32 位 .NET。我的位于 C:\Windows\Microsoft.NET\Framework\v2.0.50727 下。
您拥有的副本不会有那么长的名称,它只会被称为 mscordacwks.dll。当调试器发现您的“活动”副本不同时,它会搜索具有长名称的副本(避免 dll 地狱),并且这也会告诉您需要获取哪个版本。在获得正确的 mscordacwks.dll(例如从原始计算机)后,我将其复制到我的框架目录中,并按照错误消息中显示的名称对其进行命名。我还设置了windbg的图像路径以包含框架目录。
sos 必须使用 mscordacwks 框架程序集来理解内存中的数据结构。这一切都在博客文章 “无法加载数据访问 DLL,0x80004005” – 或– mscordacwks.dll 是什么?(来自黑暗角落的笔记博客)。
您会发现互联网上充斥着有关如何获取该 dll 的各种版本的问题。假设您无法从创建故障转储的计算机中获取该文件,并且没有从 microsoft 符号服务器下载该文件,我过去所做的就是在 microsoft.com 中搜索 mscordacwks 和我需要的版本(例如 2.0.50727.3623)。它通常位于您可以下载的安全补丁中。
如果您没有合适的系统来安装它,我很幸运地使用 7zip 打开安装 exe。我在 cab 中找到了 mscordacwks 文件,该文件位于安全补丁安装可执行文件中的补丁文件(MSP 文件)中。其中每一个都可以使用 7zip 打开。
当您打开 CAB 文件时,有时最好使用 Expand.exe,因为它可以解压 7zip (v4.65) 不能解压的文件。如果您使用 7zip 打开具有
_manifest_.cix.xml
的 CAB,请使用 Expand,因为它使用清单来提取、解压缩和重命名内容。 7zip(对...进行简单的提取)会留下一堆以数字命名的文件,字面意思是 1、2 等。这些文件可能仍然被压缩。您知道的方式是,如果您打开它们(例如使用 SciTE),它们将以 PA30 之类的签名开头(它将与清单中的源“类型”属性匹配)。The problem is the version of mscordacwks on your machine is a different version than the one from the crash dump. It's not a bitnesss issue - even though your machine is 64-bit, you have a 32-bit .NET installed. Mine is under C:\Windows\Microsoft.NET\Framework\v2.0.50727.
The copy you have won't have that long name, it'll just be called mscordacwks.dll. When the debugger sees your "active" copy is different, it'll search for one with the long name (avoiding dll hell) and that also tells you what version you need to get. After I get the correct mscordacwks.dll (eg from the original machine), I copy it into my framework directory and name it as it shows in the error message. I also set the image path of windbg to include the framework directory.
sos must use the mscordacwks framework assembly to understand the in memory data structures. This is all explained in the blog post “Failed to load data access DLL, 0x80004005” – OR – What is mscordacwks.dll? on the Notes from a dark corner blog.
You'll find the internet littered with questions about how to get various versions of that dll. Assuming you can't get the one from the machine that created the crash dump and it doesn't get downloaded from the microsoft symbol server, what I've done in the past is search microsoft.com for mscordacwks and the version I need (eg 2.0.50727.3623). It's usually in a security patch you can download.
If you don't have an appropriate system to install it on, I've had luck opening the install exe with 7zip. I've found the mscordacwks file in a cab that was in a patch file (an MSP file) that was in the security patch install executable. Each of those can be opened with 7zip.
When you hit a CAB file, sometimes it's better to use expand.exe as it can decompress files 7zip (v4.65) doesn't. If you open a CAB with 7zip that has an
_manifest_.cix.xml
, use expand instead as it uses the manifest to extract, decompress and rename the contents. 7zip (doing a simple extract to...) leaves it raw with bunches of files named numerically, literally 1, 2, etc. Those files may still be compressed. The way you know is if you open them (eg with SciTE),they'll start with a signature like PA30 (it will match the source "type" attribute from the manifest).