Create a HelloWorld .Net Core app v3.1 (probably other versions work too) that hangs waiting for Console.ReadLine() to return
Run the app and let it hang
Write this code using CLRMD replacing the PID with the pid of your app
using Microsoft.Diagnostics.Runtime;
using Microsoft.Diagnostics.Runtime.DacInterface;
using System;
namespace ConsoleApp46
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
using DataTarget dt = DataTarget.AttachToProcess(39768, suspend: true); // replace the PID here
ClrRuntime runtime = dt.ClrVersions[0].CreateRuntime();
SOSDac dac = runtime.DacLibrary.SOSDacInterface;
JitManagerInfo[] jitMgrs = dac.GetJitManagers();
foreach(JitManagerInfo jmi in jitMgrs)
{
JitCodeHeapInfo[] heaps = dac.GetCodeHeapList(jmi.Address);
}
}
}
}
Expected behavior: heaps[i].Address should have a non-zero value for some index because some code was jitted
Actual behavior: There is only one heap reported and it has a zero value Address property (which means 0 sized code)
Similar bad behavior can be reproed with SOS running the EEHeap command and observing part of the output saying:
Repro:
Expected behavior: heaps[i].Address should have a non-zero value for some index because some code was jitted Actual behavior: There is only one heap reported and it has a zero value Address property (which means 0 sized code)
Similar bad behavior can be reproed with SOS running the EEHeap command and observing part of the output saying: