Giter Site home page Giter Site logo

rodneyviana / netext Goto Github PK

View Code? Open in Web Editor NEW
210.0 17.0 36.0 536.36 MB

WinDbg extension for data mining managed heap. It also includes commands to list http request, wcf services, WIF tokens among others

Home Page: http://blogs.msdn.microsoft.com/rodneyviana

License: Other

C# 7.29% C++ 89.07% C 3.58% Perl 0.01% M4 0.02% Batchfile 0.01% Shell 0.01% PowerShell 0.03%
windbg-extension debugging-tool

netext's People

Contributors

lasherer avatar rodneyviana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netext's Issues

!wstack dumps not all stack objects like !dso

I love the !wstack command but for some cases where I am searching for stale references of already left methods I sometimes want to see if some hints of already left methods are on the stack.

The !dso command travereses the full stack but !wstack only the valid one.
Could you add to !wstack e.g. a -full option to list all managed references?

By the way your Windbg extension is by far the best out there for managed code.

Does !wfrom support nesting?

Does !wfrom support nesting? I could not find an example for the same.

I have a dictionary from which I am trying to read the entries and recover the address of value.
!wfrom returns an array. But I am unable to pipe it to another !wfrom to further process it.

example of what I want to do:
!wfrom -array (!wfrom -nofield -nospace -array 181f6c24 select value) select somefield
181f6c24 is the address of entries field of a dictionary.

Dump Linked Nodes

When dealing with WPF issues i need to take a peek into the dispatcher priority queue which has items stored as linked nodes.
Is it possible with netext to dump such a linked list?

0:000> !wdo 0000024c45d2ef70
Address: 0000024c45d2ef70
Method Table/Token: 00007ffbbc48e048/200017c04 
Class Name: System.Windows.Threading.PriorityChain<System.Windows.Threading.DispatcherOperation>
Size : 40
EEClass: 00007ffbbc502ab0
Instance Fields: 4
Static Fields: 0
Total Fields: 4
Heap/Generation: 0/2
Module: 00007ffbbc480000
Assembly: 0000024c430dddf0
Domain: 0000024c430365f0
Assembly Name: C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll
Inherits: System.Object (00007FFBDAF35F88)
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0000                                    _head 0000024c4a3f1800
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0008                                    _tail 0000024c4b2e6c90
00007ffbbc495780         System.Windows.Threading.DispatcherPrior +0010                                _priority 3 (0n3) ContextIdle
00007ffbdaf380f8                                     System.Int32 +0014                                   _count 4 (0n4)

0:000> !wdo 0000024c4a3f1800
Address: 0000024c4a3f1800
Method Table/Token: 00007ffbbc48f9c8/200017d04 
Class Name: System.Windows.Threading.PriorityItem<System.Windows.Threading.DispatcherOperation>
Size : 64
EEClass: 00007ffbbc502b50
Instance Fields: 6
Static Fields: 0
Total Fields: 6
Heap/Generation: 0/2
Module: 00007ffbbc480000
Assembly: 0000024c430dddf0
Domain: 0000024c430365f0
Assembly Name: C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll
Inherits: System.Object (00007FFBDAF35F88)
00007ffbdaf39a60                                   System.__Canon +0000                                    _data 0000024c4a3f1658
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0008                          _sequentialPrev 0000000000000000
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0010                          _sequentialNext 0000024c4a3f1cf8
00007ffbbc8dfc60         System.Windows.Threading.PriorityChain<S +0018                                   _chain 0000024c45d2ef70
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0020                            _priorityPrev 0000000000000000
00007ffbbc8dfcc0         System.Windows.Threading.PriorityItem<Sy +0028                            _priorityNext 0000024c4a3f1cf8

Because there are delegates registered it would be super useful to dump the target type and method (regardless if it is static or not). When something has got stuck it is hard to find the blocking message. Having 100 or more items in this queue is not uncommon.

WinDbg begginers question: Unable to acquire .NET debugger interface. Error: 8027025b

