问题
有很多手动方法可以让 WinDBG 在没有符号存储的情况下找到 mscordacwks.dll(将文件放在某个路径中,将其放在与 Windbg.exe 相同的文件夹中,将其放在我的 Framework\v 文件夹中,在使用WinDBG.cordll -lp c:\dacFolder
等),但它们都只修复它me。我需要更普遍地修复它每个使用我的符号商店的人.
我能想到的可能的解决方案是:
- WinDBG 使用 mscordacwks.dll 的子文件夹名称而不是 mscorwks.dll 的文件夹名称来检查符号存储。
- SymStore.exe 将 mscordacwks.dll 添加到 mscorwks.dll 的子文件夹名称下,以便 WinDBG 在查找时找到它。
Q: 这些事情是否可能,或者是否有另一种我没有想到的方法来解决问题?
的背景
在分析 .NET 进程时,我遇到了(显然很常见)问题:psscor2(和 sosex)无法在我的计算机上找到适当的 mscordacwks.dll。 WinDBG 中的错误是:
Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
2) the file mscordacwks.dll that matches your version of mscorwks.dll is
in the version directory
3) or, if you are debugging a dump file, verify that the file
mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
4) you are debugging on the same architecture as the dump file.
For example, an IA64 dump file must be debugged on an IA64
machine.
You can also run the debugger command .cordll to control the debugger's
load of mscordacwks.dll. .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.
If you are debugging a minidump, you need to make sure that your executable
path is pointing to mscorwks.dll as well.
关于这个问题有很多问题,也有很多好的答案,几乎所有这些问题最终都引用了 Doug Stewart 的杰出博客文章,什么是 mscordacwks.dll? http://blogs.msdn.com/b/dougste/archive/2009/02/18/failed-to-load-data-access-dll-0x80004005-or-what-is-mscordacwks-dll.aspx.
多亏了这一点,我通过获取正确的 mscordacwks.dll 并将其放置在这里来解决我的情况:
"C:\Symbols\mscordacwks_AMD64_AMD64_2.0.50727.4216.dll\4E1545829a3000\mscordacwks_AMD64_AMD64_2.0.50727.4216.dll"
我知道 WinDBG 会在哪里查找,因为我之前已经尝试过!sym noisy
.
所以我现在已经准备好了,但我必须将它物理地放在该路径中,而不是通过正常的方式将其添加到我的符号服务器中symstore.exe
机制。由于我的符号存储不仅仅由我个人使用,因此我需要以正确的方式为使用该商店的其他人提供帮助。
这就是问题所在。当我添加使用symstore.exe
它没有进入上述路径,而是进入:
"C:\Symbols\mscordacwks_AMD64_AMD64_2.0.50727.4216.dll\4E1545CB1bd000\mscordacwks_AMD64_AMD64_2.0.50727.4216.dll"
唯一的区别是子文件夹名称是4E1545CB1bd000
这里而不是4E1545829a3000
WinDBG 正在寻找的。
原因是当将二进制文件添加到符号存储时,symstore.exe
使用二进制文件的PE来获取图像时间戳和图像大小。对于这个特定的 .dll,dumpbin.exe /headers mscordacwks.dll
揭示了这些是:
- 图像时间戳:
0x4E1545CB
(2011 年 7 月 7 日星期四 01:36:11)
- 图片大小:
0x1BD000
因此,子文件夹名称4E1545CB1BD000
.
另一方面,WinDBG 正在寻找的是基于图像时间戳和图像大小的子文件夹mscorwks.dll, not mscordacwks.dll,因为前者被加载到进程中,而不是后者。 WinDBG 无法知道 DAC 模块的时间戳和大小,因为该模块不在进程转储中。
为了进一步验证这个解释,dumpbin.exe /headers mscorwks.dll
揭示了:
- 图像时间戳:
0x4E154582
(2011 年 7 月 7 日星期四 01:34:58)
- 图片大小:
0x9A3000
您可以看到添加到子文件夹名称4E1545829A3000
.
知道了这一点,现在就更明白为什么人们不断遇到的 mscordacwks.dll 的所有这些版本似乎都从 Microsoft 的符号服务器中丢失了。我确信它们在那里,只是 WinDBG 和 psscor2 找不到它们,因为它们选择了错误的子文件夹名称。为什么它甚至费心搜索符号路径超出了我的范围,因为它保证永远找不到它!
这就是我的挑战。我可以以某种方式强迫symstore.exe
使用mscorwks.dll的PE信息添加mscordacwks.dll?如果没有,我是否缺少有关 WinDBG 和 psscor2 的信息,是否有一种方法可以让他们知道 mscordacwks.dll 的正确时间戳和大小,即使它未加载(以及他们实际使用这些而不是 mscorwks.dll 的方法) )?