SOS: control runtime candidate enumeration - #6010
Draft
hoyosjs wants to merge 1 commit into
Draft
Conversation
noahfalk
approved these changes
Sep 5, 2026
leculver
approved these changes
Sep 8, 2026
hoyosjs
force-pushed
the
juhoyosa/sos-runtime-enumeration
branch
from
September 8, 2026 19:46
7e5360a to
cc02149
Compare
max-charlamb
reviewed
Sep 9, 2026
Comment on lines
+98
to
+101
| CreateDataTargetOptions( | ||
| skipRuntimeEnumeration: false, | ||
| forceCompleteRuntimeEnumeration: | ||
| (flags & RuntimeEnumerationFlags.All) != 0)))) |
Member
There was a problem hiding this comment.
It looks like this enumerates the entire dump's modules again. Could we instead add a DataTarget.AddRuntime(ClrInfo) API to ClrMD, similar to AddLoadedRuntime, and use it here?
AddLoadedRuntime already contains the validation, locking, replacement, and duplicate-handling behavior required to register a host-discovered runtime:
This would avoid rerunning ClrMD runtime discovery on every final DataTarget. SOS would perform candidate-controlled discovery once, then register the already-selected metadata on each complete reader target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move runtime candidate selection into SOS while retaining ClrMD providers for exact
ClrInfometadata construction and legacy Desktop DAC activation.Default enumeration considers:
clr.dll,coreclr.dll,libcoreclr.so, andlibcoreclr.dylibDotNetRuntimeInfoorDotNetRuntimeContractDescriptorruntimes --allpasses every module to the registered ClrMD providers. AdditionalIRuntimeProviderimplementations can append runtimes to the runtime service without changing the public candidate provider.A short-lived filtered
IDataReaderis used only forClrInfodiscovery. Production DataTargets retain the complete module list, so debugger module enumeration, DACGetImageBase, image-backed reads, and stress-log resolution are unchanged.Acceptance applications
Two standalone applications and dumps were created outside the repository:
Results
eeversionandthreadssucceed after switching to CoreCLR and then Desktop CLR. CoreCLR reports version11.0.26.41219and four threads; Desktop CLR reports version4.8.9337.0and three threads.--allfind the same runtime;clrstackanddumpheapwork. Existingclrstack -ilimitation remains.Transitional ClrMD behavior
ClrMD enumeration remains enabled internally on each production DataTarget because the current legacy
DacLibraryrejects activation whenDataTarget.ClrVersionsis empty. SOS ignores that internal list and exposes only its candidate-controlled RuntimeService list. A future metadata-only ClrMDAddRuntime(ClrInfo)API can remove this duplicate internal enumeration and enableSkipRuntimeEnumeration=trueend to end.