windbg sos.dll version issue
来源:互联网 发布:测试网络丢包率的命令 编辑:程序博客网 时间:2024/05/16 15:36
I debugged a .net 1.1 based windows application which exits silently upon start up. The problem itself is trivial and not worth mentioning. What I want to say is there is a subtle point about sos.dll version.
When I was debugging, I started the application under windbg. Then issue ".loadby sos mscorwks" command to load sos.dll extension corresponds to the running .net framework. And I entered !DumpAllExceptions command which should exist in sos.dll for .net framework 1.1, but ended in not finding this command:
No export DumpAllExceptions found
Finally, I had to use "!DumpHeap -type Exception" to find out all exceptions.
Having done some investigation, I found there are two sos.dll files for .net 1.1. One in .net framework installation folder, and one in windbg installation folder. The latter one is a full featured extension and support DumpAllExceptions command.
I tried debugging the application again with sos.dll comes with windbg by issusing: ".load windbg_installation_folder/clr10/sos.dll". This time, DumpAllExceptions was back to life and worked like a charm.
BTW, an alternative way to do !DumpAllExceptions is to take advantage of .foreach command.
.foreach(exception {!DumpHeap -type Exception -short}) {!do exception; .echo print exception done !!! *****************}
For convenience, below are commands supported by different version sos.dll.
C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/SOS.dll
0:000> !help
SOS : Help
COMState | List COM state for each thread
ClrStack | Provides true managed stack trace, source and line numbers.
Additional parameters: -p[arams] -l[ocals] -r[egs] -a[ll].
DumpClass | Dump EEClass info
DumpDomain [] | List assemblies and modules in a domain
DumpHeap [-stat] [-min 100] [-max 2000] [-mt 0x3000000] [-type] [-fix] [start [end]] | Dump GC heap contents
DumpMD | Dump MethodDesc info
DumpMT [-MD] | Dump MethodTable info
DumpModule | Dump EE Module info
DumpObj | Dump an object on GC heap
DumpStack [-EE] [-smart] [top stack [bottom stack] | -EE only shows managed stack items.
DumpStackObjects [top stack [bottom stack]
DumpVC | Dump a value class object
EEHeap [-gc] [-win32] [-loader] | List GC/Loader heap info
EEStack [-short] [-EE] | List all stacks EE knows
EEVersion | List mscoree.dll version
FinalizeQueue [-detail] | Work queue for finalize thread
GCInfo [] [IP] | Dump GC encoding info for a managed method
GCRoot | Find roots on stack/handle for object
IP2MD | Find MethodDesc from IP
Name2EE- | Find memory address of EE data given a class/method name
ObjSize [] | Find number of bytes that a root or all roots keep alive on GC heap.
ProcInfo [-env] [-time] [-mem] | Display the process info
RWLock [-all] | List info for a Read/Write lock
SyncBlk [-all|#] | List syncblock
ThreadPool | Display CLR threadpool state
Threads | List managed threads
Token2EE| Find memory address of EE data for metadata token
u [] [IP] | Unassembly a managed code
{windbg installation folder}/clr10/sos.dll
0:000> !help
Did you know that a lot of exceptions (!dumpallexceptions) can cause memory problems. To see more tips, run !tip.
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help" for detailed info on that function.
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads (t)
DumpAllExceptions (dae) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap (dh) U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue COMState
DumpDynamicAssemblies (dda) X
DumpField (df) SearchStack
TraverseHeap (th)
GCRef
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap (vh)
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpASPNETCache (dac) SaveAllModules (sam)
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD FindDebugTrue
Token2EE FindDebugModules
EEVersion Bp
DumpSig ProcInfo
DumpModule StopOnException (soe)
ThreadPool (tp) TD
ConvertTicksToDate (ctd) Analysis
ConvertVTDateToDate (cvtdd) Bl
RWLock CheckCurrentException (cce)
DumpConfig CurrentExceptionName (cen)
DumpHttpRuntime ExceptionBp
DumpSessionStateConfig FindTable
DumpBuckets LoadCache
DumpHistoryTable SaveCache
DumpRequestTable ASPXPages
DumpCollection (dc) DumpGCNotInProgress
DumpDataTables CLRUsage
GetWorkItems
DumpLargeObjectSegments (dl)
DumpModule
DumpAssembly Other
DumpMethodSig -----------------------------
DumpRuntimeTypes FAQ
PrintIPAddress
DumpHttpContext
DumpXmlDocument (dxd)
C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/SOS.dll
0:000> !help
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help" for detailed info on that function.
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads
DumpArray (da) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue EHInfo
PrintException (pe) COMState
TraverseHeap BPMD
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD VMMap
Token2EE VMStat
EEVersion ProcInfo
DumpModule StopOnException (soe)
ThreadPool MinidumpMode
DumpAssembly
DumpMethodSig Other
DumpRuntimeTypes -----------------------------
DumpSig FAQ
RCWCleanupList
DumpIL
When I was debugging, I started the application under windbg. Then issue ".loadby sos mscorwks" command to load sos.dll extension corresponds to the running .net framework. And I entered !DumpAllExceptions command which should exist in sos.dll for .net framework 1.1, but ended in not finding this command:
No export DumpAllExceptions found
Finally, I had to use "!DumpHeap -type Exception" to find out all exceptions.
Having done some investigation, I found there are two sos.dll files for .net 1.1. One in .net framework installation folder, and one in windbg installation folder. The latter one is a full featured extension and support DumpAllExceptions command.
I tried debugging the application again with sos.dll comes with windbg by issusing: ".load windbg_installation_folder/clr10/sos.dll". This time, DumpAllExceptions was back to life and worked like a charm.
BTW, an alternative way to do !DumpAllExceptions is to take advantage of .foreach command.
.foreach(exception {!DumpHeap -type Exception -short}) {!do exception; .echo print exception done !!! *****************}
For convenience, below are commands supported by different version sos.dll.
C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/SOS.dll
0:000> !help
SOS : Help
COMState | List COM state for each thread
ClrStack | Provides true managed stack trace, source and line numbers.
Additional parameters: -p[arams] -l[ocals] -r[egs] -a[ll].
DumpClass | Dump EEClass info
DumpDomain [] | List assemblies and modules in a domain
DumpHeap [-stat] [-min 100] [-max 2000] [-mt 0x3000000] [-type
DumpMD | Dump MethodDesc info
DumpMT [-MD] | Dump MethodTable info
DumpModule | Dump EE Module info
DumpObj | Dump an object on GC heap
DumpStack [-EE] [-smart] [top stack [bottom stack] | -EE only shows managed stack items.
DumpStackObjects [top stack [bottom stack]
DumpVC
EEHeap [-gc] [-win32] [-loader] | List GC/Loader heap info
EEStack [-short] [-EE] | List all stacks EE knows
EEVersion | List mscoree.dll version
FinalizeQueue [-detail] | Work queue for finalize thread
GCInfo [
GCRoot | Find roots on stack/handle for object
IP2MD | Find MethodDesc from IP
Name2EE
ObjSize [] | Find number of bytes that a root or all roots keep alive on GC heap.
ProcInfo [-env] [-time] [-mem] | Display the process info
RWLock [-all] | List info for a Read/Write lock
SyncBlk [-all|#] | List syncblock
ThreadPool | Display CLR threadpool state
Threads | List managed threads
Token2EE
u [
{windbg installation folder}/clr10/sos.dll
0:000> !help
Did you know that a lot of exceptions (!dumpallexceptions) can cause memory problems. To see more tips, run !tip.
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads (t)
DumpAllExceptions (dae) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap (dh) U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue COMState
DumpDynamicAssemblies (dda) X
DumpField (df) SearchStack
TraverseHeap (th)
GCRef
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap (vh)
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpASPNETCache (dac) SaveAllModules (sam)
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD FindDebugTrue
Token2EE FindDebugModules
EEVersion Bp
DumpSig ProcInfo
DumpModule StopOnException (soe)
ThreadPool (tp) TD
ConvertTicksToDate (ctd) Analysis
ConvertVTDateToDate (cvtdd) Bl
RWLock CheckCurrentException (cce)
DumpConfig CurrentExceptionName (cen)
DumpHttpRuntime ExceptionBp
DumpSessionStateConfig FindTable
DumpBuckets LoadCache
DumpHistoryTable SaveCache
DumpRequestTable ASPXPages
DumpCollection (dc) DumpGCNotInProgress
DumpDataTables CLRUsage
GetWorkItems
DumpLargeObjectSegments (dl)
DumpModule
DumpAssembly Other
DumpMethodSig -----------------------------
DumpRuntimeTypes FAQ
PrintIPAddress
DumpHttpContext
DumpXmlDocument (dxd)
C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/SOS.dll
0:000> !help
-------------------------------------------------------------------------------
SOS is a debugger extension DLL designed to aid in the debugging of managed
programs. Functions are listed by category, then roughly in order of
importance. Shortcut names for popular functions are listed in parenthesis.
Type "!help
Object Inspection Examining code and stacks
----------------------------- -----------------------------
DumpObj (do) Threads
DumpArray (da) CLRStack
DumpStackObjects (dso) IP2MD
DumpHeap U
DumpVC DumpStack
GCRoot EEStack
ObjSize GCInfo
FinalizeQueue EHInfo
PrintException (pe) COMState
TraverseHeap BPMD
Examining CLR data structures Diagnostic Utilities
----------------------------- -----------------------------
DumpDomain VerifyHeap
EEHeap DumpLog
Name2EE FindAppDomain
SyncBlk SaveModule
DumpMT GCHandles
DumpClass GCHandleLeaks
DumpMD VMMap
Token2EE VMStat
EEVersion ProcInfo
DumpModule StopOnException (soe)
ThreadPool MinidumpMode
DumpAssembly
DumpMethodSig Other
DumpRuntimeTypes -----------------------------
DumpSig FAQ
RCWCleanupList
DumpIL
- windbg sos.dll version issue
- WinDbg + SOS.dll 初始设置
- WinDbg / SOS
- 在windbg时要注意sos.dll的版本
- WinDbg / SOS Cheat Sheet
- windbg加载SOS
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- .NET / Rotor源码分析5 - 开始使用WinDbg+SOS调试,sscoree.dll,加载SOS并设置JIT断点
- Total Commander, what a weapon!
- change command prompt font
- getting start with osip
- 跨域(cross-domain)访问 cookie (读取和设置)
- native programming with android building system
- windbg sos.dll version issue
- 】【又写了个 JavaScript 小游戏】
- Ex 15.4-5 of introduction to algorithms
- fix "no module named readline" on windows
- remove visual sourcesafe binding
- android property system
- understanding the android media framework
- Ex 10.4-3 of introduction to algorithms
- Ex 9.3-8 of Introduction to algorithms