Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/cdac/prepare-cdac-helix-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ steps:

$queue = switch ("$(osGroup)_$(archType)") {
"windows_x64" { "$(helix_windows_x64)" }
"windows_x86" { "$(helix_windows_x64)" }
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new "windows_x86" case currently maps to $(helix_windows_x64) (which is the latest Windows x64 alias), even though this PR introduces a dedicated helix_windows_x86 variable (Windows 10 queue) and the PR description calls out Windows.10.Amd64.Open. Switch the case to use $(helix_windows_x86) so queue selection matches the intended x86 coverage/OS baseline.

Suggested change
"windows_x86" { "$(helix_windows_x64)" }
"windows_x86" { "$(helix_windows_x86)" }

Copilot uses AI. Check for mistakes.
"windows_arm64" { "$(helix_windows_arm64)" }
"linux_x64" { "$(helix_linux_x64_oldest)" }
"linux_arm64" { "$(helix_linux_arm64_oldest)" }
"linux_arm" { "$(helix_linux_arm32_oldest)" }
Comment on lines 39 to +45
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The windows_x86 queue selection is currently wired to $(helix_windows_x64), which (via helix-platforms.yml) targets the Windows x64 latest queue. This doesn’t match the PR intent of running x86 on the dedicated helix_windows_x86 (Windows 10) queue and also leaves the newly-added helix_windows_x86 variable unused. Point the windows_x86 case at $(helix_windows_x86) (or the intended Windows 10 queue alias).

Copilot uses AI. Check for mistakes.
"osx_x64" { "$(helix_macos_x64)" }
"osx_arm64" { "$(helix_macos_arm64)" }
default { Write-Error "Unsupported platform: $(osGroup)_$(archType)"; exit 1 }
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/helix-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ variables:
- name: helix_windows_arm64_oldest_internal
value: Windows.10.Arm64

# Windows x86 (runs on x64 machines via WoW64)
- name: helix_windows_x86
value: Windows.10.Amd64.Open

Comment on lines +260 to +263
# ===========================================
# Browser/WASM Platforms
# ===========================================
Expand Down
15 changes: 12 additions & 3 deletions eng/pipelines/runtime-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ parameters:
type: object
default:
- windows_x64
- windows_x86
- linux_x64
- windows_arm64
- linux_arm64
- linux_arm
# TODO: Re-enable osx once disk space issue is resolved.
# macOS full dumps are ~5.7GB each; with 8+ full-dump debuggees the Helix
# machines run out of disk space (~45GB total). See PR #124782 for details.
Expand Down Expand Up @@ -216,11 +218,18 @@ extends:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
displayName: 'Send cDAC Dump Tests to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) "/p:HelixTargetQueues=$(CdacHelixQueue)" /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/helixresults
artifactName: CdacDumps_$(osGroup)_$(archType)
displayName: 'Publish Dump Artifacts'
condition: and(always(), ne(variables['Agent.JobStatus'], 'Succeeded'))
continueOnError: true
- pwsh: |
if ("$(Agent.JobStatus)" -ne "Succeeded") {
Write-Error "One or more cDAC dump test failures were detected. Failing the job."
Expand Down Expand Up @@ -253,7 +262,7 @@ extends:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
displayName: 'Send cDAC Dump Gen to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:DumpOnly=true /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendDumpGenToHelix.binlog
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:DumpOnly=true /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) "/p:HelixTargetQueues=$(CdacHelixQueue)" /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendDumpGenToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Expand Down Expand Up @@ -329,7 +338,7 @@ extends:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
displayName: 'Send cDAC X-Plat Dump Tests to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendXPlatTestToHelix.binlog
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) "/p:HelixTargetQueues=$(CdacHelixQueue)" /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendXPlatTestToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Expand Down
19 changes: 2 additions & 17 deletions src/native/managed/cdac/tests/DumpTests/DumpTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,8 @@
<DumpRuntimeVersion Include="$(DumpVersions)" />
</ItemGroup>

<!--
On Windows, heap dumps (type 2) require the DAC (mscordaccore.dll) which is unsigned
in local/CI builds. Set the DisableAuxProviderSignatureCheck registry value so that
MiniDumpWriteDump accepts the unsigned DAC. Windows 11+ / Server 2022+ only.

This is opt-in via /p:SetDisableAuxProviderSignatureCheck=true to avoid surprising
machine-wide registry changes during a normal build.
-->
<Target Name="_EnableUnsignedDacWindows"
BeforeTargets="GenerateAllDumps"
Condition="'$(HostOS)' == 'windows' AND '$(SetDisableAuxProviderSignatureCheck)' == 'true'">
<Exec Command="reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings&quot; /v DisableAuxProviderSignatureCheck /t REG_DWORD /d 1 /f"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true" />
<Message Text="Note: If heap dump generation fails on Windows, ensure the DisableAuxProviderSignatureCheck registry key is set. Run as admin or set manually: reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings&quot; /v DisableAuxProviderSignatureCheck /t REG_DWORD /d 1 /f"
Importance="normal" />
</Target>
<!-- Unsigned DAC registry key for heap dumps (shared with cdac-dump-helix.proj) -->
<Import Project="EnableUnsignedDac.props" />

