Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-112536: Add TSAN builds on Github Actions#116872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
28 commits Select commitHold shift + click to select a range
34cd372 gh-112536: Setting up TSAN test at Github Action
corona108f789df Apply TSAN to the default build too
corona10432c3a2 Update
corona107c04959 Use gcc 11 to resolve compiler issue
corona104d271cb Remove test_logging from the TSAN test for the temporary
corona10853ea8c Test --with-pydebug
corona1043135d4 Use Ubuntu 22.04
corona107304fca Use --disable-ipv6 sigh..
corona1037d048d revert --with-pydebug
corona10b05c9f7 Use clang
corona107e373ee Reduce ASLR to avoid TSAN crashing
corona10920d8b4 Rebirth test_logging
corona1073cbf74 Add --with-pydebug
corona100ff8212 Update Tools/tsan/supressions.txt
corona10c6dfb25 Add ccache
corona10e2e90ee Address code review
corona102d29262 Don't use sem_clockwait with TSAN
corona10e2265a5 Skip tests from test_threading and test_concurrent_futures
corona10414c0e9 Revert Tools/tsan/supressions.txt changes
corona1071dc4aa Add skip_if_tsan
corona10f399bd2 nit
corona10ec743ff Use reusable workflow
corona10e99087f nit
corona108bfee01 Rename to .github/workflows/reusable-tsan.yml
corona108577792 fix
corona10f9c6e56 fix
corona10d9afff0 Fix
corona10e88086f nit
corona10File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -484,6 +484,24 @@ jobs: | ||
| - name: Tests | ||
| run: xvfb-run make test | ||
| build_tsan: | ||
| name: 'Thread sanitizer' | ||
| needs: check_source | ||
| if: needs.check_source.outputs.run_tests == 'true' | ||
| uses: ./.github/workflows/reusable-tsan.yml | ||
| with: | ||
| config_hash: ${{ needs.check_source.outputs.config_hash }} | ||
| options: ./configure --config-cache --with-thread-sanitizer --with-pydebug | ||
| build_tsan_free_threading: | ||
| name: 'Thread sanitizer (free-threading)' | ||
corona10 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| needs: check_source | ||
| if: needs.check_source.outputs.run_tests == 'true' | ||
| uses: ./.github/workflows/reusable-tsan.yml | ||
| with: | ||
| config_hash: ${{ needs.check_source.outputs.config_hash }} | ||
| options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug | ||
| # CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/ | ||
| cifuzz: | ||
| name: CIFuzz | ||
| @@ -542,6 +560,8 @@ jobs: | ||
| - build_windows_free_threading | ||
| - test_hypothesis | ||
| - build_asan | ||
| - build_tsan | ||
| - build_tsan_free_threading | ||
| - cifuzz | ||
| runs-on: ubuntu-latest | ||
| @@ -575,6 +595,8 @@ jobs: | ||
| build_windows, | ||
| build_windows_free_threading, | ||
| build_asan, | ||
| build_tsan, | ||
| build_tsan_free_threading, | ||
| ' | ||
| || '' | ||
| }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| 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 | ||
| 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 |
4 changes: 4 additions & 0 deletionsLib/test/test_concurrent_futures/util.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletionsLib/test/test_threading.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletionsPython/thread_pthread.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.