Uh oh!
There was an error while loading. Please reload this page.
[GC] Preserve workstation GC diagnostic data in heap dumps - #132973
[GC] Preserve workstation GC diagnostic data in heap dumps#132973max-charlamb wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3074ed7-2a88-4fa7-92fd-5b96a9ff20c6
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Tagging subscribers to this area: @anicka-net, @dotnet/gc |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates CoreCLR GC/DAC plumbing to surface the workstation GC card-table pointer via versioned GcDacVars, enabling DAC consumers to read/enumerate it when available while preserving fallback behavior for older standalone GCs.
Changes:
- Bump GC interface minor version to 9.
- Add a new versioned
GcDacVarsentry for the WKScard_tablepointer and populate it when supported. - Update DAC heap-detail retrieval and WKS global memory enumeration to use the versioned
card_tablewhen available (fallback tog_card_tableotherwise).
File summaries
| File | Description |
|---|---|
| src/coreclr/gc/gcinterface.h | Bumps GC_INTERFACE_MINOR_VERSION to 9. |
| src/coreclr/gc/gcinterface.dacvars.def | Appends card_table to the versioned DAC vars definition (v5.9). |
| src/coreclr/gc/gc.cpp | Extends PopulateDacVars to populate the new v9 card_table DAC var in WKS builds. |
| src/coreclr/debug/daccess/request.cpp | Uses the versioned card_table when GC DAC minor >= 9 and enumerates its storage for WKS dumps. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3074ed7-2a88-4fa7-92fd-5b96a9ff20c6
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3074ed7-2a88-4fa7-92fd-5b96a9ff20c6
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/coreclr/gc/gc.cpp:4531
PopulateDacVarsuses the incominggcDacVars->minor_version_numberto gate which fields are populated (v2/v4/v6/v8/v9), but then unconditionally overwritesminor_version_numberwith 9. In a standalone-GC mismatch (new GC + older runtime), this can report v9 even when v9 fields weren’t populated, which can lead the DAC to read/enumerate fields that aren’t actually present/populated.
gcDacVars->major_version_number = 2;
gcDacVars->minor_version_number = 9;
if (v2)
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
steveisok
commented
Sep 1, 2026
I generated a dump w/ cdb and the runtime with this PR - all good. |
Summary
card_tablepointer toGcDacVarsat GC interface minor version 9.interesting_data_per_heap,compact_reasons_per_heap,expand_mechanisms_per_heap, andinteresting_mechanism_bits_per_heaparrays.Before this change, CDB
/mwheap dumps did not preserve the workstation card-table pointer storage and preserved only the first element of each GC diagnostics array. After the card-table read was fixed, legacy DAC!dumpgcdatacould load the dump and print global GC mechanisms, but failed when requesting per-heap interesting information:cDAC's GC contract also eagerly reads these complete arrays while constructing
GCHeapData, so it encountered the same missing-memory problem. Explicitly preserving the card-table pointer and complete diagnostic-array ranges makes this data available to both the legacy DAC API used by!dumpgcdataand the cDAC GC heap reader.Testing
./build.cmd clr -rc checked./build.cmd clr+libs -rc release./build.cmd clr+libs+host -rc releasesrc/tests/build.cmd -GenerateLayoutOnly x64 Release/mwdump from a workstation GC process after GC initialization.Error requesting interesting GC infofrom!dumpgcdata.!dumpgcdata.Note
This pull request description was generated with GitHub Copilot.