Questions tagged [clrmd]

CLRMD is a managed library for analysis of crash dumps or live processes regarding .NET internals.

Microsoft Diagnostics Runtime Component (or short CLRMD) is a wrapper around the CLR internal-only debugging APIs. Is a managed code library for programmatical analysis of crash dumps or live processes and allows automating tasks which could otherwise be achived by WinDbg plugins SOS or SOSEX.

More info and code examples can be found here

35 questions
2
votes
1 answer

ClrMD Get Memory Dump time

I`m playing around with CLR Memory Diagnostics tool in order to analyze memory dumps. Opening a dump using WinDBG, I am able to use .time command to get the debug session time (when dump was captured). Does anybody knows the ClrMD API to get the…
Nikolay Mitikov
  • 523
  • 2
  • 16
1
vote
1 answer

Replacement of TryGetDacLocation()

On, GitHub for ClrMd, I read // If we just happen to have the correct dac file installed on the machine, // the "TryGetDacLocation" function will return its location on disk: string dacLocation = version.TryGetDacLocation(); I have added ClrMd via…
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
1
vote
1 answer

What is the ClrMD equivalent to !DumpHeap -live?

ClrMD is a great tool to inspect a live executable or a memory dump. To dump all managed heap objects as summary you can use https://blogs.msdn.microsoft.com/dotnet/2013/05/01/net-crash-dump-and-live-process-inspection/ var stats = from o in…
Alois Kraus
  • 13,229
  • 1
  • 38
  • 64
1
vote
3 answers

Calling WaitForSingleObject from C#

I am trying to call WaitForSingleObject method from C#, as documented here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx In order to call this function I need to create a Handle, or I need to get a Handle of type…
Pavel Durov
  • 1,287
  • 2
  • 13
  • 28
1
vote
1 answer

ClrMd - ClrInfo TryGetDacLocation and other method missing?

I am trying out the ClrMd Library : https://github.com/Microsoft/clrmd And I have this issue, according to the first tutorial I have a method called TryGetDacLocation in ClrInfo type, but as I can find it in it... I can see that Dac location are…
Pavel Durov
  • 1,287
  • 2
  • 13
  • 28
1
vote
2 answers

How to inspect WeakReference values with WinDBG/SOS and ClrMD?

I'm investigating a memory leak issue from production and retrieved a memory dump. I'm trying to dump the values of the accumulated object, the I met WeakReference. Here's what I got in WinDBG: 0:000> !do 000000011a306510 Name: …
Jeffrey Zhao
  • 4,923
  • 4
  • 30
  • 52
1
vote
3 answers

Finding a type's instance data in .net heap

Let's say I have two class Foo and Bar as follows public class Foo { private Bar _bar; private string _whatever = "whatever"; public Foo() { _bar = new Bar(); } public Bar TheBar { get …
whoami
  • 1,689
  • 3
  • 22
  • 45
1
vote
3 answers

Microsoft Diagnostics Runtime crash.dmp analysis (C#)

I'm trying to read in a crash.dmp using the functionality in Microsoft.Diagnostics.Runtime .NET componenet (also known as ClrMD). I have a crash.dmp in a known location (in a string called pathToFile) so that's not the issue. The rest of the code…
user2111939
0
votes
1 answer

ClrMd Execute "~*k" returns stack traces with clr!DllUnregisterServerInternal instead of correct values

When I execute "~*k" command via ClrMd, it returns stack traces with clr!DllUnregisterServerInternal instead of correct values. It looks like symbols are not loaded. If I perform "~*k" command directly in WinDBG, everything looks well. …
Slava
  • 1
0
votes
0 answers

Get property value of objects in minidump file using ClrMD

I am trying to read the value of a property of a ClrObject in a dmp file using ClrMD. I can read the values of any field of the object using the function GetField(string fieldName). Unfortunately, this is not possible for the properties. I have…
Snowcrack
  • 549
  • 1
  • 5
  • 13
0
votes
0 answers

How to reconstitute a C# object from a ClrMd pointer

I am using ClrMd to examine memory in a C# app and successively created a runtime object on a process. I use the runtime object to call EnumerateObjects(). This returns a collection of ulongs that are references to all the objects on the heap. If…
Richard
  • 181
  • 1
  • 3
0
votes
1 answer

clrmd - Getting System.Runtime.InteropServices.SEHException After using DataTarget.CreateSnapshotAndAttach

I'm want to get c# object inclusive size by using clrmd API. In order to get this information, first I need to attach to the process. To achieve this, I'm using DataTarget.CreateSnapshotAndAttach method. For some reason, the application crash after…
itaiy
  • 1,152
  • 1
  • 13
  • 22
0
votes
1 answer

ClrMD - AttachToProcess Using AttachFlag.Invasive and AttachFlag.NonInvasive Crashing

I'm using the Microsoft.Diagnostics.Runtime nuget package and this is my code as I attempt to get the stacktrace: var pid = Process.GetCurrentProcess().Id; // Line of error using (var dataTarget = DataTarget.AttachToProcess(pid, 5000,…
Thomas
  • 555
  • 7
  • 29
0
votes
0 answers

How to get the exception shown in WinDBG via CLRMD

When i open a crash dump (mini dump) via WinDBG it usually points to a particular call stack and exception. Likewise when i open it in Visual Studio (it also automatically selects the correct thread where the exception originated). In CLRMD i can…
rupertmulrenan
  • 355
  • 1
  • 3
  • 13
0
votes
0 answers

unknown_error_in_process via IDebugControl but resolves via WinDBG

I have been using CLRMD to load/analyze crash dumps using DbgEng (casting the IDebuggerInterface to the IDebugControl6). I am able to execute the same commands as in WinDBG. Most of the functionality works as expected, but i am noticing a difference…
rupertmulrenan
  • 355
  • 1
  • 3
  • 13