如何处理源dump文件的mscordacwks.dll文件与调试机上的版本不一致问题而无法使用extension cmd的问题

问题描述:

当抓取了问题机器上的managed application的dump文件之后, 而在另外一台机器上对该dump进行分析时。如果问题机器和目标机器的mscordacwks.dll版本不一致,则在 .load C:\Windows\Microsoft.NET\Framework\v2.0.50727\sos.dll之后目标机器上找不到正确的mscordacwks.dll而导致无法使用debugger extension command.

例如随便键入一个extension command: !Threads

收到的错误信息如下:

复制代码
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -<symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
PDB symbol 
for mscorwks.dll not loaded
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 --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.
复制代码

用.cordll看一看,feedback如下:

CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.0.50727.1433.dll, Win32 error 0n2

说明抓取的dump文件所需要的mscordacwks_x86_x86_2.0.50727.1433.dll文件找不到。

 

解决方法:

用.cordll -ve -u -l看看

复制代码
CLRDLL: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscordacwks.dll:2.0.50727.1434 f:0
doesn
't match desired version 2.0.50727.1433 f:0
CLRDLL: Unable to find mscordacwks_x86_x86_2.0.50727.1433.dll by mscorwks search
CLRDLL: Unable to find 
'mscordacwks_x86_x86_2.0.50727.1433.dll' on the path
CLRDLL: Unable to find mscorwks.dll by search
CLRDLL: ERROR: Unable to load DLL mscordacwks_x86_x86_2.
0.50727.1433.dll, Win32 error 0n2
CLR DLL status: ERROR: Unable to load DLL mscordacwks_x86_x86_2.
0.50727.1433.dll, Win32 error 0n2
复制代码

原来调试机器上的mscordacwks.dll和所抓取dump时的mscordacwks.dll所需要的dll版本不一致。 怎么办?很简单,就是把发生问题的客户机上的mscordackws.dll文件copy过来,然后将其rename为其所需要的文件名,并将其放置到适当的search path下。这里最适合的search path就是windbg安转文件夹下了。

然后用.cordll -ve -u -l 看看,结果如下:

CLRDLL: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscordacwks.dll:2.0.50727.1434 f:0
doesn
't match desired version 2.0.50727.1433 f:0
CLRDLL: Unable to find mscordacwks_x86_x86_2.0.50727.1433.dll by mscorwks search
CLRDLL: Loaded DLL mscordacwks_x86_x86_2.
0.50727.1433.dll
CLR DLL status: Loaded DLL mscordacwks_x86_x86_2.
0.50727.1433.dll

说明按照几个search path,终于最后搜索成功,找到所需dll.

 

posted on   飞天舞者  阅读(1922)  评论(2编辑  收藏  举报

编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构

导航

< 2008年11月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6
For more information about me, feel free email to me winston.he@hotmail.com
点击右上角即可分享
微信分享提示