I am getting the following error on WinDbg Preview 1,0,2007.0.6001:

!windex -tree
Unable to acquire .NET debugger interface. Error: 8027025b
c0000005 Exception in netext.windex debugger extension.
PC: 5a07691c VA: 00000000 R/W: 0 Parameter: 00000000

.chain
Extension DLL search Path:
C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\Apple\Apple Application Support;C:\Program Files (x86)\Common Files\Apple\Mobile Device Support;C:\Program Files\Common Files\Apple\Apple Application Support;C:\Program Files\Common Files\Apple\Mobile Device Support;C:\WINDOWS\System32\OpenSSH;C:\Program Files\SafeNet\Authentication\SAC\x64;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Users\aristeu.agaj\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon
Extension DLL chain:
netext: image 2.1.57.5000, API 1.0.0, built Mon May 18 13:26:11 2020
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\netext.dll]
mscorwks: image 2.0.50727.9151, built Sat Mar 21 02:10:51 2020
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\mscorwks.dll]
ELFBinComposition: image 10.0.20153.1000, API 0.0.0,
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\winext\ELFBinComposition.dll]
dbghelp: image 10.0.20153.1000, API 10.0.6,
[path: C:\Users\Desktop\memdump\WinDbg\x86\dbghelp.dll]
ext: image 10.0.20153.1000, API 1.0.0,
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\winext\ext.dll]
exts: image 10.0.20153.1000, API 1.0.0,
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\WINXP\exts.dll]
uext: image 10.0.20153.1000, API 1.0.0,
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\winext\uext.dll]
ntsdexts: image 10.0.20153.1000, API 1.0.0,
[path: C:\Users\aristeu.agaj\Desktop\memdump\WinDbg\x86\WINXP\ntsdexts.dll]

Error when running !windex

Describe the bug
Attached to .NET 4.8 admin process in WinDbgX, running !windex causes the error:

Init was performed but it could not start CLR. Error: 8027025b

Using an earlier version of NetExt works as expected

To Reproduce
Steps to reproduce the behavior:

  1. Install NetExt v.2.1.54.5000 into %LOCALAPPDATA%\Dbg\EngineExtensions[32]
  2. Launch WinDbgX as admin
  3. Attach to admin .NET 4.8 process
  4. Type .load netext
  5. Click on !windex -tree in netext banner text
  6. Be confused by error message Init was performed but it could not start CLR. Error: 8027025b and open bug on github.

Expected behavior
I expect my process heap to be indexed

Desktop (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.18363.657]
  • Browser N/A
  • Version : .NET Version 4.8.03752, WinDbgX Version 1.2001.15003.1

Additional context
Using 2.1.47.5000 does not exhibit the problem.

!wmodule command fails with "Init was performed but it could not start CLR. Error: 8027025b"

Rodney, having an issue using the extension. Appreciate any points you can give.

Describe the bug
Attempting to use the extension's !wmodule command fails with an error:

Init was performed but it could not start CLR. Error: 8027025b

To Reproduce

  1. Load the extensison

.load C:\Users\mvolo\Downloads\NetExt-2.1.58.5000\NetExt-2.1.58.5000\x64\NetExt.dll

