-
-
Notifications
You must be signed in to change notification settings - Fork 711
Add CI TSan workflow #4624
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
dloebl
wants to merge
2
commits into
libvips:master
Choose a base branch
from
dloebl:add-ci-tsan-workflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add CI TSan workflow #4624
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 |
---|---|---|
|
@@ -18,7 +18,11 @@ jobs: | |
|
||
- name: "Linux x64 (Ubuntu 24.04) - Clang 19 with ASan and UBSan" | ||
os: ubuntu-24.04 | ||
build: { cc: clang-19, cxx: clang++-19, linker: ld.lld-19, sanitize: true } | ||
build: { cc: clang-19, cxx: clang++-19, linker: ld.lld-19, sanitize: 'asan' } | ||
|
||
- name: "Linux x64 (Ubuntu 24.04) - Clang 19 with TSan" | ||
os: ubuntu-24.04 | ||
build: { cc: clang-19, cxx: clang++-19, linker: ld.lld-19, sanitize: 'tsan' } | ||
|
||
- name: "macOS arm64 (14) - Xcode 15" | ||
os: macos-14 | ||
|
@@ -69,15 +73,15 @@ jobs: | |
|
||
- name: Install Clang 19 | ||
if: runner.os == 'Linux' && matrix.build.cc == 'clang-19' | ||
run: sudo apt-get install clang-19 libomp-19-dev lld-19 llvm-19 | ||
run: sudo apt-get install clang-19 libomp-19-dev lld-19 llvm-19 libclang-rt-19-dev | ||
|
||
- name: Prepare macOS environment | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "PKG_CONFIG_PATH=$(brew --prefix mozjpeg)/lib/pkgconfig:$(brew --prefix libarchive)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV | ||
|
||
- name: Prepare sanitizers | ||
if: matrix.build.sanitize | ||
- name: Prepare ASan and UBSan | ||
if: matrix.build.sanitize == 'asan' | ||
env: | ||
LLVM_PREFIX: /usr/lib/llvm-19 | ||
run: | | ||
|
@@ -90,12 +94,29 @@ jobs: | |
# to disable the fast unwinder to get full stacktraces. | ||
echo "ASAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/asan.supp:fast_unwind_on_malloc=0:allocator_may_return_null=1" >> $GITHUB_ENV | ||
echo "LSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/lsan.supp:fast_unwind_on_malloc=0" >> $GITHUB_ENV | ||
echo "TSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/tsan.supp" >> $GITHUB_ENV | ||
# Ensure UBSan issues causes the program to abort. | ||
echo "UBSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/ubsan.supp:halt_on_error=1:abort_on_error=1:print_stacktrace=1" >> $GITHUB_ENV | ||
echo "LD_LIBRARY_PATH=$LLVM_PREFIX/lib:`dirname $ASAN_DSO`" >> $GITHUB_ENV | ||
echo "$LLVM_PREFIX/bin" >> $GITHUB_PATH | ||
|
||
- name: Prepare TSan | ||
if: matrix.build.sanitize == 'tsan' | ||
env: | ||
LLVM_PREFIX: /usr/lib/llvm-19 | ||
run: | | ||
TSAN_DSO=`$CC -print-file-name=libclang_rt.tsan-x86_64.so` | ||
echo "LDSHARED=$CC -shared" >> $GITHUB_ENV | ||
echo "CPPFLAGS=-g -fsanitize=thread -fno-sanitize=function -fno-omit-frame-pointer -fopenmp -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" >> $GITHUB_ENV | ||
echo "LDFLAGS=-g -fsanitize=thread -shared-libasan -fopenmp=libomp" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Linking fails without |
||
echo "TSAN_DSO=$TSAN_DSO" >> $GITHUB_ENV | ||
echo "ASAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/asan.supp:fast_unwind_on_malloc=0:allocator_may_return_null=1" >> $GITHUB_ENV | ||
echo "LSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/lsan.supp:fast_unwind_on_malloc=0" >> $GITHUB_ENV | ||
echo "TSAN_OPTIONS=ignore_noninstrumented_modules=1:suppressions=${{ github.workspace }}/suppressions/tsan.supp" >> $GITHUB_ENV | ||
# Ensure UBSan issues causes the program to abort. | ||
echo "UBSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/ubsan.supp:halt_on_error=1:abort_on_error=1:print_stacktrace=1" >> $GITHUB_ENV | ||
echo "LD_LIBRARY_PATH=$LLVM_PREFIX/lib:`dirname $TSAN_DSO`" >> $GITHUB_ENV | ||
echo "$LLVM_PREFIX/bin" >> $GITHUB_PATH | ||
|
||
- name: Configure libvips | ||
run: | ||
meson setup build | ||
|
@@ -126,5 +147,5 @@ jobs: | |
- name: Run test suite | ||
env: | ||
VIPS_LEAK: 1 | ||
LD_PRELOAD: ${{ env.ASAN_DSO }} | ||
LD_PRELOAD: ${{ env.ASAN_DSO }}${{ env.TSAN_DSO }} | ||
run: python3 -m pytest -sv --log-cli-level=WARNING test/test-suite |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASan
andTSan
aren't compatible - so I had to add a new workflow