dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.18k stars 5.84k forks source link

dotnet-dump subcommand `dumpheap` returning `No CLR runtime found` #39774

Open upsampled opened 4 months ago

upsampled commented 4 months ago

Type of issue

Code doesn't work

Description

Following the Debug a memory leak in .NET guide, everything seems till work till I go to analyze the dump file:

PS C:\Users\Administrator> dotnet-dump analyze dump_20240301_195650.dmp
Loading core dump: dump_20240301_195650.dmp ...
Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command.
Type 'quit' or 'exit' to exit the session.
> dumpheap -stat
ERROR: No CLR runtime found. This means that a .NET runtime module or the DAC for the runtime can not be found or downloaded.

I was expecting the dump information presented in the tutorial.

Page URL

https://learn.microsoft.com/en-us/dotnet/core/diagnostics/debug-memory-leak

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/diagnostics/debug-memory-leak.md

Document Version Independent Id

03f3761e-be31-bae9-6ac7-ad86db389212

Article author

@tommcdon

Metadata

bthharper commented 4 months ago

Same for me, I get:

sh-4.2# dotnet dump analyze core_20240312_055956 
Loading core dump: core_20240312_055956 ...
Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command.
Type 'quit' or 'exit' to exit the session.
> clrmodules                                                                                                                                                                                                                                                                            
ERROR: No CLR runtime found. This means that a .NET runtime module or the DAC for the runtime can not be found or downloaded.
bthharper commented 4 months ago

Possibly related to mismatching .netcore versions - our app is running with 6.0.26 but the developer machine is running 6.0.27 or 28. However, even after installing the 6.0.26 or creating a docker container with only 6.0.26 does not fix the issue.

Dumps taken from 6.0.27 apps do work, however, our production environment is 6.0.26 and we need to analyze the core taken from that release.

I have tried:

dotnet-symbol  core_20240312_055956
dotnet-sos install

The same dumps cannot be debugged from Visual Studio 2022 or WInDBG either