NetExt version 2.1.58.5000 Oct 21 2020
License and usage can be seen here: !whelp license
Check Latest version: !wupdate
For help, type !whelp (or in WinDBG run: '.browse !whelp')
Questions and Feedback: https://github.com/rodneyviana/netext/issues
Copyright (c) 2014-2015 Rodney Viana (http://blogs.msdn.com/b/rodneyviana)
Type: !windex -tree or ~*e!wstack to get started

  1. Run the !wmodule command

!wmodule -managed -noms -saveto d:\temp\dlls

Init was performed but it could not start CLR. Error: 8027025b

Background:
Windows 10
.NET Framework 4.8 installed

C:\Users\mvolo\Downloads\ngrok-stable-windows-amd64>filever c:\Windows\Microsoft.NET\Framework\v4.0.30319\SOS.dll
--a-- W32i DLL ENU 4.8.4220.0 shp 767,368 07-06-2020 sos.dll

C:\Users\mvolo\Downloads\ngrok-stable-windows-amd64>filever c:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
--a-- W32i DLL ENU 4.8.4220.0 shp 8,037,768 07-06-2020 clr.dll

0:056> !wupdate
You are up to date. Your version is 2.1.58.5000

0:056> .chain
Extension DLL search Path:
C:\Program Files (x86)\windows kits\10\debuggers\x64\WINXP;C:\Program Files (x86)\windows kits\10\debuggers\x64\winext;C:\Program Files (x86)\windows kits\10\debuggers\x64\winext\arcade;C:\Program Files (x86)\windows kits\10\debuggers\x64\pri;C:\Program Files (x86)\windows kits\10\debuggers\x64;C:\Users\mvolo\AppData\Local\Dbg\EngineExtensions;C:\Program Files (x86)\windows kits\10\debuggers\x64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Git\cmd;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Users\mvolo\AppData\Local\Microsoft\WindowsApps;D:\Source\Repos\Tools\tools
Extension DLL chain:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll: image 4.8.4220.0, API 1.0.0, built Mon Jul 6 18:45:31 2020
[path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll]
C:\Users\mvolo\Downloads\NetExt-2.1.58.5000\NetExt-2.1.58.5000\x64\NetExt.dll: image 2.1.58.5000, API 1.0.0, built Wed Oct 21 13:45:19 2020
[path: C:\Users\mvolo\Downloads\NetExt-2.1.58.5000\NetExt-2.1.58.5000\x64\NetExt.dll]
dbghelp: image 10.0.19041.1, API 10.0.6,
[path: C:\Program Files (x86)\windows kits\10\debuggers\x64\dbghelp.dll]
ext: image 10.0.19041.1, API 1.0.0,
[path: C:\Program Files (x86)\windows kits\10\debuggers\x64\winext\ext.dll]
exts: image 10.0.19041.1, API 1.0.0,
[path: C:\Program Files (x86)\windows kits\10\debuggers\x64\WINXP\exts.dll]
uext: image 10.0.19041.1, API 1.0.0,
[path: C:\Program Files (x86)\windows kits\10\debuggers\x64\winext\uext.dll]
ntsdexts: image 10.0.19041.1, API 1.0.0,
[path: C:\Program Files (x86)\windows kits\10\debuggers\x64\WINXP\ntsdexts.dll]

!windex execution error

On a specific dump, I'm getting this error while running !windex

!windex
Starting indexing at 10:38:04
e06d7363 Exception in netext.windex debugger extension.
PC: 00007ff9f28b5299 VA: 00000029349fd8f0 R/W: 19930520 Parameter: 00007ff9`9c5068a0

What could be the cause?

.NET Core 6.0 !socket and $ipaddress(<field>) do not work with netext

Describe the bug
With .NET Core 6.0 !socket and $ipaddress function do not work.

To Reproduce
Dump a .NET 6 or higher process which has some web request hanging around

Expected behavior
!socket and $ipaddress should work. Looks like the internal offsets have changed.

!wfrom -type System.Net.Sockets.Socket select $addr(),_remoteEndPoint._address._addressOrScopeId,$ipaddress(_remoteEndPoint._address._addressOrScopeId)
calculated: 0000015481B356B0
_remoteEndPoint._address._addressOrScopeId: 0n768473354
calculated: #INVALID#
calculated: 0000015481B39C70
_remoteEndPoint._address._addressOrScopeId: 0n768473354
calculated: #INVALID#
calculated: 0000015481B3F118
_remoteEndPoint._address._addressOrScopeId: 0n768473354
calculated: #INVALID#

Desktop (please complete the following information):

  • Win 10
  • Version 2.1.59.5000, API 1.0.0, built Wed Nov 11 05:32:51 2020

How do you build the project. On my machine it complains about
error C1083: Cannot open type library file: '..\ClrMemDiagExt\bin\x86\Debug\NetExtShim.tlb': No such file or directory

!windex -enumtypes with more params (ex orderbyCount)

!windex -enumtypes currently lists out all types alphabetical. Would like a

I would be willing to help if any starting point is shared.

Would like to have some extra parameters to be able to filter out the list.

examples of filters:

!windex -enumtypes -orderbycound -descending
!windex -enumtypes -orderbycound -ascending
!windex -enumtypes -orderbycound -ascending -top 100

!wmakesource crashes on live target

To Reproduce

  1. Start a simple e.g. WPF Hello World App
  2. Attach Windbg
  3. Load Netext (latest 2.1.57.5000\x64)
  4. Do !wk to get some stack frames
  5. Try to decmpile with !wmakesource

Expected behavior
Decompiled code

** Actual Behavior **
windbg: 38 exceptions
windbg (18600): 36 exceptions
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.: 2 exceptions
dynamicClass.IL_STUB_CLRtoCOM(unsigned int64,value class Microsoft.Diagnostics.Runtime.Interop.MEMORY_BASIC_INFORMATION64&)
NetExt.Shim.DebugApi.AddressType(unsigned int64)
NetExt.Shim.DebugApi.ReadMemory(unsigned int64,!!0&,bool)
NetExt.Shim.Module.get_DOSHeader()
NetExt.Shim.Module.get_FileImageType()
NetExt.Shim.Module.get_CorHeader()
NetExt.Shim.Module.get_IsClr()
NetExt.Shim.MDTarget.MakeSourceInternal(unsigned int64)
dynamicClass.IL_STUB_COMtoCLR(int64)

Desktop (please complete the following information):

  • OS: Win 10 1803

[XmlParsing] Attributes with empty values seem not to get empty value restored.

First of all - a huuuge thanks for the extension, it saves the day!

I'm using !wxml command with source xml like:

<dataviews>
  <dataview name="FilterDataView" assembly="Sitecore.Kernel" type="Sitecore.Web.UI.HtmlControls.FilterDataView" Parameters="" />
</dataviews>

While the restored version does not get an empty value for parameters:

As a result, the attribute without value breaks further parsing =\

I'm eager to contribute if you could hint me where to look at.

Thanks.

Support DML in !wfrom output

Is your feature request related to a problem? Please describe.
When investigating an issue I will have a set of objects of a particular type that I wish to output a table of some of the internal values for. The !wfrom command works great for this, but I would like the ability to add DML to the output so that I can one-click drill in. For example, it's typical to output the object address as the first item on the row. Being able to output a dml snippet so that clicking on it will execute "!wdo $addr()" would be great.

Describe the solution you'd like
My ideal solution would be some helper expression methods. For example $dmllink(text, command). So for example I could do something like this (pulling from the help output from !wfrom):

!wfrom -nospace -nofield -type *.HttpContext select $dmllink($rpad($addr(),10),"!wdo " + $addr())," ",$if(!_thread, "  --",$lpad($thread(_thread.DONT_USE_InternalThread),4))," ",$if((_timeoutSet==1),$tickstotimespan(_timeout._ticks), "Not set "), " ", $if(_response._completed || _finishPipelineRequestCalled,"Finished", $tickstotimespan($now()-_utcTimestamp.dateData)), " ", $replace($lpad(_response._statusCode,8),"0n","")," ", $rpad($isnull(_request._httpMethod,"NA"),8), " ", $isnull(_request._url.m_String, _request._filePath._virtualPath)

I don't know if color output works in windbg, but I know that dml supports it so being able to set the color of things would also be useful. If helper methods is too difficult due to ambiguity of syntax or too many options (such as right click commands on dml needing overloads) then just supporting being able to provide the raw dml command as part of the output string would be great.

Describe alternatives you've considered
I tried emitting the dml in the output already, it didn't work.

Linux Dump on WinDbg Preview with NetExt

I'm having trouble with netext (in WinDbg Preview) to the dump I get on Linux Ubuntu 18.04 x64. I use ".cordll -l" when inspecting dumps get on Windows and it works fine. However, when examining dumps from Linux, I only load "sos.dll" (with dotnet-sos - comment below) and after .load netext, I get the following error in !windex -tree operation.

0:522> !windex -tree
Init was performed but it could not start CLR Try running .cordll -l. Error: 8027025b c0000005 Exception in C:\NetExt-2.1.65.5000\x64\NetExt.dll.windex debugger extension. PC: 00007ffc'3485d76b VA: 00000000'00000000 R/W: 0 Parameter: 00000000'00000000
0:522> .cordll -l
CLR DLL status: No load attempts
0:522> lmv m coreclr
Browse full module list
start end module name

lmv m coreclr list is empty.

Default WinDbg commands (!threads, !clrstack etc.) are works.

The dump from Linux is not supported or am I doing something missing?

"Note that the !loadby sos coreclr command no longer works and is no longer needed."*
*https://www.mode19.net/posts/windbgwithnetcore/

!wfrom where clause not filtering as expected.

The where clause does never match when I want to filter e.g. for null text strings.

0:000> !wver
Runtime(s) Found: 1
0: Filename: mscordacwks_X86_X86_4.7.3394.00.dll Location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscordacwks.dll
.NET Version: 4.7.3394.0
NetExt (this extension) Version: 2.1.38.5000

String length is not used?

0:000> !wfrom -type syngo.Common.Controls.WinForms.Core.Label where ( text.m_stringLength!=0 ) select text

0 Object(s) listed
2,779 Object(s) skipped by filter

when I change it to
!wfrom -type syngo.Common.Controls.WinForms.Core.Label where (text) select text
then it will filter out all NULL strings.

But when I try to filter for null strings

!wfrom -type syngo.Common.Controls.WinForms.Core.Label where (text==0) select text
!wfrom -type syngo.Common.Controls.WinForms.Core.Label where (text==null) select text
!wfrom -type syngo.Common.Controls.WinForms.Core.Label where (text==NULL) select text

it will not work. What finally did work was to use the text in quotation marks:

!wfrom -type syngo.Common.Controls.WinForms.Core.Label where (text=="NULL") select text

That is pretty unituitive and is not mentioned as far as I did try to read the help. Apart from that this is an amazing extension.

What I sometimes miss is the ability to filter only live instances. That would be helpful to get true object counts when it matters e.g. if handle wrappers are around and I need the exact handle count.

How to select a variable in !wfrom when multiple variables have the same name

So I have base class that has a private member variable that is an AutoReset event and I have another variable in the child class that is a Guid array that shares the same name as the base variable after obfuscation.

Is there a way to select the child variable in !wfrom? Currently the parent variable is always selected. My current command is (d is the variable name):
!wfrom -nofield -nospace -obj 57EDDF3C select d (this returns me the parent member)

Since this was not working, I saw that the variable is at the offset 50.
So I tried:
!wfrom -nofield -nospace -obj 57EDDF3C select $addr()+50

But this gave a random memory address. Is there any way I can fetch the member variable other than manually doing a !wdo or !do on the class address?

"Unable to create type CLRMDActivator"

Just tried netext for the first time on a .NET Core dump. It went like this:

0:000> .load netext
netext version 2.1.51.5000 Nov 22 2019
License and usage can be seen here: !whelp license
Check Latest version: !wupdate
For help, type !whelp (or in WinDBG run: '.browse !whelp')
Questions and Feedback: https://github.com/rodneyviana/netext/issues 
Copyright (c) 2014-2015 Rodney Viana (http://blogs.msdn.com/b/rodneyviana) 
Type: !windex -tree or ~*e!wstack to get started

0:000> !windex -tree
ERROR: Unable to create type CLRMDActivator. More information below
Base Path: C:\Program Files\Debugging Tools for Windows (x64)
Private Path: C:\Program Files\Debugging Tools for Windows (x64)\
Unable to start NetExtShim.Dll. Make sure all the files are in the WinDbg root folder. Error: 8027025b
c0000005 Exception in netext.windex debugger extension.
      PC: 000007fe`e6a4c86b  VA: 00000000`00000000  R/W: 0  Parameter: 00000000`00000000

I did extract the x64 version of netext into C:\Program Files\Debugging Tools for Windows (x64), as instructed. (NetExtShim.dll is there, too.)

In command !wservice, property Is Throttled? is always true

Just collected a dump on a WCF process hosted in IIS.
Whenever I run the command !wservice

the Is Throttled property is always true
(even if the service was just started and I only one service call was performed)

!wservice 0000024250957ee0

Service Info

Address : 0000024250957EE0
Configuration Name : WCFApplicationWithMultipleBindings.Service1
State : Opened
EndPoints : 0n2
Base Addresses : 0n3
Behaviors : 0n10
Runtime Type : WCFApplicationWithMultipleBindings.Service1
Is Throttled? : True
Calls/Max Calls : 0n0/0n64
Sessions/Max : 0n0/0n400
Events Raised : No Event raised
Handles Called : OnOpeningHandle OnOpenedHandle
Session Mode : False
Extensions : 00000242509bc390

"Unable to read 0x4 bytes at 00000000" for !wconcurrentdict

I have 32 bit dump that was taken on 64 bit machine using 32 bit task manager. Everything works fine except !wconcurrentdict

I got this error:
ERROR: !wconcurrentdict: extension exception 0x80004002.
"Unable to read 0x4 bytes at 00000000"

I tried few different ConcurrentDictionary's and I always got the same error. I was able to check them via Windbg using standard SOS. I can check m_tables, m_buckets and m_countPerLock without any problem. It just very time consuming.

0:000> !wconcurrentdict 0f2d0d78
ERROR: !wconcurrentdict: extension exception 0x80004002.
    "Unable to read 0x4 bytes at 00000000"
0:000> !DumpObj 0f2d0d78
Name:        System.Collections.Concurrent.ConcurrentDictionary`2[[System.String, mscorlib],[System.Collections.Generic.List`1[[Class1, Class2]], mscorlib]]
MethodTable: 2bd92734
EEClass:     25b588e0
Size:        40(0x28) bytes
File:        C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
25bcb014  4001851        4 ...Canon, mscorlib]]  0 instance a5ea01d0 m_tables
24aca40c  4001852        8 ...Canon, mscorlib]]  0 instance 00000000 m_comparer
0895c068  4001853       20       System.Boolean  1 instance        1 m_growLockArray
0895dfd0  4001854       10         System.Int32  1 instance        0 m_keyRehashCount
0895dfd0  4001855       14         System.Int32  1 instance       17 m_budget
2672dcec  4001856        c ...non, mscorlib]][]  0 instance 00000000 m_serializationArray
0895dfd0  4001857       18         System.Int32  1 instance        0 m_serializationConcurrencyLevel
0895dfd0  4001858       1c         System.Int32  1 instance        0 m_serializationCapacity
0895c068  400185b        8       System.Boolean  1   static  <no information>
0:000> !DumpObj /d a5ea01d0
Name:        System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[System.String, mscorlib],[System.Collections.Generic.List`1[[Class1, Class2]], mscorlib]]
MethodTable: 2bd92d5c
EEClass:     25b596e0
Size:        24(0x18) bytes
File:        C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll
Fields:
      MT    Field   Offset                 Type VT     Attr    Value Name
00000000  400349c        4              SZARRAY  0 instance a5ea42a8 m_buckets
0895b8ac  400349d        8      System.Object[]  0 instance 1a2d1318 m_locks
24b4bd14  400349e        c       System.Int32[]  0 instance a5eb5aa8 m_countPerLock
24aca40c  400349f       10 ...Canon, mscorlib]]  0 instance 14276e00 m_comparer
0:000> !DumpObj /d a5ea42a8
Name:        System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.String, mscorlib],[System.Collections.Generic.List`1[[Class1, Class2]], mscorlib]][]
MethodTable: 2bd92c94
EEClass:     0895b844
Size:        71680(0x11800) bytes
Array:       Rank 1, Number of elements 17917, Type CLASS (Print Array)
Fields:
None
0:000> !DumpObj /d a5eb5aa8
Name:        System.Int32[]
MethodTable: 24b4bd14
EEClass:     24b4bcb8
Size:        4108(0x100c) bytes
Array:       Rank 1, Number of elements 1024, Type Int32 (Print Array)
Fields:
None

