Skip to content

diag: shrink the cancel sweep so the debugger run fits the timeout #2

diag: shrink the cancel sweep so the debugger run fits the timeout

diag: shrink the cancel sweep so the debugger run fits the timeout #2

Workflow file for this run

name: diag-cancel
# One-off diagnostic (workflow_dispatch only). Reproduces the x86-only integer
# divide-by-zero in whisper's long-form abort path under a debugger and prints
# the faulting backtrace WITH source lines, so the exact file:line can be
# fixed. Builds the C++ whisper e2e test with RelWithDebInfo (full symbols) and
# runs it with TRANSCRIBE_DIAG_CANCEL=1 (the opt-in threaded-cancel sweep in
# tests/whisper_e2e_smoke.cpp) under gdb (Linux) / cdb (Windows). The debugger
# slowdown also widens the abort timing window, making the flaky fault reliable.
#
# DELETE this workflow (and the TRANSCRIBE_DIAG_CANCEL block) once the bug is
# fixed.
on:
workflow_dispatch:
# workflow_dispatch only fires for workflows on the default branch, and this
# diagnostic lives only on rust-bindings — so also run on push to the branch
# when the diag files change (this workflow is deleted after the fix).
push:
branches: [rust-bindings]
paths:
- ".github/workflows/diag-cancel.yml"
- "tests/whisper_e2e_smoke.cpp"
jobs:
diag:
name: diag-cancel (${{ matrix.label }})
strategy:
fail-fast: false
matrix:
include:
- label: linux
runner: blacksmith-2vcpu-ubuntu-2404
- label: windows
runner: blacksmith-2vcpu-windows-2025
runs-on: ${{ matrix.runner }}
timeout-minutes: 40
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v8.2.0
- name: Install build deps (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build zlib1g-dev gdb
- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install build deps (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install ninja --no-progress -y
vcpkg install zlib:x64-windows-static-md
$zlibPrefix = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows-static-md" -replace '\\','/'
Add-Content $env:GITHUB_ENV "CMAKE_PREFIX_PATH=$zlibPrefix"
- uses: ./.github/actions/fetch-canary
with:
hf-token: ${{ secrets.HF_TOKEN }}
- name: Configure + build the e2e test (RelWithDebInfo, symbols)
shell: bash
run: |
extra=""
# advapi32 for ggml-cpu's registry CPU probe (the cmake test link,
# like the Rust manifest, doesn't pull it implicitly on MSVC).
[ "$RUNNER_OS" = "Windows" ] && extra="-DCMAKE_EXE_LINKER_FLAGS=advapi32.lib"
cmake -B build-diag -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DTRANSCRIBE_BUILD_REAL_MODEL_TESTS=ON \
-DTRANSCRIBE_USE_OPENMP=OFF $extra
cmake --build build-diag --target transcribe_whisper_e2e_smoke -j
- name: Reproduce under gdb (Linux)
if: runner.os == 'Linux'
run: |
export TRANSCRIBE_WHISPER_MODEL="$TRANSCRIBE_SMOKE_MODEL"
export TRANSCRIBE_DIAG_CANCEL=1
exe="$(find build-diag -name transcribe_whisper_e2e_smoke -type f | head -1)"
echo "running $exe under gdb"
gdb -batch -nx \
-ex 'set pagination off' \
-ex 'run' \
-ex 'printf "\n===== FAULTING BACKTRACE =====\n"' \
-ex 'bt' \
-ex 'printf "\n===== FRAME 0 LOCALS =====\n"' \
-ex 'info locals' \
--args "$exe"
- name: Reproduce under cdb (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$env:TRANSCRIBE_WHISPER_MODEL = $env:TRANSCRIBE_SMOKE_MODEL
$env:TRANSCRIBE_DIAG_CANCEL = "1"
$exe = (Get-ChildItem -Recurse -Filter transcribe_whisper_e2e_smoke.exe build-diag | Select-Object -First 1).FullName
$cdb = "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe"
if (!(Test-Path $cdb)) {
$cdb = (Get-ChildItem -Recurse -Filter cdb.exe "C:\Program Files (x86)\Windows Kits" -ErrorAction SilentlyContinue | Select-Object -First 1).FullName
}
Write-Host "cdb: $cdb"
Write-Host "exe: $exe"
if (-not $cdb) { Write-Host "::warning::cdb not found; running without a debugger (exit code only)"; & $exe; exit 0 }
# On the integer-divide exception (0xC0000094), print a numbered stack
# with source lines, then quit.
& $cdb -g -G -c ".lines -e; sxe -c `"kn 40; q`" 0xc0000094; g; q" $exe