Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
34cd372
gh-112536: Setting up TSAN test at Github Action
corona10 Mar 15, 2024
8f789df
Apply TSAN to the default build too
corona10 Mar 15, 2024
432c3a2
Update
corona10 Mar 15, 2024
7c04959
Use gcc 11 to resolve compiler issue
corona10 Mar 15, 2024
4d271cb
Remove test_logging from the TSAN test for the temporary
corona10 Mar 15, 2024
853ea8c
Test --with-pydebug
corona10 Mar 15, 2024
43135d4
Use Ubuntu 22.04
corona10 Mar 15, 2024
7304fca
Use --disable-ipv6 sigh..
corona10 Mar 15, 2024
37d048d
revert --with-pydebug
corona10 Mar 15, 2024
b05c9f7
Use clang
corona10 Mar 15, 2024
7e373ee
Reduce ASLR to avoid TSAN crashing
corona10 Mar 15, 2024
920d8b4
Rebirth test_logging
corona10 Mar 15, 2024
73cbf74
Add --with-pydebug
corona10 Mar 15, 2024
0ff8212
Update Tools/tsan/supressions.txt
corona10 Mar 15, 2024
c6dfb25
Add ccache
corona10 Mar 15, 2024
e2e90ee
Address code review
corona10 Mar 16, 2024
2d29262
Don't use sem_clockwait with TSAN
corona10 Mar 16, 2024
e2265a5
Skip tests from test_threading and test_concurrent_futures
corona10 Mar 16, 2024
414c0e9
Revert Tools/tsan/supressions.txt changes
corona10 Mar 16, 2024
71dc4aa
Add skip_if_tsan
corona10 Mar 16, 2024
f399bd2
nit
corona10 Mar 16, 2024
ec743ff
Use reusable workflow
corona10 Mar 16, 2024
e99087f
nit
corona10 Mar 16, 2024
8bfee01
Rename to .github/workflows/reusable-tsan.yml
corona10 Mar 16, 2024
8577792
fix
corona10 Mar 16, 2024
f9c6e56
fix
corona10 Mar 16, 2024
d9afff0
Fix
corona10 Mar 16, 2024
e88086f
nit
corona10 Mar 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use reusable workflow
  • Loading branch information
corona10 committed Mar 16, 2024
commit ec743ff46008c974bb634c0dccf36908fd6e7699
89 changes: 17 additions & 72 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -490,85 +490,30 @@ jobs:
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
- name: Restore config.cache
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
- name: Install Dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
sudo apt install -y clang
# Reduce ASLR to avoid TSAN crashing
sudo sysctl -w vm.mmap_rnd_bits=28
- name: TSAN Option Setup
run: |
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
save: ${{ github.event_name == 'push' }}
max-size: "200M"
- name: Configure CPython
run: ./configure --config-cache --with-thread-sanitizer --with-pydebug
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: ./python -m test --tsan -j4
uses: ./.github/workflows/reusable-tsan.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
../cpython-ro-srcdir/configure \
--config-cache \
--with-thread-sanitizer \
--with-pydebug

build_tsan_free_threading:
name: 'Thread sanitizer (free-threading)'
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
- name: Restore config.cache
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
- name: Install Dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
sudo apt install -y clang
# Reduce ASLR to avoid TSAN crashing
sudo sysctl -w vm.mmap_rnd_bits=28
- name: TSAN Option Setup
run: |
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
save: ${{ github.event_name == 'push' }}
max-size: "200M"
- name: Configure CPython
run: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: ./python -m test --tsan -j4
uses: ./.github/workflows/reusable-tsan.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
../cpython-ro-srcdir/configure \
--config-cache \
--disable-gil \
--with-thread-sanitizer \
--with-pydebug4

# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
cifuzz:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/reusable-tsan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
workflow_call:
inputs:
config_hash:
required: true
type: string
options:
required: true
type: string

jobs:
build_tsan_reusable:
name: 'Thread sanitizer'
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v4
- name: Runner image version
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
- name: Restore config.cache
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Install Dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
sudo apt install -y clang
# Reduce ASLR to avoid TSAN crashing
sudo sysctl -w vm.mmap_rnd_bits=28
- name: TSAN Option Setup
run: |
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1.2
with:
save: ${{ github.event_name == 'push' }}
max-size: "200M"
- name: Configure CPython
run: ${{ inputs.options }}
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: Tests
run: ./python -m test --tsan -j4