Skip to content

Fix dumpgcdata test's pinned-object assumption - #6128

Merged
max-charlamb merged 4 commits into
dotnet:mainfrom
max-charlamb:fix-dumpgcdata-compaction-test
Oct 22, 2026
Merged

max-charlamb merged 4 commits into
dotnet:mainfrom
max-charlamb:fix-dumpgcdata-compaction-test

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Fixes dotnet/runtime#136190.

The SOS test treated dumpgcdata's pre and post pin statistic as a pinned-object count. It actually records a GC pinned-plug bookkeeping condition. The expected value depended on a runtime-owned pinned sentinel, not the debuggee's pinned 1 MB array. Moving that sentinel to the frozen heap in dotnet/runtime#135326 exposed the faulty assumption; changing the expectation to zero would preserve the same problem.

Replace this incidental oracle with a controlled GC operation:

  • Explicitly request a forced, blocking, compacting full collection between two stop points.
  • Check that each heap's induced compacting GC counter increases from its observed baseline, without assuming an initial or final count.
  • Preserve the per-heap GC statistics coverage for [DAC] fix dac_gc_heap marshalling runtime#119393, including server GC, and retain the .NET 8/9 exclusion for that DAC marshalling defect.
  • Update the debuggee, stop-point catalog, test names, and coverage documentation together.

No runtime or cDAC implementation changes are needed.

Validation

  • Targeted SOS.Tests and debugger-host builds passed.
  • All 15 revised cases passed on Windows x64 across .NET 10/11, CDB and dotnet-dump, live/dump targets, workstation/server GC, and applicable legacy/cDAC configurations.
  • Negative control: temporarily removing the explicit collection caused the .NET 11 server-GC cDAC case to fail because the counter remained zero. Restoring the collection made the matrix pass again.

Exercise per-heap GC statistics by checking that an explicitly induced compacting collection increases each heap's compaction-reason counter. The pre-and-post-pin statistic is not a pinned-object count and depended on a runtime-owned sentinel that moved to the frozen heap.

Fixes dotnet/runtime#136190

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e2c5c55e-f006-43a2-ace3-956b3a1b4121
@max-charlamb
max-charlamb requested a review from a team as a code owner October 22, 2026 17:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e2c5c55e-f006-43a2-ace3-956b3a1b4121
Comment thread src/tests/SOS.Tests/COVERAGE.md
Max Charlamb added 2 commits October 22, 2026 15:35
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e2c5c55e-f006-43a2-ace3-956b3a1b4121
This reverts commit ad2646f.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e2c5c55e-f006-43a2-ace3-956b3a1b4121
@max-charlamb
max-charlamb enabled auto-merge (squash) October 22, 2026 20:35
@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g CI previously passed and blocks clean CI in runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SOS.Tests.DiagnosticCommandTests.DumpGcData tests failures

2 participants