Repository navigation
Add cDAC dump enumerator - #132584
Add cDAC dump enumerator#132584max-charlamb wants to merge 9 commits into
Conversation
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds a Windows NativeAOT mscordaccore.dll provider backed by cDAC contracts for dump collection and metadata, integrated with CoreCLR.
Changes:
- Adds COM entrypoints and cDAC-based memory enumeration.
- Collects managed objects, methods, types, modules, and mini metadata.
- Integrates provider builds, resources, installation, and solution configuration.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Summary / final review note |
|---|---|
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.ICLRDataEnumMemoryRegions.cs |
Forwards legacy memory-region enumeration calls. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ICLRData.cs |
Adds callback declarations. Critical: the typed callback may break legacy COM marshalling. Nit: the new public API lacks approval. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/CdacErrorLogger.cs |
Adds legacy diagnostics logging. Nit: appears unused. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ObjectCollector.cs |
Collects objects and type names. Moderate: cancellation HRESULTs are swallowed. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MiniMetadataWriter.cs |
Writes DacStreams mini metadata. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/Microsoft.Diagnostics.DataContractReader.DumpCollect.csproj |
Defines the NativeAOT provider project. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MethodCollector.cs |
Collects method dependencies and names. Moderate: cancellation HRESULTs are swallowed. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs |
Bridges cDAC reads and callbacks. Critical: collection mode is incorrectly derived, causing mini and triage dumps to run heap phases. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/GenerateWindowsVersionResource.ps1 |
Generates the Windows version resource. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/Entrypoints.cs |
Exposes the COM entrypoint. Critical: IXCLRDataProcess initialization fails. Nit: integration coverage is missing. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/DumpCreator.cs |
Coordinates dump collection. Critical: mini dumps omit managed code regions and module PE/debug data. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/DumpCollectLogger.cs |
Provides provider diagnostics. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ContractDescriptorLocator.cs |
Locates the runtime contract descriptor. |
src/native/managed/cdac/cdac.slnx |
Adds the provider to the cDAC solution. |
src/coreclr/runtime.proj |
Publishes and configures the provider. Critical: Windows debug-subset builds publish neither the managed replacement nor an installed native DAC. |
src/coreclr/dlls/mscoree/coreclr/GenClrDebugResource.ps1 |
Generates the CLR debug resource. |
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt |
Embeds provider resource identity. |
src/coreclr/dlls/mscordac/CMakeLists.txt |
Adjusts native DAC installation behavior. |
Suppressed comments (6)
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt:250
- When
CLR_DUMP_COLLECT_PROVIDER_PATHis set, the command consumes that external provider at line 249, but this dependency list only tracks the nativemscordaccoretarget. Republishing/replacing the managed provider without rebuilding that target can leaveclr_debug_resource.binwith stale DAC timestamp/image-size identity, so incremental builds may embed an invalid provider identity. Add the selected provider path toDEPENDS(while retaining the target dependency for the fallback case).
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/GenClrDebugResource.ps1" mscordaccore mscordbi
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/DumpCreator.cs:60
- The
trycovers an entire phase, so one unreadable module, thread, or stack frame exits the phase and skips every later item. That undermines the stated best-effort behavior and can omit most regions from a dump because of one corrupt target structure. Catch and log failures at the individual-item loops (while preserving cancellation), leaving this wrapper for phase-level failures.
try
{
enumerate();
DumpCollectLogger.Log($"Completed {phase} enumeration.");
}
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MethodCollector.cs:27
- Both dependency enumeration calls run before the only guarded naming operation. If one frame points at unreadable/corrupt MethodDesc data, the exception escapes
CaptureMethod, aborts the entirethreadsphase throughDumpCreator.TryEnumerate, and prevents later threads from being collected. Handle failures per frame/dependency (while propagating cancellation) so one bad frame does not discard the rest of a best-effort dump.
EnumerateMethodDependencies(methodDesc);
EnumerateMethodDescDataDependencies(methodDesc);
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MethodCollector.cs:83
- The existing native DacStreams producer truncates a method name at the first
(and appends()before callingDacMdCacheAddEEName(seeMethodDesc::EnumMemoryRegions), but this path stores the full signature. The replacement provider therefore produces different names for!clrstackand other consumers than the established mini-metadata format; apply the same truncation before adding the method name.
TypeNameBuilder.AppendMethodInternal(
_target,
name,
method,
TypeNameFormat.FormatSignature |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MiniMetadataWriter.cs:19
- The new NativeAOT provider and its COM callback paths have no automated tests. Existing
DacStreamsTestsexercise the reader, but not the generated COM ABI, callback HRESULT/cancellation behavior, callback2 updates, pointer-size serialization, or the end-to-end mini/heap collection. Add focused tests (or a Windows end-to-end test) before relying on the manual dump check for this low-level provider.
public static void Write(
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ObjectCollector.cs:79
- Because the type and parent pointers come from target memory, this loop has no termination guard. A corrupt or cyclic MethodTable parent chain will spin forever, and the surrounding best-effort catch cannot recover from a hang; track visited MethodTable addresses or cap the traversal, as the thread walk does.
while (type.Address != TargetPointer.Null)
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Suppressed comments (2)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:33
clrFlagsis documented as reserved/ignored by the native implementation, and createdump always passesCLRDATA_ENUM_MEM_HEAP2even for--normaland--triage(crashinfo.cpp:378-383). As written, every non-full createdump request therefore runsEnumerateGC, loader heaps, sync blocks, and stress-log collection, turning mini/triage dumps into heap-sized dumps. Select heap enumeration fromMiniDumpWithPrivateReadWriteMemory, as the existing DAC does.
bool includeHeap =
clrFlags is CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP or CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP2
|| (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) != 0;
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ObjectCollector.cs:68
- This catch also consumes
COR_E_OPERATIONCANCELEDthrown by_emitter.Addabove. Cancellation while collecting an exception object is therefore ignored and dump generation continues, unlike everyTryEnumeratepath. Filter cancellation out so it reachesEnumMemoryRegionsand is returned to the caller.
catch (System.Exception)
{
}
|
Azure Pipelines: Successfully started running 6 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
src/coreclr/pal/prebuilt/inc/clrdata.h:155
- This file identifies itself as MIDL-generated at line 4, while the source
src/coreclr/inc/clrdata.idlis unchanged. Revert this whitespace-only generated-output churn rather than modifying the prebuilt artifact directly.
src/coreclr/pal/prebuilt/idl/clrdata_i.cpp:26 - This file identifies itself as MIDL-generated at line 4, while the source
src/coreclr/inc/clrdata.idlis unchanged. Revert this whitespace-only generated-output churn rather than modifying the prebuilt artifact directly.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:35
- This mode selection collapses every non-heap request into the regular mini path.
CLRDATA_ENUM_MEM_TRIAGE/MiniDumpFilterTriageare valid triage modes, andMiniDumpWithFullAuxiliaryStatehas separate native behavior (enummem.cpp:2044-2061). Since this DLL replaces the auxiliary provider, those requests silently receive the wrong region set. Dispatch supported modes explicitly, or reject/fallback for unsupported modes rather than treating them as mini.
bool includeHeap =
clrFlags is CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP or CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP2
|| (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) != 0;
new DumpCreator(target, runtimeModule, includeHeap, emitter).EnumerateMemoryRegions();
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Suppressed comments (10)
Previously missed (7) — in code that hasn't changed since the last review.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ObjectCollector.cs:68
- This catch also swallows
COR_E_OPERATIONCANCELEDraised by_emitter.Addor an implicit target read. The caller's cancellation is then ignored and dump collection continues; the surroundingDumpCreator.TryEnumerateexplicitly preserves cancellation, so this catch must do the same.
catch (System.Exception)
{
}
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/ObjectCollector.cs:160
- Target reads performed while formatting the type name can invoke the emitter and throw
COR_E_OPERATIONCANCELED; this blanket catch suppresses that cancellation and lets collection continue. Preserve cancellation here just asDumpCreator.TryEnumeratedoes.
catch (System.Exception)
{
}
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MethodCollector.cs:91
- Formatting a method performs target reads, so this catch can consume a
COR_E_OPERATIONCANCELEDfrom the enumeration callback. That prevents cancellation from reachingEnumMemoryRegionsand causes more callbacks after the caller requested termination.
catch (System.Exception)
{
}
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:126
- This passes zero-extended
TargetPointer.Valueaddresses to a callback whose address type isCLRDATA_ADDRESS. On 32-bit targets, that ABI requires sign extension (TO_CDADDRindacimpl.h:42;ConversionExtensions.ToClrDataAddressfollows the same rule), and this provider is enabled for x86. Regions above0x7fffffffwill therefore be reported under the wrong 64-bit address. Normalize callback addresses using the target pointer size before invoking the callback.
This issue also appears on line 174 of the same file.
int hr = _enumMemoryRegion(callback, address, chunkSize);
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MethodCollector.cs:87
- Mini-metadata method names must match the native DAC's compatibility shape. The native implementation formats the signature but then truncates at the first
(and appends)because!analyzeassumes that argument-list form (method.cpp:3965-3975). Writing the full signature here changes fallback symbols; truncate it before adding the name.
TypeNameFormat.FormatSignature |
TypeNameFormat.FormatNamespace |
TypeNameFormat.FormatFullInst);
src/coreclr/pal/prebuilt/inc/clrdata.h:155
- This file identifies itself as “ALWAYS GENERATED” at line 4, and the PR only removes generator-produced whitespace without changing
clrdata.idl. Revert this unrelated generated-file edit rather than hand-modifying prebuilt output.
src/coreclr/pal/prebuilt/idl/clrdata_i.cpp:26 - This is an “ALWAYS GENERATED” MIDL output file (line 4), and these whitespace-only removals have no corresponding source IDL change. Revert the generated-file churn.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:33
clrFlagsis intentionally ignored by the existing DAC;ClrDataAccess::EnumMemoryRegionsselects heap mode only fromMiniDumpWithPrivateReadWriteMemory(enummem.cpp:1991-2062). Callers such as createdump passCLRDATA_ENUM_MEM_HEAP2for every non-full dump, so consulting it here can turn a normal/triage dump into a heap dump. Derive this solely fromminiDumpFlagsto remain a drop-in provider.
bool includeHeap =
clrFlags is CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP or CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP2
|| (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) != 0;
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:35
- The provider never distinguishes
MiniDumpFilterTriage, so triage requests run the normal path. That path emitsExceptionData.Message, both stack-trace strings, Watson buckets, and module paths; the native triage worker deliberately omits the message and rewrites stack traces to remove file information (enummem.cpp:524-539, 638-653) because triage dumps must be PII-free. Pass a dump mode intoDumpCreatorand implement the triage-specific omissions/updates before enabling this provider.
new DumpCreator(target, runtimeModule, includeHeap, emitter).EnumerateMemoryRegions();
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:174
UpdateMemoryRegionalso takes aCLRDATA_ADDRESS, butbufferAddress.Valueis zero-extended on x86. If the mini-metadata buffer is above 2 GB, the update targets a different 64-bit address and the dump retains invalid/stale stream data. Apply the same target-width sign extension used for enumeration callbacks.
hr = updateMemoryRegion(callback2, address, (uint)buffer.Length, bufferPointer);
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MiniMetadataWriter.cs:46
- Stopping at the first name that does not fit drops every later entry, even though later names may be shorter and fit in the remaining mini-metadata buffer. The native writer rejects only the individual oversized entry and continues accepting subsequent names (
daccess.cpp:2412-2421). Continue here instead so one long generic name does not discard unrelated method/type names.
if (offset > buffer.Length - entrySize)
break;
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/DumpCreator.cs:245
- This cleanup-list traversal has no cycle detection. Since dump collection is explicitly best-effort for partially unreadable or corrupt targets, a repeated
LinkNextvalue makes dump creation loop forever instead of returning a partial dump. Track visited cleanup blocks, as the thread traversal already does, and stop when an address repeats.
TargetPointer cleanup = syncBlock.GetSyncBlockFromCleanupList();
while (cleanup != TargetPointer.Null)
cleanup = syncBlock.GetNextSyncBlock(cleanup);
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:35
- The non-heap provider path is not validated with an actual mini/triage dump. The existing dump harness only generates Heap and Full dumps (
DumpTests.targets:223-228), and Full dumps already contain process memory, so they cannot detect omitted regions in this path. Add a Mini (and ideally Triage) dump case that verifies stack walking and mini-metadata names before making this provider the default.
bool includeHeap =
clrFlags is CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP or CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP2
|| (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) != 0;
new DumpCreator(target, runtimeModule, includeHeap, emitter).EnumerateMemoryRegions();
3619b59 to
4f3c6f7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Suppressed comments (2)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/DumpCreator.cs:245
- A corrupt cleanup list can contain a cycle, making this traversal hang dump collection permanently. Other pointer-list traversals in this area guard cycles (for example
Loader_1.cs:767-779); track visited cleanup nodes here as well.
[!NOTE]
Generated by GitHub Copilot.
TargetPointer cleanup = syncBlock.GetSyncBlockFromCleanupList();
while (cleanup != TargetPointer.Null)
cleanup = syncBlock.GetNextSyncBlock(cleanup);
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.DumpCollect/MemoryRegionEnumerator.cs:35
- The new provider has a distinct skinny-mini path when
includeHeapis false, but the cDAC dump suite currently generates only heap (MiniDumpType=2) and full (4) dumps; full dumps bypass auxiliary-provider enumeration. Add aMiniDumpType=1case that validates the resulting dump so CI covers the mini behavior claimed by this PR, not only the heap branch.
[!NOTE]
Generated by GitHub Copilot.
bool includeHeap =
clrFlags is CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP or CLRDataEnumMemoryFlags.CLRDATA_ENUM_MEM_HEAP2
|| (miniDumpFlags & MiniDumpWithPrivateReadWriteMemory) != 0;
new DumpCreator(target, runtimeModule, includeHeap, emitter).EnumerateMemoryRegions();
4f3c6f7 to
3145219
Compare
5703248 to
5373800
Compare
## Summary - link the PAL and remote-unwinding support directly into the Unix createdump executable - initialize the PAL before running createdump and terminate with createdump's exit code - remove the DAC PAL forwarding layer and local PAL API substitutes This removes createdump's dependency on `libmscordaccore` for PAL services while leaving the native DAC available for managed diagnostics. ## Context This is preparation for #132584, which removes the native DAC's role in dump enumeration. Createdump currently borrows PAL initialization and remote-unwinding exports from the DAC, so it must own those dependencies before the DAC can be removed from that path. ## Validation - `git diff --check` - Unix build and runtime coverage will run in CI > [!NOTE] > This pull request description was generated with GitHub Copilot. --------- Co-authored-by: Max Charlamb <maxcharlamb@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 691bc836-ba1c-4298-8497-dc66aca0f385
41c065b to
a2b91ed
Compare
Implement shared dump collection, explicit activation and runtime image lookup, and auxiliary-symbol coverage with managed tests and documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Expose runtime contract discovery through createdump data targets, select the enumerator in native build metadata and Windows resources, and update PAL linkage and diagnostics pipeline coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Update the upstream WASM optional-field test to assert the generated read helper succeeds, and document its boolean failure behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Keep the universal DBI, runtime identity and WER provider resources while omitting the legacy DAC/DBI pair and its lookup identities only in enumerator-enabled builds. Restore the standard legacy DBI PAL linkage and document the Windows dbgshim discovery limitation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Move dump-mode parsing and callback wrapping to the COM entrypoint. Let DumpCreator own enumeration setup and use a namespace-level DumpType throughout collection, with private construction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Share PE parsing between descriptor-export activation and native/managed image collection. Include debug-directory payloads, apply triage path sanitization, and clarify enumeration and sanitizer ownership with targeted regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Capture a target-pointer-sized region at each live or saved exception IP to support method-instance source lookup without call-site decoding. Add focused collection tests and update the collector and generated contract documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Retain CLR recognition metadata with zero legacy DAC/DBI identities and track generated resource payloads for incremental builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
c33f8f2 to
a07b51e
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: de3eab4e-b090-430a-8e30-6b204fb1519a
Summary
Add an opt-in NativeAOT cDAC dump enumerator, enabled with
UseCdacDumpCollectProvider=true. Themscordaccore_enummemoryproject produces a separate native binary frommscordaccore_universal, installed under the platform's existingmscordaccorename in place of the legacy DAC. Default builds retain the legacy DAC.The branch is rebased onto
mainat817a7b49e65. The core feature is split into managed and native/build-integration commits, with follow-up commits for test/documentation integration and conditional legacy DBI removal.Shared collection and activation
Both hosts use the collection engine in
Microsoft.Diagnostics.DataContractReader.Legacy/EnumMemorythroughSOSDacImpl.ICLRDataEnumMemoryRegions. Other requested interfaces, includingIXCLRDataProcess, use the existing shared cDAC implementation rather than a separate reduced process implementation.Collection flushes cached target data and contract state, then scopes a read callback around the existing target to report successful memory reads. Descriptor storage, runtime image regions, and other explicitly required regions are also included. The callback scope restores the previous reader on success, failure, or cancellation.
EntrypointHelpersshares COM activation and address lookup. Enummemory activation first requires a nonzero runtime image base, usingICLRRuntimeLocatorwith the native DAC-styleGetImageBasefallback. It then obtains the contract descriptor throughICLRContractLocator, falling back to the runtime's PE exports if the locator is unavailable or unsuccessful. Activation fails without either required address.RuntimeModuleInfoowns PE parsing and region enumeration in the EnumMemory layer.Universal activation does not acquire the PE fallback: its descriptor locator must succeed unless an explicit descriptor address was supplied. Its optional runtime image lookup uses only
ICLRRuntimeLocator.Native and build integration
createdumpdiscovers the contract descriptor during module enumeration and exposes it through the newICLRContractLocatordata-target interface. It continues to activate the DAC throughCLRDataCreateInstance.Collector-enabled builds publish the enummemory host before native compilation and pass its path through
CLR_DUMP_ENUMERATOR_PATH. These builds omit both the legacy DAC and legacy DBI, while retainingmscordbi_universal.When the legacy pair is not built, omit the Windows
CLRDEBUGINFOresources and leave the DAC/DBI identity indexes inDotNetRuntimeInfoempty. Runtime identity/version fields and WER's separate dump-provider resources remain intact; the latter name or embed the enumerator binary. Standard builds retain the legacy binaries and their debugging identities unchanged.Known limitation: current Windows dbgshim runtime-discovery paths require those legacy identities before reaching some cDAC activation paths. Those paths need a complementary diagnostics change to recognize builds without legacy identities. This change does not claim that live-debugging discovery works without that follow-up.
Unix createdump links its own PAL support. Legacy mscordbi's existing DAC-shared PAL linkage is unchanged; no private-PAL variant of legacy mscordbi is needed. The provider replacement is opt-in; the shared activation refactoring and createdump PAL changes are not all conditional on that property.
Memory policy
Metadata reads used to format names are excluded from implicit read enumeration, consistent with the legacy DAC's metadata policy. The auxiliary-symbol dump test exercises known JIT helpers from heap dumps.
Diagnostics CI
Preserve the upstream cross-platform SOS.Tests Helix pipeline and add separate standard and
_EnumMemorybuild/test pairs on every configured SOS platform.SOSHARNESS_ONLY_DAC=CDacon both Windows and Unix.Buildjobs for cDAC dump/stress testing enableUseCdacDumpCollectProvider=true, preserving downstream dependency names.Validation
For the rebased working tree:
TryReadAllFields()succeeds, retaining its missing-field assertions.HelixPreCommandsfeeds worker precommands.runtimeinfo,mscordbi_universal, and their runtime dependencies in standard and enumerator configurations, includingcoreclr_static.DotNetRuntimeInfocontents, and compiled DLL/static-runtime resources: legacy binaries/identities are present only in standard builds; runtime identity/version and WER resources remain in both. The embedded WER resource matched the selected provider binary byte-for-byte.Before the rebase, the full EnumMemory test class had 180 passing cases and one known failure in
NativeDataTarget_AlignsThreadContextsAndPreservesFailure(result: 1, corDebug: True); this PR does not claim a clean full suite.Earlier-revision diagnostics CI is available in build 1605660 for
a3e4279e567; it is not validation of the current revision.Suggested review order
mscordaccore_enummemory/Entrypoints.cs, sharedLegacy/Entrypoints/EntrypointHelpers.cs, and universal activation.Legacy/EnumMemory: collection policy, method/object collectors, and runtime image parsing.Note
This pull request description was generated with GitHub Copilot.