@@ -183,6 +183,13 @@ jobs:
183183 $cfg = "${{env.WOLFSSH_BUILD_CONFIGURATION}}\${{env.BUILD_PLATFORM}}"
184184 $dll = Join-Path $env:ASAN_BIN_DIR "clang_rt.asan_dynamic-x86_64.dll"
185185 if (-not (Test-Path $dll)) { throw "ASAN runtime DLL not found: $dll" }
186+ # Fetch procdump so a hard crash (__fastfail / 0xC0000409 from /GS or a
187+ # CRT invalid-parameter abort) can be captured as a full dump. Such a
188+ # crash bypasses the ASan exit path and leaves no report of its own.
189+ Invoke-WebRequest -Uri "https://download.sysinternals.com/files/Procdump.zip" -OutFile procdump.zip
190+ Expand-Archive -Force procdump.zip -DestinationPath procdump
191+ $procdump = "procdump\procdump64.exe"
192+ New-Item -ItemType Directory -Force -Path dumps | Out-Null
186193 foreach ($t in @("api-test", "unit-test")) {
187194 $dir = "ide\winvs\$t\$cfg"
188195 # Static signal: confirm the binary really imports the ASan runtime, so
@@ -193,6 +200,41 @@ jobs:
193200 ($deps -split "`n" | Select-String "asan").Line.Trim() | ForEach-Object { Write-Host " $_" }
194201 Copy-Item $dll $dir
195202 & "$dir\$t.exe"
196- if ($LASTEXITCODE -ne 0) { throw "$t failed under ASAN (exit $LASTEXITCODE)" }
203+ $code = $LASTEXITCODE
204+ if ($code -ne 0) {
205+ # Re-run under procdump (attaches as a debugger, so it sees the
206+ # __fastfail) to capture a full dump next to the .pdb for offline
207+ # analysis. The diagnostic markers printed above already identify the
208+ # last test reached.
209+ Write-Host "$t exited $code; re-running under procdump to capture a crash dump"
210+ & $procdump -accepteula -ma -e -x dumps "$dir\$t.exe"
211+ Copy-Item "$dir\$t.pdb" dumps -ErrorAction SilentlyContinue
212+ Copy-Item "$dir\$t.exe" dumps -ErrorAction SilentlyContinue
213+ # Symbolicate the faulting stack here on the runner, where every PDB
214+ # (api-test, wolfssh, wolfssl) and the MS symbol server are reachable,
215+ # so the crash location lands directly in this log.
216+ $cdb = Get-ChildItem `
217+ "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe", `
218+ "C:\Program Files\Windows Kits\10\Debuggers\x64\cdb.exe" `
219+ -ErrorAction SilentlyContinue | Select-Object -First 1
220+ $dmp = Get-ChildItem dumps\*.dmp -ErrorAction SilentlyContinue | Select-Object -First 1
221+ if ($cdb -and $dmp) {
222+ $sym = "srv*https://msdl.microsoft.com/download/symbols;$PWD\$dir;$PWD\ide\winvs\wolfssh\$cfg;$PWD\..\wolfssl\$cfg"
223+ Write-Host "==== cdb !analyze of $($dmp.Name) ===="
224+ & $cdb.FullName -z $dmp.FullName -y $sym -c ".ecxr; !analyze -v; kb; q"
225+ }
226+ else {
227+ Write-Host "cdb or dump not found; skipping on-runner analysis (cdb='$cdb' dmp='$dmp')"
228+ }
229+ throw "$t failed under ASAN (exit $code)"
230+ }
197231 }
198232
233+ - name : Upload crash dumps
234+ if : always()
235+ uses : actions/upload-artifact@v4
236+ with :
237+ name : windows-asan-crash-dumps
238+ path : wolfssh/dumps
239+ if-no-files-found : ignore
240+
0 commit comments