Skip to content

Commit 2cb8ef0

Browse files
committed
ARROW-11377: [C++][CI] Add Thread Sanitizer nightly build
Closes apache#9317 from pitrou/ARROW-11377-tsan-nightly Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
1 parent 9199801 commit 2cb8ef0

5 files changed

Lines changed: 55 additions & 6 deletions

File tree

ci/docker/ubuntu-18.04-cpp.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ ENV ARROW_BUILD_TESTS=ON \
112112
ARROW_PLASMA=ON \
113113
ARROW_USE_ASAN=OFF \
114114
ARROW_USE_CCACHE=ON \
115+
ARROW_USE_TSAN=OFF \
115116
ARROW_USE_UBSAN=OFF \
116117
ARROW_WITH_BROTLI=ON \
117118
ARROW_WITH_BZ2=ON \

ci/scripts/cpp_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
9292
-DARROW_USE_LD_GOLD=${ARROW_USE_LD_GOLD:-OFF} \
9393
-DARROW_USE_PRECOMPILED_HEADERS=${ARROW_USE_PRECOMPILED_HEADERS:-OFF} \
9494
-DARROW_USE_STATIC_CRT=${ARROW_USE_STATIC_CRT:-OFF} \
95+
-DARROW_USE_TSAN=${ARROW_USE_TSAN:-OFF} \
9596
-DARROW_USE_UBSAN=${ARROW_USE_UBSAN:-OFF} \
9697
-DARROW_VERBOSE_THIRDPARTY_BUILD=${ARROW_VERBOSE_THIRDPARTY_BUILD:-OFF} \
9798
-DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI:-OFF} \

cpp/build-support/run-test.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,10 @@ function setup_sanitizers() {
6565

6666
# Configure TSAN (ignored if this isn't a TSAN build).
6767
#
68-
# Deadlock detection (new in clang 3.5) is disabled because:
69-
# 1. The clang 3.5 deadlock detector crashes in some unit tests. It
70-
# needs compiler-rt commits c4c3dfd, 9a8efe3, and possibly others.
71-
# 2. Many unit tests report lock-order-inversion warnings; they should be
72-
# fixed before reenabling the detector.
73-
TSAN_OPTIONS="$TSAN_OPTIONS detect_deadlocks=0"
7468
TSAN_OPTIONS="$TSAN_OPTIONS suppressions=$ROOT/build-support/tsan-suppressions.txt"
7569
TSAN_OPTIONS="$TSAN_OPTIONS history_size=7"
70+
# Some tests deliberately fail allocating memory
71+
TSAN_OPTIONS="$TSAN_OPTIONS allocator_may_return_null=1"
7672
export TSAN_OPTIONS
7773

7874
UBSAN_OPTIONS="$UBSAN_OPTIONS print_stacktrace=1"

dev/tasks/tasks.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,32 +1580,51 @@ tasks:
15801580
ci: circle
15811581
template: docker-tests/circle.linux.yml
15821582
params:
1583+
env:
1584+
UBUNTU: 18.04
15831585
run: "-e ARROW_BUILD_TYPE=release ubuntu-cpp"
15841586

15851587
test-ubuntu-18.04-cpp-static:
15861588
ci: circle
15871589
template: docker-tests/circle.linux.yml
15881590
params:
1591+
env:
1592+
UBUNTU: 18.04
15891593
run: "-e ARROW_BUILD_SHARED=OFF -e ARROW_BUILD_STATIC=ON -e ARROW_TEST_LINKAGE=static ubuntu-cpp"
15901594

15911595
test-ubuntu-20.04-cpp:
15921596
ci: github
15931597
template: docker-tests/github.linux.yml
15941598
params:
1599+
env:
1600+
UBUNTU: 20.04
15951601
run: ubuntu-cpp
15961602

15971603
test-ubuntu-20.04-cpp-14:
15981604
ci: github
15991605
template: docker-tests/github.linux.yml
16001606
params:
1607+
env:
1608+
UBUNTU: 20.04
16011609
run: "-e CMAKE_ARGS=-DCMAKE_CXX_STANDARD=14 ubuntu-cpp"
16021610

16031611
test-ubuntu-20.04-cpp-17:
16041612
ci: github
16051613
template: docker-tests/github.linux.yml
16061614
params:
1615+
env:
1616+
UBUNTU: 20.04
16071617
run: "-e CMAKE_ARGS=-DCMAKE_CXX_STANDARD=17 ubuntu-cpp"
16081618

1619+
test-ubuntu-20.04-cpp-thread-sanitizer:
1620+
ci: github
1621+
template: docker-tests/github.linux.yml
1622+
params:
1623+
env:
1624+
CLANG_TOOLS: 11
1625+
UBUNTU: 20.04
1626+
run: ubuntu-cpp-thread-sanitizer
1627+
16091628
test-debian-c-glib:
16101629
ci: circle
16111630
template: docker-tests/circle.linux.yml

docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ x-hierarchy:
113113
- ubuntu-cuda-python
114114
- ubuntu-csharp
115115
- ubuntu-cpp-sanitizer
116+
- ubuntu-cpp-thread-sanitizer
116117
- ubuntu-r-sanitizer
117118
- python-sdist
118119
- r
@@ -350,6 +351,37 @@ services:
350351
utf8proc_SOURCE: "BUNDLED"
351352
command: *cpp-command
352353

354+
ubuntu-cpp-thread-sanitizer:
355+
# Usage:
356+
# docker-compose build ubuntu-cpp-thread-sanitizer
357+
# docker-compose run --rm ubuntu-cpp-thread-sanitizer
358+
# Parameters:
359+
# ARCH: amd64, arm64v8, ...
360+
# UBUNTU: 16.04, 18.04, 20.04
361+
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
362+
build:
363+
context: .
364+
dockerfile: ci/docker/ubuntu-${UBUNTU}-cpp.dockerfile
365+
cache_from:
366+
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
367+
args:
368+
arch: ${ARCH}
369+
clang_tools: ${CLANG_TOOLS}
370+
llvm: ${LLVM}
371+
shm_size: *shm-size
372+
volumes: *ubuntu-volumes
373+
environment:
374+
<<: *ccache
375+
CC: clang-${CLANG_TOOLS}
376+
CXX: clang++-${CLANG_TOOLS}
377+
ARROW_ENABLE_TIMING_TESTS: # inherit
378+
ARROW_DATASET: "ON"
379+
ARROW_JEMALLOC: "OFF"
380+
ARROW_ORC: "OFF"
381+
ARROW_S3: "OFF"
382+
ARROW_USE_TSAN: "ON"
383+
command: *cpp-command
384+
353385
fedora-cpp:
354386
# Usage:
355387
# docker-compose build fedora-cpp

0 commit comments

Comments
 (0)