Skip to content

Commit e3c5060

Browse files
committed
Add more diagnostics on why we do not see crash dumps
1 parent 066aa9b commit e3c5060

2 files changed

Lines changed: 85 additions & 2 deletions

File tree

.ado/jobs/e2e-test.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,82 @@ jobs:
139139
condition: and(failed(), eq(variables.StartedFabricTests, 'true'))
140140
continueOnError: true
141141
142+
# Diagnostic: figure out where WER actually put the dumps. On packaged
143+
# apps WER sometimes ignores the per-exe LocalDumps key and cabs to
144+
# the system report queue, or silently drops if it can't write to our
145+
# folder. We dump the WER config + ACLs and copy any dumps we find
146+
# from common fallback locations into $(CrashDumpRootPath) so they
147+
# ride the existing artifact publish.
148+
- pwsh: |
149+
Write-Host "=== CrashDumpRootPath: $(CrashDumpRootPath) ==="
150+
if (Test-Path "$(CrashDumpRootPath)") {
151+
Write-Host "--- ACLs ---"
152+
Get-Acl "$(CrashDumpRootPath)" | Format-List | Out-String | Write-Host
153+
Write-Host "--- Contents ---"
154+
Get-ChildItem -Path "$(CrashDumpRootPath)" -Recurse -Force | Select-Object FullName, Length | Format-Table -AutoSize | Out-String | Write-Host
155+
} else {
156+
Write-Host "(folder does not exist)"
157+
}
158+
159+
Write-Host ""
160+
Write-Host "=== WER LocalDumps registry ==="
161+
$localDumpsRoot = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps'
162+
if (Test-Path $localDumpsRoot) {
163+
Get-ChildItem $localDumpsRoot | ForEach-Object {
164+
Write-Host "--- $($_.Name) ---"
165+
Get-ItemProperty $_.PSPath | Format-List | Out-String | Write-Host
166+
}
167+
Write-Host "--- (global defaults) ---"
168+
Get-ItemProperty $localDumpsRoot -ErrorAction SilentlyContinue | Format-List | Out-String | Write-Host
169+
} else {
170+
Write-Host "(no LocalDumps key)"
171+
}
172+
173+
Write-Host ""
174+
Write-Host "=== AeDebug AutoExclusionList ==="
175+
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList' -ErrorAction SilentlyContinue | Format-List | Out-String | Write-Host
176+
177+
Write-Host ""
178+
Write-Host "=== Searching for dumps in common WER locations ==="
179+
$searchRoots = @(
180+
"$env:LOCALAPPDATA\CrashDumps",
181+
"$env:ProgramData\Microsoft\Windows\WER\ReportQueue",
182+
"$env:ProgramData\Microsoft\Windows\WER\ReportArchive",
183+
"$env:ProgramData\Microsoft\Windows\WER\Temp",
184+
"C:\Users",
185+
"$env:TEMP",
186+
"$env:windir\Temp"
187+
)
188+
$found = @()
189+
foreach ($root in $searchRoots) {
190+
if (-not (Test-Path $root)) { continue }
191+
Write-Host "--- $root ---"
192+
$hits = Get-ChildItem -Path $root -Recurse -Include *.dmp,*.mdmp,*RNTesterApp*.* -ErrorAction SilentlyContinue -Force |
193+
Where-Object { -not $_.PSIsContainer -and $_.LastWriteTime -gt (Get-Date).AddHours(-2) }
194+
foreach ($h in $hits) {
195+
Write-Host (" {0,-10} {1}" -f $h.Length, $h.FullName)
196+
$found += $h
197+
}
198+
}
199+
200+
Write-Host ""
201+
Write-Host "=== Copying any matching dumps into $(CrashDumpRootPath)\recovered ==="
202+
if ($found.Count -gt 0) {
203+
$dest = Join-Path "$(CrashDumpRootPath)" 'recovered'
204+
New-Item -ItemType Directory -Path $dest -Force | Out-Null
205+
foreach ($h in $found) {
206+
$tag = ($h.FullName -replace '[:\\/]', '_')
207+
$target = Join-Path $dest $tag
208+
Copy-Item -LiteralPath $h.FullName -Destination $target -Force -ErrorAction SilentlyContinue
209+
Write-Host "Copied $($h.FullName) -> $target"
210+
}
211+
} else {
212+
Write-Host "(no matching dumps found anywhere)"
213+
}
214+
displayName: Search for crash dumps in WER fallback locations
215+
condition: and(failed(), eq(variables.StartedFabricTests, 'true'))
216+
continueOnError: true
217+
142218
- script: npx jest --clearCache
143219
displayName: clear jest cache
144220
workingDirectory: packages/e2e-test-app-fabric

.ado/templates/prepare-build-env.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ steps:
5151
displayName: Check and enable Windows Error Reporting
5252
5353
- pwsh: |
54-
Write-Host "##vso[task.setvariable variable=CrashDumpRootPath]$(Build.StagingDirectory)\CrashDumps"
55-
New-Item -Path '$(Build.StagingDirectory)\CrashDumps' -ItemType Directory
54+
$path = '$(Build.StagingDirectory)\CrashDumps'
55+
Write-Host "##vso[task.setvariable variable=CrashDumpRootPath]$path"
56+
New-Item -Path $path -ItemType Directory -Force | Out-Null
57+
# Grant full control to NT AUTHORITY\SYSTEM and Users so the WER service
58+
# (running as LocalSystem) and any child process — including packaged
59+
# apps — can write dumps here. Without this, per-exe LocalDumps can
60+
# silently fail on agents that lock down the work directory.
61+
& icacls $path /grant 'SYSTEM:(OI)(CI)F' 'Users:(OI)(CI)F' /T /C | Out-Null
62+
& icacls $path
5663
displayName: Set CrashDumpRootPath
5764
5865
- pwsh: |

0 commit comments

Comments
 (0)