2014-11-17 36 views
2

試圖調試運行在64位Windows版本上的32位.NET應用程序的進程轉儲使用調試器6.3.9600.16384 x86。如何在64位服務器上運行的32位應用程序在Windbg中加載SOS

花了幾個小時尋找解決方案。在stackoverflow和其他網站上發現了很多主題,但是我無法修復這個問題。我正要把我的頭髮拉出來。

經過的.NET版本,是由使用過程中

0:000> lmv m clr 
start end  module name 
618a0000 61f3b000 clr  (pdb symbols)   c:\symcache\clr.pdb\5182A0CFB60D40DB90EEF44DEC7ACB932\clr.pdb 
    Loaded symbol image file: clr.dll 
    Mapped memory image file: c:\symcache\clr.dll\52717E8469b000\clr.dll 
    Image path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
    Image name: clr.dll 
    Timestamp:  Wed Oct 30 22:47:48 2013 (52717E84) 
    CheckSum:   0069CCD3 
    ImageSize:  0069B000 
    File version:  4.0.30319.18444 
    Product version: 4.0.30319.18444 
    File flags:  8 (Mask 3F) Private 
    File OS:   4 Unknown Win32 
    File type:  2.0 Dll 
    File date:  00000000.00000000 
    Translations:  0000.04b0 0000.04e4 0409.04b0 0409.04e4 

複製clr.dll,從運行的應用程序到C服務器mscordacwks.dll和SOS.dll:\ TEMP \的DLL。將mscordacwks.dll重命名爲mscordacwks_x86_x86_4.0.30319.18444.dll。

0:000> .cordll -u -lp c:\temp\dlls -ve 
CLRDLL: Unable to get version info for 'c:\temp\dlls\mscordacwks.dll', Win32 error 0n87 
CLRDLL: Unable to get version info for 'c:\temp\dlls\SOS_x86_x86_4.0.30319.18444.dll', Win32 error 0n87 
Cannot Automatically load SOS 
CLRDLL: Loaded DLL c:\temp\dlls\mscordacwks_x86_x86_4.0.30319.18444.dll 
CLR DLL status: Loaded DLL c:\temp\dlls\mscordacwks_x86_x86_4.0.30319.18444.dll 

0:000> .loadby sos clr 
0:000> !clrstack 
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 clr.dll is 
       in the version directory or on the symbol path 
      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 supported cross platform architecture as 
       the dump file. For example, an ARM dump file must be debugged 
       on an X86 or an ARM machine; an AMD64 dump file must be 
       debugged on an AMD64 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 clr.dll as well. 

嘗試設置可執行文件的路徑

0:000> .exepath c:\temp\dlls 
Executable image search path is: c:\temp\dlls 
Expanded Executable image search path is: c:\temp\dlls 

************* Symbol Path validation summary ************** 
Response       Time (ms)  Location 
OK            c:\temp\dlls 
0:000> .reload 
................................................................ 
.......................................................... 
Loading unloaded module list 
..... 
0:000> !clrstack 
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 clr.dll is 
       in the version directory or on the symbol path 
      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 supported cross platform architecture as 
       the dump file. For example, an ARM dump file must be debugged 
       on an X86 or an ARM machine; an AMD64 dump file must be 
       debugged on an AMD64 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 clr.dll as well. 

試圖.loadby SOS CLR

0:000> .loadby sos clr 
0:000> !clrstack 
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 clr.dll is 
       in the version directory or on the symbol path 
      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 supported cross platform architecture as 
       the dump file. For example, an ARM dump file must be debugged 
       on an X86 or an ARM machine; an AMD64 dump file must be 
       debugged on an AMD64 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 clr.dll as well. 

誰能幫我?不知道我還能再試一次。

+0

嘗試['.loadby SOS clr'(http://blogs.msdn.com/b/rihamselim/ archive/2012/03/04/error-loading-clr.aspx) –

+0

@RemusRusanu編輯該職位。試過它,但不幸的是沒有結果 – RB84

+0

Windbg本身應該64位味道。 –

回答

-1

你是如何創建轉儲文件的? 如果你正在調試在64位Windows 32位過程中,你必須使用任務管理器的32位版本位於

C:\ WINDOWS \ Syswow64資料\的TaskMgr.exe

然後繼續右鍵點擊該進程並點擊'創建轉儲文件'

一旦你採取了正確的轉儲,在轉儲的機器上的WinDbg(X64)中打開它 - 即在可能的情況下在遠程PC上安裝windbg因爲如果你有不同的版本,這可以減少調試問題NS的.NET Framework(哪怕是細微的)

+0

轉儲是使用Windows錯誤報告創建的。 http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx。這個問題也影響到WER嗎?試着在機器上運行調試器,等待更新 – RB84

+0

@RamonBertrand您可能會錯過調試器仍然需要的一些dll - 請參閱如何在遠程機器上運行windbg。關於WER我不知道,但如果在上面給出的目錄中有一個32位版本,那麼它的可能性也會受到影響。我使用任務管理器獲取轉儲文件 – wal

+0

試圖立即在遠程機器上運行。我應該改用Framework64 DLL還是應該切換體系結構(.load wow64exts; .effmach x86)?使用64位框架加載SOS但不允許.loadby sos clr。 32位框架似乎根本不適用。無法從中加載SOS。 – RB84

0

你做了正確的東西很多:

  1. 已經採取了使用WER LocalDumps 32位應用程序的32位轉儲
  2. 你已拷貝在SOS,並從原來的PC mscordacwks
  3. 您正確更名爲
  4. 你選擇了32位的WinDbg
  5. 您使用.cordll和正確mscordacwks DLL加載

有隻有一個地方出了錯小東西:

.loadby sos clr 

這個命令會從那裏clr.dll位於同一位置加載SOS。這將在您的PC上確定,因此這可能會加載與轉儲中的SOS不同的SOS版本。

相反,提供完整路徑SOS您已經從PC收集:

.load c:\temp\dlls\sos.dll 
相關問題