Skip to content

Commit 783b724

Browse files
committed
GitHub CI pipeline: In clang-17 x TSAN config symbolize reports with a sibling llvm-symbolizer version (17's crashes on our binaries, stalling tests); accordingly re-enable transport_test SHM-jemalloc sub-mode in that config. Also: temporary test-subset input, letting 2 parallel runs split one cell's test load.
1 parent a5ca26b commit 783b724

1 file changed

Lines changed: 42 additions & 37 deletions

File tree

.github/workflows/main.yml

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ on:
107107
required: false
108108
default: ''
109109
type: string
110+
# XXX Temporary validation aid; remove (with its 3 consumers below) when the sanitizer-validation
111+
# campaign concludes. Lets 2 parallel runs split the test load of one cell.
112+
test-subset:
113+
description: >-
114+
If 'u-t-only': the transport_test runs no-op. If 't-t-only': the unit-tests run no-ops.
115+
Blank: everything runs.
116+
required: false
117+
default: ''
118+
type: string
110119

111120
jobs:
112121
# Impetus behind this is to set up at least one magic string used in 2+ places.
@@ -606,6 +615,19 @@ jobs:
606615
# detector CHECK-fails -- and its failure path hangs the process (observed: a 3-hour unit_test wedge).
607616
# Data-race detection (TSAN's main job) is unaffected; lock-inversion detection is the sacrifice.
608617
export TSAN_OPTIONS="disable_coredump=0 detect_deadlocks=0 suppressions=$SAN_SUPP_CFG"
618+
if [ '${{ matrix.compiler.id }}' = 'clang-17' ]; then
619+
# clang-17's llvm-symbolizer-17 crashes ("LLVM ERROR: Sections with relocations should have an
620+
# address of 0") when symbolizing our binaries' TSAN reports, stalling the reporting thread 10+
621+
# seconds each time (leading to, e.g., test-internal timeouts). A sibling version's symbolizer
622+
# handles the same binaries fine -- and nothing requires it to version-match the compiler.
623+
for SYMB_VER in 16 18 15; do
624+
if command -v llvm-symbolizer-$SYMB_VER > /dev/null; then
625+
export TSAN_OPTIONS="$TSAN_OPTIONS external_symbolizer_path=$(command -v llvm-symbolizer-$SYMB_VER)"
626+
echo "To avoid clang-17 symbolizer bugginess overrode symbolizer to [llvm-symbolizer-$SYMB_VER]."
627+
break
628+
fi
629+
done
630+
fi
609631
echo "TSAN_OPTIONS = [$TSAN_OPTIONS]."
610632
fi
611633
if [ "$SAN_SUPP" != '' ]; then
@@ -799,6 +821,10 @@ jobs:
799821
# key template groups (<=> ipc::session::Session compile-time config, possibly others) in separate
800822
# `.cpp`s, would benefit other environments, including user environments, and be less reliant on fairly
801823
# dynamic hardware conditions from GitHub/whomever. Revisit that; ideally get rid of this as a result.
824+
# Update: The below trick is likely insufficient (from numbers we've seen), so we split the handful of
825+
# heaviest unit_test `.cpp`s per this to-do. Combined with the below trick (but not without it, notably),
826+
# 8/2026 GitHub build was OK. The to-do remains: Ideally split more stuff, so that this can be removed
827+
# (among other benefits). transport_test is likely the guy to attack.
802828
# XXXrevisit soon, if there's time; or delete this line and leave TODO; whatever seems best at the end.
803829
if [ '${{ matrix.compiler.high-mem-build }}' != '' ] \
804830
&& [ '${{ matrix.compiler.high-mem-build }}' != 'false' ] \
@@ -946,18 +972,8 @@ jobs:
946972
run: |
947973
# Build libraries and demos/tests with Conan.
948974
${{ env.setup-run-env }}
949-
#XXXtemp-debug!
950-
# Sample RAM use in the background, so its output interleaves with the log as we go: post-mortem evidence
951-
# regarding sporadic whole-VM kills (runner-shutdown message from GitHub) observed when several jumbo test
952-
# TUs compile simultaneously in `-g` configs -- apparent OOM of the 16 GiB runner.
953-
( while true; do echo "[mem-sample] $(free -m | grep Mem:)"; sleep 15; done ) &
954-
MEM_SAMPLER_PID=$!
955-
#XXXtemp-debug-end
956975
# At least capnp compiler binary is built with our build-settings, so $BUILT_CMD_PREFIX is required.
957976
$BUILT_CMD_PREFIX conan build .
958-
#XXXtemp-debug!
959-
kill $MEM_SAMPLER_PID
960-
#XXXtemp-debug-end
961977
962978
- name: Install built targets with Makefile
963979
if: env.cell-selected == 'true'
@@ -1121,6 +1137,8 @@ jobs:
11211137
&& (!cancelled())
11221138
run: |
11231139
# Run unit tests.
1140+
# XXX Temporary; see test-subset input.
1141+
if [ '${{ github.event.inputs.test-subset }}' = 't-t-only' ]; then echo 'Skipped per test-subset.'; exit 0; fi
11241142
cd ${{ env.install-dir }}/bin
11251143
# Some newline issues with the possible additional args; so need to make a wrapper script
11261144
# and then redirect, as desired, its output.
@@ -1252,6 +1270,8 @@ jobs:
12521270
run: |
12531271
# Prepare run script for [transport_test - Scripted mode] variations below.
12541272
cat <<'EOF' > ${{ env.install-dir }}/bin/run_transport_test_sc.sh
1273+
# XXX Temporary; see test-subset input.
1274+
if [ '${{ github.event.inputs.test-subset }}' = 'u-t-only' ]; then echo 'Skipped per test-subset.'; exit 0; fi
12551275
echo "Log level: [$1]."
12561276
cd ${{ env.install-dir }}/bin/transport_test
12571277
OUT_DIR_NAME=log_level_$1
@@ -1317,6 +1337,8 @@ jobs:
13171337
# Prepare run script for [transport_test - Exercise mode] variations below.
13181338
cat <<'EOF' > ${{ env.install-dir }}/bin/run_transport_test_ex.sh
13191339
# Script created by pipeline during job.
1340+
# XXX Temporary; see test-subset input.
1341+
if [ '${{ github.event.inputs.test-subset }}' = 'u-t-only' ]; then echo 'Skipped per test-subset.'; exit 0; fi
13201342
echo "Log level: [$1]."
13211343
echo "Exercise sub-mode: [$2]."
13221344
echo "Sub-mode snippet (none or '-shm-?'): [$3]."
@@ -1381,37 +1403,20 @@ jobs:
13811403
&& (!cancelled()) && (steps.transport_test_ex_shm_c.outcome == 'failure')
13821404
run: /usr/bin/bash -e ${{ env.install-dir }}/bin/run_transport_test_ex.sh data shm_classic_log_level_data -shm-c
13831405

1384-
# Disabling this particular test run for the specific case of clang-17 in TSAN (thread sanitizer) config
1385-
# (in particular at least 2 other clangs+TSAN are exercised, so the TSAN coverage is still good).
1386-
# First the reason in detail: This run semi-reliably (50%+) fails at this point in the server binary:
1387-
# 2023-12-20 11:36:11.322479842 +0000 [info]: Tguy: ex_srv.hpp:send_req_b(1428): App_session [0x7b3800008180]:
1388-
# Chan B[0]: Filling/send()ing payload (description = [reuse out-message + SHM-handle to modified (unless
1389-
# SHM-jemalloc) existing STL data]; alt-payload? = [0]; reusing msg? = [1]; reusing SHM payload? = [1]).
1390-
# LLVM ERROR: Sections with relocations should have an address of 0
1391-
# PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
1392-
# Stack dump:
1393-
# 0. Program arguments: /usr/bin/llvm-symbolizer-17 --demangle --inlines --default-arch=x86_64
1394-
# Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
1395-
# ...
1396-
# ==77990==WARNING: Can't read from symbolizer at fd 599
1397-
# 2023-12-20 11:36:31.592293322 +0000 [info]: Tguy: ex_srv.hpp:send_req_b(1547): App_session [0x7b3800008180]: Chan B[0]: Filling done. Now to send.
1398-
# Sometimes the exact point is different, depending on timing; but in any case it is always the above
1399-
# TSAN/LLVM error, at which point the thread gets stuck for a long time (10+ seconds); but eventually gets
1400-
# unstuck; however transport_test happens to be testing a feature in a certain way so that a giant blocking
1401-
# operation in this thread delays certain processing, causes an internal timeout, and the test exits/fails.
1402-
# Sure, we could make some changes to the test for that to not happen, but that's beside the point: TSAN
1403-
# at run-time is trying to do something and fails terribly; I have no wish to try to work around that situation;
1404-
# literally it says "PLEASE submit a bug report [to clang devs]."
1405-
#
1406-
# TODO: Revisit; figure out how to not trigger this; re-enable. For the record, I (ygoldfel) cannot reproduce
1407-
# in a local clang-17, albeit with libc++ (LLVM STL) instead of libstdc++ (GNU STL). I've also tried to
1408-
# reduce optimization to -O1, as well as with and without LTO, and with and without -fno-omit-frame-pointer;
1409-
# same result.
1406+
# clang-17 + TSAN only:
1407+
# In this config this run would semi-reliably (50%+) fail: TSAN reports during the run
1408+
# invoke llvm-symbolizer-17 which crashes on our binaries ("LLVM ERROR: Sections with relocations should
1409+
# have an address of 0" -- an LLVM bug; ticket filed), stalling the reporting thread 10+ seconds each
1410+
# time; and a certain giant blocking operation in a particular thread then delays certain processing,
1411+
# causing an internal timeout, and the test exits/fails. Worked around by symbolizing with a sibling
1412+
# llvm-symbolizer version in that config; see `setup-tests-env`. If this becomes insufficient, or some other
1413+
# such problem arises, it is defensible to disable this for the offending compiler, as there are as of this
1414+
# writing a few TSAN configs that would remain (different compiler version(s)).
14101415
- name: Run integration test [transport_test - Exercise mode - SHM-jemalloc sub-mode]
14111416
id: transport_test_ex_shm_j
14121417
if: |
14131418
(env.cell-selected == 'true')
1414-
&& (!cancelled()) && ((matrix.compiler.id != 'clang-17') || (matrix.build-test-cfg.sanitizer-name != 'tsan'))
1419+
&& (!cancelled())
14151420
run: /usr/bin/bash -e ${{ env.install-dir }}/bin/run_transport_test_ex.sh info shm_jemalloc -shm-j
14161421

14171422
- name: Re-run with increased logging, on failure only

0 commit comments

Comments
 (0)