Skip to content

Commit bf78991

Browse files
committed
Fix sanitizer CI for the C++ KMIP client
The backend failed to load pg_tde.so under sanitizers with "undefined symbol: __ubsan_vptr_type_cache", so every test that starts a server errored. That symbol is provided only by the C++-only UBSan runtime (ubsan_standalone_cxx), which is not linked into the C postgres backend that dlopens the module. Disable the vptr check for the C++ objects and build the C++ sources/links with the sanitizer flags (CXX=clang++) so a single clang ASan/UBSan runtime is used throughout. Also drop the non-existent llvm-symbolizer-14 path so ASan locates a working symbolizer, and ignore geninfo version mismatches in coverage.
1 parent 34534c9 commit bf78991

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050

5151
- name: Process coverage
5252
run: |
53-
geninfo -o coverage.info --rc lcov_branch_coverage=1 -i .
54-
geninfo -o coverage.info --rc lcov_branch_coverage=1 .
53+
geninfo -o coverage.info --rc lcov_branch_coverage=1 --ignore-errors mismatch -i .
54+
geninfo -o coverage.info --rc lcov_branch_coverage=1 --ignore-errors mismatch .
5555
working-directory: build
5656

5757
- name: Upload coverage data to codecov.io

.github/workflows/sanitizers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ on:
1212
env:
1313
pg_version: 18
1414
CC: clang
15+
CXX: clang++
1516
LD: clang
1617
UBSAN_OPTIONS: log_path=${{ github.workspace }}/sanitize.log print_suppressions=0 print_stacktrace=1 print_summary=1 halt_on_error=1
1718
ASAN_OPTIONS: log_path=${{ github.workspace }}/sanitize.log print_suppressions=0 abort_on_error=1
1819
LSAN_OPTIONS: log_path=${{ github.workspace }}/sanitize.log print_suppressions=0 suppressions=${{ github.workspace }}/src/ci_scripts/suppressions/lsan.supp
19-
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-14
2020
# Avoid failures on slow recovery
2121
PGCTLTIMEOUT: 120
2222
PG_TEST_TIMEOUT_DEFAULT: 300

ci_scripts/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ case "$1" in
2929
BUILD_TYPE=debug
3030
ARGS+=" -Dc_args=['-fsanitize=address','-fsanitize=undefined','-fno-omit-frame-pointer','-fno-inline-functions']"
3131
ARGS+=" -Dc_link_args=['-fsanitize=address','-fsanitize=undefined']"
32-
ARGS+=" -Dcpp_args=['-fsanitize=address','-fsanitize=undefined','-fno-omit-frame-pointer','-fno-inline-functions']"
32+
# vptr's UBSan runtime lives in the C++-only ubsan_standalone_cxx library,
33+
# which the C postgres backend that dlopens pg_tde.so does not link, so it
34+
# is disabled here to avoid an undefined __ubsan_vptr_type_cache at load.
35+
ARGS+=" -Dcpp_args=['-fsanitize=address','-fsanitize=undefined','-fno-sanitize=vptr','-fno-omit-frame-pointer','-fno-inline-functions']"
3336
ARGS+=" -Dcpp_link_args=['-fsanitize=address','-fsanitize=undefined']"
3437
;;
3538

0 commit comments

Comments
 (0)