Values of the Dictionary Entries

First, thank you for this WinDbg extention.
We processing a lot of crash dumps of our clients and your stuff is heaven-sent.

DISCLAIMER: The crash dump is of my test app with target .NET Framework 4.7.1 ...maybe NetExt does not support that yet.
If this is the case please disregard.

In the crash dump I have instance of:
Dictionary<KeyValuePair<string, int>, KeyValuePair<string, int>>
It's keys and values are:
("kvDictKey0", 0) -> ("kvDictVal0", 0)
("kvDictKey1", 1) -> ("kvDictVal1", 1)
("kvDictKey2", 2) -> ("kvDictVal2", 2)

So we have Entry struct containing other struct types.
Below is output from NetExt, it looks like I cannot get to the inner values of the dictionary entries.
When I click on the -mt entry an exception is thrown.
0:000> !wdict 0x0001521d577590
Items : 3
[0]:==============================================(Physical Index: 2)
System.Collections.Generic.KeyValuePair key = -mt 00007FFDF2881DC8 000001521D577768
System.Collections.Generic.KeyValuePair value = -mt 00007FFDF2881DC8 000001521D577778
[1]:==============================================(Physical Index: 1)
System.Collections.Generic.KeyValuePair key = -mt 00007FFDF2881DC8 000001521D577740
System.Collections.Generic.KeyValuePair value = -mt 00007FFDF2881DC8 000001521D577750
[2]:==============================================(Physical Index: 0)
System.Collections.Generic.KeyValuePair key = -mt 00007FFDF2881DC8 000001521D577718
System.Collections.Generic.KeyValuePair value = -mt 00007FFDF2881DC8 000001521D577728
0:000> !wselect mt 140728672460232 * from 000001521d577768
c0000005 Exception in netext.wselect debugger extension.
PC: 00007ffdf76b6ba2 VA: 0000000000000000 R/W: 0 Parameter: ffff82873a8ca8b4 0:000> !wselect mt 140728672460232 * from 000001521d577778 c0000005 Exception in netext.wselect debugger extension. PC: 00007ffdf76b6ba2 VA: 0000000000000000 R/W: 0 Parameter: ffff82873a8ca8b4

