Skip to content

Commit fa47439

Browse files
author
MarcoFalke
committed
ci: Add missing linux-headers package to ASan task
Otherwise the task will throw in skip_if_no_python_bcc. Also, adjust CI_CONTAINER_CAP for all needed permissions.
1 parent fabaa85 commit fa47439

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.cirrus.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ task:
273273

274274
task:
275275
name: '[ASan + LSan + UBSan + integer, no depends, USDT] [lunar]'
276+
enable_bpfcc_script:
277+
# In the image build step, no external environment variables are available,
278+
# so any settings will need to be written to the settings env file:
279+
- sed -i "s|\${CIRRUS_CI}|true|g" ./ci/test/00_setup_env_native_asan.sh
276280
<< : *GLOBAL_TASK_TEMPLATE
277281
persistent_worker:
278282
labels:

ci/test/00_setup_env_native_asan.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ export LC_ALL=C.UTF-8
88

99
# Only install BCC tracing packages in Cirrus CI.
1010
if [[ "${CIRRUS_CI}" == "true" ]]; then
11-
export BPFCC_PACKAGE="bpfcc-tools"
11+
BPFCC_PACKAGE="bpfcc-tools linux-headers-$(uname --kernel-release)"
12+
export CI_CONTAINER_CAP="--privileged -v /sys/kernel:/sys/kernel:rw"
1213
else
13-
export BPFCC_PACKAGE=""
14+
BPFCC_PACKAGE=""
15+
export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the container needs access to ptrace (https://github.com/google/sanitizers/issues/764)
1416
fi
1517

1618
export CONTAINER_NAME=ci_native_asan

ci/test/00_setup_env_native_fuzz.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export RUN_UNIT_TESTS=false
1414
export RUN_FUNCTIONAL_TESTS=false
1515
export RUN_FUZZ_TESTS=true
1616
export GOAL="install"
17+
export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the container needs access to ptrace (https://github.com/google/sanitizers/issues/764)
1718
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address,undefined,float-divide-by-zero,integer \
1819
CC='clang-16 -ftrivial-auto-var-init=pattern' CXX='clang++-16 -ftrivial-auto-var-init=pattern'"
1920
export CCACHE_MAXSIZE=200M

ci/test/04_install.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=
1818
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
1919
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan"
2020
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
21-
if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
22-
CI_CONTAINER_CAP="--cap-add SYS_PTRACE"
23-
fi
2421

2522
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
2623
# Export all env vars to avoid missing some.

0 commit comments

Comments
 (0)