diff --git a/.github/workflows/tests-with-pydebug.yml b/.github/workflows/tests-with-pydebug.yml index ca3c989b..8adbdc69 100644 --- a/.github/workflows/tests-with-pydebug.yml +++ b/.github/workflows/tests-with-pydebug.yml @@ -271,19 +271,12 @@ jobs: $DebuggersDir = "$WindowsKitsDir\Debuggers\x64" Get-ChildItem -Path $DebuggersDir $Env:PATH = "$DebuggersDir;$Env:PATH" - $PYTEST = 'cdb -hd -gG -o -c ".sympath" -c ".srcpath" ${{ env.PYTHON }} -X dev -m pytest' + $PYTEST = 'cdb -gG -o -c ".dump /ma /u core.dmp; !py; g; q" ${{ env.PYTHON }} -X dev -m pytest' Write-Output "_NT_SOURCE_PATH=$Env:_NT_SOURCE_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "_NT_SYMBOL_PATH=$Env:_NT_SYMBOL_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "PYTEST=$PYTEST" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - $regKey="HKLM:\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps" - New-Item -Path $regKey -Force | Out-Null - Set-ItemProperty -Path $regKey -Name 'DumpFolder' -Value $pwd - Set-ItemProperty -Path $regKey -Name 'DumpCount' -Value 10 - Set-ItemProperty -Path $regKey -Name 'DumpType' -Value 2 - Get-ItemProperty -Path $regKey - cdb -version - name: Install OpTree @@ -317,9 +310,9 @@ jobs: if: ${{ !cancelled() }} shell: bash run: | - if [[ -n "$(find . -iname "core.*.[1-9]*")" ]]; then + if [[ -n "$(find . -iname "core.*.[1-9]*" -o -iname "core_*.dmp")" ]]; then echo "Found core dumps:" - ls -alh $(find . -iname "core.*.[1-9]*") + ls -alh $(find . -iname "core.*.[1-9]*" -o -iname "core_*.dmp") BACKTRACE_COMMAND="" if [[ "${{ runner.os }}" == 'Linux' ]]; then echo "::group::Install GDB" @@ -334,6 +327,8 @@ jobs: brew install llvm --quiet echo "::endgroup::" BACKTRACE_COMMAND="lldb --file ${{ env.PYTHON }} --core '{}' -o 'bt' -o 'q'" + elif [[ "${{ runner.os }}" == 'Windows' ]]; then + BACKTRACE_COMMAND="cdb -z '{}' -c \"!py; !analyze -v; .ecxr; k; q\"" fi if [[ -n "${BACKTRACE_COMMAND}" ]]; then echo "Collecting backtraces:" @@ -342,6 +337,11 @@ jobs: ${BACKTRACE_COMMAND}; echo '::endgroup::'; " ';' + find . -iname "core_*.dmp" -exec bash -xc " + echo '::group::backtrace from: {}'; + ${BACKTRACE_COMMAND}; + echo '::endgroup::'; + " ';' fi fi @@ -361,5 +361,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: coredump-${{ env.PYTHON_TAG }}-${{ runner.os }} - path: tests/core.* + path: | + tests/core.* + tests/core_*.dmp if-no-files-found: ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5d6d22b1..26d4ca65 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -124,19 +124,12 @@ jobs: $DebuggersDir = "$WindowsKitsDir\Debuggers\x64" Get-ChildItem -Path $DebuggersDir $Env:PATH = "$DebuggersDir;$Env:PATH" - $PYTEST = 'cdb -hd -gG -o -c ".sympath" -c ".srcpath" ${{ env.PYTHON }} -X dev -m pytest' + $PYTEST = 'cdb -gG -o -c ".dump /ma /u core.dmp; !py; g; q" ${{ env.PYTHON }} -X dev -m pytest' Write-Output "_NT_SOURCE_PATH=$Env:_NT_SOURCE_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "_NT_SYMBOL_PATH=$Env:_NT_SYMBOL_PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "PATH=$Env:PATH" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append Write-Output "PYTEST=$PYTEST" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - $regKey="HKLM:\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps" - New-Item -Path $regKey -Force | Out-Null - Set-ItemProperty -Path $regKey -Name 'DumpFolder' -Value $pwd - Set-ItemProperty -Path $regKey -Name 'DumpCount' -Value 10 - Set-ItemProperty -Path $regKey -Name 'DumpType' -Value 2 - Get-ItemProperty -Path $regKey - cdb -version - name: Install test dependencies @@ -184,9 +177,9 @@ jobs: if: ${{ !cancelled() }} shell: bash run: | - if [[ -n "$(find . -iname "core.*.[1-9]*")" ]]; then + if [[ -n "$(find . -iname "core.*.[1-9]*" -o -iname "core_*.dmp")" ]]; then echo "Found core dumps:" - ls -alh $(find . -iname "core.*.[1-9]*") + ls -alh $(find . -iname "core.*.[1-9]*" -o -iname "core_*.dmp") BACKTRACE_COMMAND="" if [[ "${{ runner.os }}" == 'Linux' ]]; then echo "::group::Install GDB" @@ -201,6 +194,8 @@ jobs: brew install llvm --quiet echo "::endgroup::" BACKTRACE_COMMAND="lldb --file ${{ env.PYTHON }} --core '{}' -o 'bt' -o 'q'" + elif [[ "${{ runner.os }}" == 'Windows' ]]; then + BACKTRACE_COMMAND="cdb -z '{}' -c \"!py; !analyze -v; .ecxr; k; q\"" fi if [[ -n "${BACKTRACE_COMMAND}" ]]; then echo "Collecting backtraces:" @@ -209,6 +204,11 @@ jobs: ${BACKTRACE_COMMAND}; echo '::endgroup::'; " ';' + find . -iname "core_*.dmp" -exec bash -xc " + echo '::group::backtrace from: {}'; + ${BACKTRACE_COMMAND}; + echo '::endgroup::'; + " ';' fi fi @@ -231,7 +231,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: coredump-${{ env.PYTHON_TAG }}-${{ runner.os }} - path: tests/core.* + path: | + tests/core.* + tests/core_*.dmp if-no-files-found: ignore upload-coverage: diff --git a/.gitignore b/.gitignore index 814d1327..9f4457ba 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ __pycache__/ # Core dump files core.[1-9]* core.*.[1-9]* +core.dmp +core_*.dmp # Distribution / packaging .Python