<!-- Filter out Windows-only debuggees on non-Windows platforms. Debuggees opt in
by setting <WindowsOnly>true</WindowsOnly> in their csproj. -->
Expand Down
33 changes: 33 additions & 0 deletions src/native/managed/cdac/tests/DumpTests/EnableUnsignedDac.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>

<!--
On Windows, heap dumps (type 2) require the DAC (mscordaccore.dll) which is unsigned
in local/CI builds. Set the DisableAuxProviderSignatureCheck registry value so that
MiniDumpWriteDump accepts the unsigned DAC. Windows 11+ / Server 2022+ only.

The key must be set in both the native (64-bit) and WoW64 (32-bit) registry views.
Without /reg:32, x86 processes running under WoW64 read from
HKLM\SOFTWARE\WOW6432Node\... and miss the key, producing degraded dumps.
-->

<PropertyGroup>
<_DacRegKey>HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings</_DacRegKey>
<_DacRegAdd>reg add &quot;$(_DacRegKey)&quot; /v DisableAuxProviderSignatureCheck /t REG_DWORD /d 1 /f</_DacRegAdd>
<_DacRegAdd32>$(_DacRegAdd) /reg:32</_DacRegAdd32>
</PropertyGroup>

<!--
MSBuild target for local/CI builds (opt-in via /p:SetDisableAuxProviderSignatureCheck=true).
-->
<Target Name="_EnableUnsignedDacWindows"
BeforeTargets="GenerateAllDumps"
Condition="'$(HostOS)' == 'windows' AND '$(SetDisableAuxProviderSignatureCheck)' == 'true'">
<Exec Command="$(_DacRegAdd)" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" />
<!-- WoW64 view only needed for x86 processes -->
<Exec Command="$(_DacRegAdd32)" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true"
Condition="'$(TargetArchitecture)' == 'x86'" />
<Message Text="Note: If heap dump generation fails on Windows, ensure the DisableAuxProviderSignatureCheck registry key is set. Run as admin or set manually: $(_DacRegAdd)"
Importance="normal" />
</Target>

</Project>
14 changes: 10 additions & 4 deletions src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
derived from each debuggee's DumpTypes property (Heap->heap/2, Full->full/4).
-->
<Import Project="$(DumpTestsPayload)/debuggee-metadata.props" />
<Import Project="$(MSBuildThisFileDirectory)EnableUnsignedDac.props" />

<!--
Helix work item command: generate dumps then run tests (or tar + upload).
Expand All @@ -83,7 +84,8 @@
<!-- Windows: test mode tail command -->
<PropertyGroup Condition="'$(TargetOS)' == 'windows' AND '$(DumpOnly)' != 'true'">
<_TestCommand>%HELIX_CORRELATION_PAYLOAD%\dotnet.exe exec --runtimeconfig %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json %HELIX_WORKITEM_PAYLOAD%\tests\xunit.console.dll %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo</_TestCommand>
<_FullCommand>$(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand)</_FullCommand>
<_TarCommand>tar -czf %HELIX_WORKITEM_UPLOAD_ROOT%\dumps.tar.gz -C %HELIX_WORKITEM_PAYLOAD%\dumps .</_TarCommand>
<_FullCommand>$(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand) &amp; $(_TarCommand)</_FullCommand>
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows, appending $(_TarCommand) at the end of _FullCommand means the overall process exit code becomes tar's exit code (cmd uses the last command’s ERRORLEVEL). If the xunit run fails/crashes and the reporter doesn’t produce usable XML, this can mask the failure and incorrectly report the Helix work item as succeeded. Consider preserving the test exit code (capture ERRORLEVEL before running tar and exit /b with that code), and optionally only run tar when the test command fails.

Suggested change
<_FullCommand>$(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand) &amp; $(_TarCommand)</_FullCommand>
<_FullCommand>set "_testExitCode=0" &amp; $(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand) &amp; set "_testExitCode=%ERRORLEVEL%" &amp; $(_TarCommand) &amp; exit /b %_testExitCode%</_FullCommand>

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Windows test-mode command chain, appending the tar step with & will overwrite the %ERRORLEVEL% from the xUnit run (and potentially from earlier steps) with tar's exit code. That can cause Helix to report the work item as successful even when tests fail. Consider capturing the test exit code before running tar and exiting with that original code after tar completes (while still tarring for diagnostics).

Suggested change
<_FullCommand>$(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand) &amp; $(_TarCommand)</_FullCommand>
<_FullCommand>cmd /v:ON /c "$(_DumpGenCommands) &amp; $(_DumpInfoCommand) &amp; $(_TestCommand) &amp; set _testExitCode=!ERRORLEVEL! &amp; $(_TarCommand) &amp; exit /b !_testExitCode!"</_FullCommand>

