diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-11 00:27:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 22:27:17 +0000 |
commit | 7dc9e923d1a33f40b94f535f9ccfdb9894a4ceb0 (patch) | |
tree | 79a6fcd31a6df3baaef5fde5dafd37bc63d8fdf1 /.github | |
parent | [3.13] gh-118846: Fix free-threading test failures when run sequentially (GH-... (diff) | |
download | cpython-7dc9e923d1a33f40b94f535f9ccfdb9894a4ceb0.tar.gz cpython-7dc9e923d1a33f40b94f535f9ccfdb9894a4ceb0.tar.bz2 cpython-7dc9e923d1a33f40b94f535f9ccfdb9894a4ceb0.zip |
[3.13] gh-117657: Log TSAN warnings to separate files and archive them (GH-118747) (#118931)
This ensures we don't lose races that occur in subprocesses or
interleave races from workers running in parallel.
Log files are collected and packaged into a zipfile that can be
downloaded from the "Artifacts" section of the workflow run.
(cherry picked from commit b88889e9ffd7b2d2bdac75aecbf14e37fd68e337)
Co-authored-by: mpage <mpage@meta.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 2 | ||||
-rw-r--r-- | .github/workflows/reusable-tsan.yml | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a53f1ae1a46..d14d17a5e08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -486,6 +486,7 @@ jobs: config_hash: ${{ needs.check_source.outputs.config_hash }} options: ./configure --config-cache --with-thread-sanitizer --with-pydebug suppressions_path: Tools/tsan/supressions.txt + tsan_logs_artifact_name: tsan-logs-default build_tsan_free_threading: name: 'Thread sanitizer (free-threading)' @@ -496,6 +497,7 @@ jobs: config_hash: ${{ needs.check_source.outputs.config_hash }} options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug suppressions_path: Tools/tsan/suppressions_free_threading.txt + tsan_logs_artifact_name: tsan-logs-free-threading # CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/ cifuzz: diff --git a/.github/workflows/reusable-tsan.yml b/.github/workflows/reusable-tsan.yml index 48bd5b547e8..b6d5d8fa1c7 100644 --- a/.github/workflows/reusable-tsan.yml +++ b/.github/workflows/reusable-tsan.yml @@ -11,6 +11,10 @@ on: description: 'A repo relative path to the suppressions file' required: true type: string + tsan_logs_artifact_name: + description: 'Name of the TSAN logs artifact. Must be unique for each job.' + required: true + type: string jobs: build_tsan_reusable: @@ -41,7 +45,7 @@ jobs: sudo sysctl -w vm.mmap_rnd_bits=28 - name: TSAN Option Setup run: | - echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }}" >> $GITHUB_ENV + echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> $GITHUB_ENV echo "CC=clang" >> $GITHUB_ENV echo "CXX=clang++" >> $GITHUB_ENV - name: Add ccache to PATH @@ -60,3 +64,13 @@ jobs: run: make pythoninfo - name: Tests run: ./python -m test --tsan -j4 + - name: Display TSAN logs + if: always() + run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000 + - name: Archive TSAN logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.tsan_logs_artifact_name }} + path: tsan_log.* + if-no-files-found: ignore |