windbg sos版本不匹配問題解決
dumpheap 時提示:
0:105> !dumpheap -stat
The garbage collector data structures are not in a valid state for traversal.
It is either in the "plan phase," where objects are being moved around, or
we are at the initialization or shutdown of the gc heap. Commands related to
displaying, finding or traversing objects as well as gc heap segments may not
work properly. !dumpheap and !verifyheap may incorrectly complain of heap
consistency errors.
Error requesting GC Heap data
Unable to build snapshot of the garbage collector state
這種情況大部分是由于sos版本不匹配導致:
0:105> .cordll –ve –u –l
CLRDLL: Loaded DLL C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscordacwks.dll
CLR DLL status: Loaded DLL C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscordacwks.dll
.cordll –ve –u –l (小寫的L ) 這個命令是控制調試和控制CLR的命令,-ve是顯示詳細信息,-u 卸載模塊,-l (小寫的L) 是加載模塊,上面這個命令就是卸載CLR 調試模塊,然后再加載CLR調試模塊,并顯示詳細信息
貌似已經加載正確,此時,重新運行dumpheap,錯誤仍然存在。
當前系統mscordacwks.dll版本和dump來源系統版本不同,將來源系統對應版本的mscordacwks.dll復制到對應的搜索目錄(Symbol File Path、Source File Path和Image File Path都可以),并重新加載。這個時候你會發現在Symbol File Path已經下載了對應的mscordacwks.dll運行時版本,比如:mscordacwks_AMD64_AMD64_4.0.30319.01.dll\4BA21EEB965000\mscordacwks_AMD64_AMD64_4.0.30319.01.dll。
調試機器和來源機器SOS.dll、clr.dll版本不一致,將來源機器的兩個文件復制到一個指定目錄。用.load命令加載這個版本的sos,再次執行~* e !clrstack,運行成功。之后執行sos的任何命令WinDbg都會提示如下信息(暫時忽略它):
http://www.rzrgm.cn/junchu25/archive/2012/09/04/2670540.html
0:105> .chain
Extension DLL search Path:
D:\windbg\WINXP;D:\windbg\winext;D:\windbg\winext\arcade;D:\windbg\pri;D:\windbg;D:\windbg\winext\arcade;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\7-Zip;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;D:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Java\jdk1.6.0_25\bin;D:\Program Files\Java\jdk1.6.0_25\JRE\bin
Extension DLL chain:
sosex: image 4.5.0.0, API 1.0.0, built Wed Oct 03 22:57:55 2012
[path: D:\windbg\sosex.dll]
sos: image 4.0.30319.18408, API 1.0.0, built Thu Sep 06 14:07:11 2012
[path: D:\windbg\sos.dll]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos: image 4.0.30319.18408, API 1.0.0, built Thu Sep 12 08:02:43 2013
[path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll]
dbghelp: image 6.13.0001.776, API 6.1.6, built Sat May 15 04:57:22 2010
[path: D:\windbg\dbghelp.dll]
ext: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:40 2010
[path: D:\windbg\winext\ext.dll]
exts: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:13 2010
[path: D:\windbg\WINXP\exts.dll]
uext: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:09 2010
[path: D:\windbg\winext\uext.dll]
ntsdexts: image 6.1.7752.0, API 1.0.0, built Sat May 15 04:52:37 2010
[path: D:\windbg\WINXP\ntsdexts.dll]
貌似加載了兩個sos.dll
0:105> .unload sos
Unloading sos extension DLL
0:105> .chain
Extension DLL search Path:
D:\windbg\WINXP;D:\windbg\winext;D:\windbg\winext\arcade;D:\windbg\pri;D:\windbg;D:\windbg\winext\arcade;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\7-Zip;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\Tools\Binn\;D:\Program Files\Microsoft SQL Server\100\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;D:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Java\jdk1.6.0_25\bin;D:\Program Files\Java\jdk1.6.0_25\JRE\bin
Extension DLL chain:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos: image 4.0.30319.18408, API 1.0.0, built Thu Sep 12 08:02:43 2013
[path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll]
dbghelp: image 6.13.0001.776, API 6.1.6, built Sat May 15 04:57:22 2010
[path: D:\windbg\dbghelp.dll]
ext: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:40 2010
[path: D:\windbg\winext\ext.dll]
exts: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:13 2010
[path: D:\windbg\WINXP\exts.dll]
uext: image 6.13.0001.776, API 1.0.0, built Sat May 15 04:57:09 2010
[path: D:\windbg\winext\uext.dll]
ntsdexts: image 6.1.7752.0, API 1.0.0, built Sat May 15 04:52:37 2010
[path: D:\windbg\WINXP\ntsdexts.dll]
此時,只有一個sos了,在運行dumpheap試試:
0:105> !dumpheap -stat
Statistics:
MT Count TotalSize Class Name
000007fef29fd978 1 24 System.Xml.Linq.XHashtable`1[[System.WeakReference, mscorlib]]
000007fef29fd880 1 24 System.Xml.Linq.XHashtable`1[[System.Xml.Linq.XName, System.Xml.Linq]]
…
推薦隔椅同事的文章,列舉了各種可能:
SRV*c:\mysymbol* http://msdl.microsoft.com/download/symbols
posted on 2014-12-26 19:48 Anthony.Zhao 閱讀(1795) 評論(0) 收藏 舉報
浙公網安備 33010602011771號