Copilot uses AI. Check for mistakes.
</PropertyGroup>

<!-- Windows: DumpOnly mode tail command -->
Expand All @@ -101,7 +103,8 @@
<!-- Unix: test mode tail command -->
<PropertyGroup Condition="'$(TargetOS)' != 'windows' AND '$(DumpOnly)' != 'true'">
<_TestCommand>$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo</_TestCommand>
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand)</_FullCommand>
<_TarCommand>tar -czf $HELIX_WORKITEM_UPLOAD_ROOT/dumps.tar.gz -C $HELIX_WORKITEM_PAYLOAD/dumps .</_TarCommand>
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand) ; $(_TarCommand)</_FullCommand>
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Unix, _FullCommand ends with ; $(_TarCommand), so the work item’s exit status becomes the tar exit status (not the dumpgen/dumpinfo/xunit chain). This can hide failures (e.g., xunit crash/OOM, missing runtimeconfig, etc.) if tar succeeds. Capture/propagate the original exit code (e.g., save $? before tar and exit with it) so Helix reliably fails the work item when the test command fails.

Suggested change
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand) ; $(_TarCommand)</_FullCommand>
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand) ; exit_code=$? ; $(_TarCommand) ; exit $exit_code</_FullCommand>

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Unix test-mode command chain, using ; $(_TarCommand) will make the overall shell command exit with tar's status, not the xUnit run's status. This can mask test failures if tar succeeds. Preserve the xUnit exit code (e.g., save $? before tarring and exit with it afterward) so Helix correctly fails the work item while still producing dumps.tar.gz.

Suggested change
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand) ; $(_TarCommand)</_FullCommand>
<_FullCommand>$(_DumpGenCommands) &amp;&amp; $(_DumpInfoCommand) &amp;&amp; $(_TestCommand) ; test_exit=$? ; $(_TarCommand) ; exit $test_exit</_FullCommand>

Copilot uses AI. Check for mistakes.
</PropertyGroup>

<!-- Unix: DumpOnly mode tail command -->
Expand All @@ -113,7 +116,9 @@
<!-- Pre-commands: enable dump generation -->
<ItemGroup Condition="'$(TargetOS)' == 'windows'">
<!-- Allow heap dump generation with the unsigned locally-built DAC -->
<HelixPreCommand Include="reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings&quot; /v DisableAuxProviderSignatureCheck /t REG_DWORD /d 1 /f 2&gt;nul || (echo DisableAuxProviderSignatureCheck registry write skipped &amp; exit /b 0)" />
<HelixPreCommand Include="$(_DacRegAdd) 2&gt;nul || (echo DisableAuxProviderSignatureCheck registry write skipped &amp; exit /b 0)" />
<!-- WoW64 view only needed for x86 processes -->
<HelixPreCommand Condition="'$(TargetArchitecture)' == 'x86'" Include="$(_DacRegAdd32) 2&gt;nul || (echo DisableAuxProviderSignatureCheck /reg:32 registry write skipped &amp; exit /b 0)" />
<HelixPreCommand Include="set DOTNET_DbgEnableMiniDump=1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetOS)' != 'windows'">
Expand All @@ -133,12 +138,13 @@
<HelixPreCommands>@(HelixPreCommand)</HelixPreCommands>
</PropertyGroup>

<!-- Test mode: generate dumps then run tests -->
<!-- Test mode: generate dumps, run tests, then tar dumps for download on failure -->
<ItemGroup Condition="'$(DumpOnly)' != 'true'">
<HelixWorkItem Include="CdacDumpTests">
<PayloadDirectory>$(DumpTestsPayload)</PayloadDirectory>
<Command>$(_FullCommand)</Command>
<Timeout>$(WorkItemTimeout)</Timeout>
<DownloadFilesFromResults>dumps.tar.gz</DownloadFilesFromResults>
Comment on lines +141 to +147
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated comment says dumps are tarred “for download on failure”, but _TarCommand is executed unconditionally in the test-mode _FullCommand on both Windows and Unix. Either adjust the comment to reflect the unconditional tar, or gate tar creation to failure if that’s the intent.

Copilot uses AI. Check for mistakes.
</HelixWorkItem>
Comment on lines +141 to 148
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In test mode, the work item now always creates dumps.tar.gz and requests it via DownloadFilesFromResults. Given dump sizes (multi-GB full dumps), this will upload/download large artifacts even on successful runs, which can significantly increase Helix time, storage, and pipeline bandwidth. If the intent is “download on failure”, consider only creating/downloading the tar when tests fail (or gate it behind a property), and keep the default path lightweight for passing runs.

Copilot uses AI. Check for mistakes.
</ItemGroup>

Expand Down
Loading