See the return type of method signatures

Is your feature request related to a problem? Please describe.
For a set of overloaded methods, I tried to figure out what those methods return, but I couldn't (neither with netext, nor with SOS itself). I then need to switch to other tools in order to figure it out (Google if it's a Microsoft type or use a .NET disassembler like dotPeek). Sometimes this requires saving the assembly (DLL) from the crash dump file to disk using .writemem, then starting the disassembler, loading the file and searching for the signature.

As for a public reproducible example, the String.Concat() methods return a new string, since the string class has an immutable design. The output of netext using !wclass is

[...]
	// JIT MODE: Ngen - THIS IS ONLY VALID FOR .NET 4.5 AND BEYOND
	// Click for breakpoint: 000007f81e8be060
	public static Concat(System.String, System.String);
[...]

but MSDN says:

public static string Concat (string str0, string str1);

Please note that MSDN has string after public static whereas netext doesn't.

Describe the solution you'd like
I'd like to see netext say public static string Concat(System.String, System.String); or possibly public static System.String Concat(System.String, System.String);

Describe alternatives you've considered
Today I'm using other products, typically dotPeek to figure it out. As described before, this can be a time consuming process, if I don't have the DLL on disk already.

Additional context
I'm doing production debugging as a service, so I'm not the developer and often I neither have the source code, nor DLLs, nor PDB files.

Here's how the IL code is displayed by dotPeek

method public hidebysig static string
    Concat(
      string str0,
      string str1
    ) cil managed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.