Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

ci(verify): keep and print Windows crash dumps from the engine suites

Richie McIlroy8578930273ad
diff --git a/.github/workflows/engine-verify-os.yml b/.github/workflows/engine-verify-os.yml
index a6cd1398c..959b8bd04 100644
--- a/.github/workflows/engine-verify-os.yml
+++ b/.github/workflows/engine-verify-os.yml
@@ -185,6 +185,26 @@ jobs:
shell: bash
run: touch "$RUNNER_TEMP/crash-reports-since"
+ # A test process that crashes on Windows (0xc0000005) leaves nothing:
+ # Git Bash starts run.sh's children with crash reporting off. Tests run
+ # through PowerShell instead (scripts/verify/native-launch.ps1, about
+ # 1 s per test process), and Windows keeps a dump of any crash.
+ - name: Keep Windows crash dumps
+ if: inputs.platform == 'windows'
+ shell: pwsh
+ run: |
+ $dir = "$env:RUNNER_TEMP\verify-report\crash-dumps"
+ New-Item -ItemType Directory -Force $dir | Out-Null
+ $key = "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"
+ New-Item -Path $key -Force | Out-Null
+ New-ItemProperty -Path $key -Name DumpFolder -Value $dir -PropertyType ExpandString -Force | Out-Null
+ New-ItemProperty -Path $key -Name DumpType -Value 1 -PropertyType DWord -Force | Out-Null
+ New-ItemProperty -Path $key -Name DumpCount -Value 10 -PropertyType DWord -Force | Out-Null
+ Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Type DWord
+ Start-Service WerSvc
+ $launcher = Join-Path $env:GITHUB_WORKSPACE "scripts\verify\native-launch.ps1"
+ "CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER=powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -File $launcher" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
+
- name: Prepare recorded fixtures without concurrent rendering
if: contains(format(',{0},', inputs.suites), ',export,')
shell: bash
@@ -243,6 +263,21 @@ jobs:
echo "collected=true" >> "$GITHUB_OUTPUT"
fi
+ - name: Print Windows crash stacks
+ if: failure() && inputs.platform == 'windows'
+ continue-on-error: true
+ shell: bash
+ run: |
+ cdb="/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/cdb.exe"
+ symbols="$(cygpath -w "$GITHUB_WORKSPACE/target/$CAP_VERIFY_CARGO_PROFILE/deps");srv*$(cygpath -w "$RUNNER_TEMP/symbols")*https://msdl.microsoft.com/download/symbols"
+ for dump in "$RUNNER_TEMP"/verify-report/crash-dumps/*.dmp; do
+ [[ -f "$dump" ]] || continue
+ echo "::group::$(basename "$dump")"
+ "$cdb" -z "$(cygpath -w "$dump")" -y "$symbols" -c ".ecxr; kb 40; q" 2>&1 |
+ grep -E 'ExceptionCode|Access violation|Child-SP|^[0-9a-f]{2} [0-9a-f]{8}`' | head -60
+ echo "::endgroup::"
+ done
+
- name: Upload report
if: always() && (steps.test.outcome != 'skipped' || steps.crash-reports.outputs.collected == 'true')
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
diff --git a/scripts/verify/native-launch.ps1 b/scripts/verify/native-launch.ps1
new file mode 100644
index 000000000..302e083ad
--- /dev/null
+++ b/scripts/verify/native-launch.ps1
@@ -0,0 +1,8 @@
+# Starts a test binary from PowerShell. Git Bash starts its child processes
+# with Windows crash reporting off (SEM_NOGPFAULTERRORBOX), so a test that
+# crashes under run.sh leaves no dump; PowerShell clears that mode.
+$exe = $args[0]
+$rest = @()
+if ($args.Count -gt 1) { $rest = $args[1..($args.Count - 1)] }
+$process = Start-Process -FilePath $exe -ArgumentList $rest -NoNewWindow -Wait -PassThru
+exit $process.ExitCode