Skip to content

Commit 600625c

Browse files
committed
debug
1 parent 4916e0b commit 600625c

1 file changed

Lines changed: 64 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,67 @@ jobs:
2626
curl.exe --location --create-dirs -oC:\TEMP\DXSDK_Aug08.exe https://archive.org/download/dxsdk_aug08/DXSDK_Aug08.exe
2727
7z.exe x C:\TEMP\DXSDK_Aug08.exe -aoa -oC:\Tools\DXSDK_Aug08 DXSDK/Include DXSDK/Lib
2828
29-
- name: Build
30-
shell: cmd
31-
run: |
32-
for /f "delims=" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath') do set VS_PATH=%%i
33-
call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
34-
cmake -B build -GNinja -DLLVM_WIDBERG="C:\Tools\llvm-widberg" -DDXSDK_DIR=C:\Tools\DXSDK_Aug08\DXSDK
35-
cmake --build build
29+
- name: Start minilua crash capture
30+
shell: powershell
31+
run: |
32+
New-Item -ItemType Directory -Force "$env:GITHUB_WORKSPACE\dumps" | Out-Null
33+
Invoke-WebRequest https://download.sysinternals.com/files/Procdump.zip -OutFile "$env:RUNNER_TEMP\Procdump.zip"
34+
Expand-Archive "$env:RUNNER_TEMP\Procdump.zip" -DestinationPath "$env:RUNNER_TEMP\procdump" -Force
35+
$procdump = Start-Process `
36+
-FilePath "$env:RUNNER_TEMP\procdump\procdump64.exe" `
37+
-ArgumentList "-accepteula -e -ma -x `"$env:GITHUB_WORKSPACE\dumps`" -w minilua.exe" `
38+
-PassThru
39+
"PROCDUMP_PID=$($procdump.Id)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
40+
41+
- name: Build
42+
id: build
43+
continue-on-error: true
44+
shell: cmd
45+
run: |
46+
for /f "delims=" %%i in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath') do set VS_PATH=%%i
47+
call "%VS_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
48+
cmake -B build -GNinja -DLLVM_WIDBERG="C:\Tools\llvm-widberg" -DDXSDK_DIR=C:\Tools\DXSDK_Aug08\DXSDK
49+
cmake --build build -v
50+
51+
- name: Stop minilua crash capture
52+
if: always()
53+
shell: powershell
54+
run: |
55+
if ($env:PROCDUMP_PID) {
56+
Stop-Process -Id $env:PROCDUMP_PID -Force -ErrorAction SilentlyContinue
57+
}
58+
59+
- name: Print stack trace from dump
60+
if: steps.build.outcome == 'failure'
61+
shell: powershell
62+
run: |
63+
$dmp = Get-ChildItem "$env:GITHUB_WORKSPACE\dumps" -Filter *.dmp -ErrorAction SilentlyContinue |
64+
Sort-Object LastWriteTime -Descending |
65+
Select-Object -First 1
66+
if (-not $dmp) {
67+
throw "No dump captured from minilua.exe"
68+
}
69+
70+
$cdb = "C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe"
71+
if (-not (Test-Path $cdb)) {
72+
$cdb = "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe"
73+
}
74+
if (-not (Test-Path $cdb)) {
75+
throw "cdb.exe not found in Windows Kits debugger paths."
76+
}
77+
78+
$env:_NT_SYMBOL_PATH = "srv*C:\symbols*https://msdl.microsoft.com/download/symbols;$env:GITHUB_WORKSPACE\build\dependencies\LuaJIT\src\host\cmake\minilua"
79+
& $cdb -z $dmp.FullName -c ".symfix; .reload; !analyze -v; .ecxr; kb; kv; q"
80+
81+
- name: Upload minilua dumps
82+
if: always()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: minilua-dumps
86+
path: ${{ github.workspace }}\dumps\*.dmp
87+
if-no-files-found: ignore
88+
89+
- name: Fail job if build failed
90+
if: steps.build.outcome == 'failure'
91+
shell: powershell
92+
run: exit 1

0 commit comments

Comments
 (0)