Skip to content

Debug Windows access violation #1029

Debug Windows access violation

Debug Windows access violation #1029

Workflow file for this run

name: CI
permissions:
contents: read
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# Daily build at 1:00 AM UTC
- cron: "0 1 * * *"
# Cancel in-progress workflows when pushing
# a new commit on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
testing:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
# Reproduce the intermittent Windows OpenBLAS access violation.
- name: pylatest_conda_forge_openblas
os: windows-latest
PYTHON_VERSION: "*"
PACKAGER: "conda-forge"
BLAS: "openblas"
INSTALL_OPENCV: "true"
env: ${{ matrix }}
runs-on: ${{ matrix.os }}
defaults:
run:
# Need to use this shell to get conda working properly.
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: 'bash -el {0}'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
auto-update-conda: true
miniforge-version: latest
- name: Install dependencies
run: |
./continuous_integration/install.sh
- name: Record Windows CPU information
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force crash_diagnostics | Out-Null
Get-CimInstance Win32_Processor |
Select-Object Name, Manufacturer, NumberOfCores,
NumberOfLogicalProcessors, ProcessorId |
ConvertTo-Json -Depth 3 |
Tee-Object -FilePath crash_diagnostics/cpu.json
Get-CimInstance Win32_ComputerSystem |
Select-Object Manufacturer, Model, TotalPhysicalMemory,
NumberOfLogicalProcessors |
ConvertTo-Json -Depth 3 |
Tee-Object -FilePath crash_diagnostics/system.json
- name: Install ProcDump for Windows OpenBLAS diagnostic
if: matrix.os == 'windows-latest' && matrix.name == 'pylatest_conda_forge_openblas'
shell: pwsh
run: |
$toolDir = Join-Path $env:RUNNER_TEMP 'procdump'
$archive = Join-Path $env:RUNNER_TEMP 'procdump.zip'
Invoke-WebRequest https://download.sysinternals.com/files/Procdump.zip -OutFile $archive
Expand-Archive -LiteralPath $archive -DestinationPath $toolDir
"PROCDUMP_PATH=$(Join-Path $toolDir 'procdump64.exe')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Run Windows OpenBLAS diagnostic without ProcDump
id: direct
continue-on-error: true
env:
OPENBLAS_VERBOSE: "2"
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate testenv
PYTHONPATH=. python -u -X faulthandler tests/empirical_scope_observation.py blas
- name: Capture Windows OpenBLAS diagnostic crashes
id: procdump
if: ${{ !cancelled() && (steps.direct.outcome == 'success' || steps.direct.outcome == 'failure') }}
continue-on-error: true
env:
OPENBLAS_VERBOSE: "2"
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate testenv
PYTHONPATH=. python -X faulthandler continuous_integration/capture_windows_blas_crash.py
- name: Check for crash dumps
id: dumps
if: always()
shell: pwsh
run: |
$found = Test-Path -Path 'crash_diagnostics/*.dmp'
"found=$($found.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
- name: Upload Windows OpenBLAS crash diagnostics
if: always() && steps.dumps.outputs.found == 'true'
uses: actions/upload-artifact@v4
with:
name: windows-openblas-crash-${{ github.run_id }}-${{ github.run_attempt }}
path: crash_diagnostics/
if-no-files-found: ignore
retention-days: 14
- name: Fail if either diagnostic failed or a dump was captured
if: always() && (steps.direct.outcome == 'failure' || steps.procdump.outcome == 'failure' || steps.dumps.outputs.found == 'true')
shell: pwsh
run: |
Write-Output '::error::OpenBLAS diagnostic failed. Check both diagnostic logs and any uploaded crash dump.'
exit 1