Skip to content

Commit 9aa22de

Browse files
authored
Merge pull request libgit2#5597 from lhchavez/ci-thread-sanitizer
Add a ThreadSanitizer build
2 parents d9d86e4 + 896b1db commit 9aa22de

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ jobs:
109109
SKIP_NEGOTIATE_TESTS: true
110110
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
111111
os: ubuntu-latest
112+
- # Focal, Clang 10, OpenSSL, ThreadSanitizer
113+
image: focal
114+
env:
115+
CC: clang-10
116+
CFLAGS: -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer
117+
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
118+
CMAKE_GENERATOR: Ninja
119+
SKIP_SSH_TESTS: true
120+
SKIP_NEGOTIATE_TESTS: true
121+
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
122+
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
123+
os: ubuntu-latest
112124
- # macOS
113125
os: macos-10.15
114126
env:
@@ -197,6 +209,7 @@ jobs:
197209
-e PKG_CONFIG_PATH \
198210
-e SKIP_NEGOTIATE_TESTS \
199211
-e SKIP_SSH_TESTS \
212+
-e TSAN_OPTIONS \
200213
${{ env.docker-registry-container-sha }} \
201214
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
202215
else

script/thread-sanitizer.supp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# In attr_file_free, the locks are acquired in the opposite order in which they
2+
# are normally acquired. This is probably something worth fixing to have a
3+
# consistent lock hierarchy that is easy to understand.
4+
deadlock:attr_cache_lock
5+
6+
# When invoking the time/timezone functions from git_signature_now(), they
7+
# access libc methods that need to be instrumented to correctly analyze the
8+
# data races.
9+
called_from_lib:libc.so.6
10+
11+
# TODO(#5595): Remove these once the fixes land.
12+
race:src/odb.c
13+
race:git_repository_odb__weakptr
14+
race:cache_store
15+
16+
# TODO(#5595): Investigate and fix this. It can be triggered by the `thread`
17+
# test suite.
18+
race:git_filter_list__load_ext

0 commit comments

Comments
 (0)