Skip to content

Commit d72a727

Browse files
committed
github/gen-matrix.py: add sanitize mode, exclude g++ debug+sanitize
Add 'sanitize' as a third value in MODES so all-pairs covers it across the compiler/standard/arch axes instead of pinning it to two explicit one-offs. The regular grid grows from 8 to 10 items; specials drop by two for a net +2 rows. Exclude (g++-{15,16}, debug) and (g++-{15,16}, sanitize) from the regular matrix via allpairspy's filter_func. gcc 15+ miscompiles structured bindings inside loops in coroutines: the hidden tuple's lifetime tracking is broken, so the destructor runs on uninitialized (ASan-poisoned, 0xBE) stack memory. In debug mode this surfaces as a pollable_fd_state LSan leak via reactor::do_accept's cross-shard forwarding path; in sanitize mode UBSan aborts the rpc client/server loops at startup. Drop EXCLUDED_PAIRS once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124584 is fixed (tracked in scylladb#3431) so g++ debug + sanitize come back into coverage.
1 parent 3e61e79 commit d72a727

2 files changed

Lines changed: 37 additions & 13 deletions

File tree

.github/workflows/gen-matrix.py

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"""
99
Generate the regular_test include: matrix for tests.yaml.
1010
11-
Uses all-pairs (pairwise) coverage over compiler x standard x mode for
12-
the regular builds, plus an explicit list of special-purpose jobs
13-
(dpdk, cxx-modules, fuzz). All-pairs guarantees that every pair of
14-
parameter values is exercised by at least one job, with far fewer
15-
combinations than the full cartesian product (12 vs 24 for our 4x2x3
16-
matrix). Everything outside the marked region of tests.yaml is left
17-
untouched.
11+
Uses all-pairs (pairwise) coverage over compiler x standard x mode x
12+
arch for the regular builds, plus an explicit list of special-purpose
13+
jobs (dpdk, cxx-modules, fuzz). All-pairs guarantees that every pair
14+
of parameter values is exercised by at least one job, with far fewer
15+
combinations than the full cartesian product. Excluded pairs (see
16+
EXCLUDED_PAIRS) drop out of regular coverage. Everything outside the
17+
marked region of tests.yaml is left untouched.
1818
1919
Usage:
2020
.github/workflows/gen-matrix.py
@@ -42,9 +42,29 @@
4242
+ [f"g++-{v}" for v in GCC_VERSIONS]
4343
)
4444
STANDARDS: list[int] = [20, 23]
45-
MODES: list[str] = ["debug", "release"]
45+
MODES: list[str] = ["debug", "release", "sanitize"]
4646
ARCHS: list[str] = ["x86", "arm"]
4747

48+
# Compiler+mode combinations to skip in the regular all-pairs matrix.
49+
# gcc 15+ miscompiles structured bindings inside loops in coroutines
50+
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124584), breaking g++
51+
# debug (LSan: pollable_fd_state leak via cross-shard accept) and g++
52+
# sanitize (UBSan abort on poisoned rcv_buf in rpc loops). Tracked in
53+
# scylladb/seastar#3431.
54+
EXCLUDED_PAIRS: list[tuple[str, str]] = [
55+
(f"g++-{v}", m) for v in GCC_VERSIONS for m in ("debug", "sanitize")
56+
]
57+
58+
59+
def _keep_row(row: list[Any]) -> bool:
60+
"""allpairspy filter_func: drop rows hitting an EXCLUDED_PAIRS entry.
61+
62+
Called with progressively longer prefixes during pair generation, so
63+
the check only fires once both compiler (row[0]) and mode (row[2])
64+
are present in the partial row.
65+
"""
66+
return not (len(row) >= 3 and (row[0], row[2]) in EXCLUDED_PAIRS)
67+
4868
# Markers that bracket the managed region inside tests.yaml.
4969
BEGIN_TAG = "# This include block is AUTOGENERATED"
5070
END_TAG = "# end of AUTOGENERATED part"
@@ -109,7 +129,10 @@ def _format_item(item: dict[str, Any], indent: str) -> str:
109129
def generate() -> list[dict[str, Any]]:
110130
regular: list[dict[str, Any]] = [
111131
{"compiler": c, "standard": s, "mode": m, "arch": a}
112-
for c, s, m, a in AllPairs([COMPILERS, STANDARDS, MODES, ARCHS])
132+
for c, s, m, a in AllPairs(
133+
[COMPILERS, STANDARDS, MODES, ARCHS],
134+
filter_func=_keep_row,
135+
)
113136
]
114137
return regular + SPECIAL_ITEMS
115138

.github/workflows/tests.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ jobs:
2424
include:
2525
- {compiler: clang++-21, standard: 20, mode: debug, arch: x86}
2626
- {compiler: clang++-22, standard: 23, mode: release, arch: x86}
27-
- {compiler: g++-15, standard: 23, mode: debug, arch: arm}
27+
- {compiler: g++-15, standard: 23, mode: release, arch: arm}
2828
- {compiler: g++-16, standard: 20, mode: release, arch: arm}
29-
- {compiler: g++-16, standard: 23, mode: debug, arch: x86}
29+
- {compiler: g++-16, standard: 23, mode: release, arch: x86}
3030
- {compiler: g++-15, standard: 20, mode: release, arch: x86}
31-
- {compiler: clang++-22, standard: 20, mode: debug, arch: arm}
32-
- {compiler: clang++-21, standard: 23, mode: release, arch: arm}
31+
- {compiler: clang++-22, standard: 20, mode: sanitize, arch: arm}
32+
- {compiler: clang++-21, standard: 23, mode: sanitize, arch: x86}
33+
- {compiler: clang++-21, standard: 23, mode: debug, arch: arm}
3334
- {compiler: clang++-22, standard: 23, arch: x86, mode: dev}
3435
- {compiler: clang++-22, standard: 23, arch: x86, mode: release, enables: --enable-dpdk, options: "--cook dpdk --dpdk-machine corei7-avx", info: "dpdk, "}
3536
- {compiler: clang++-22, standard: 23, arch: x86, mode: debug, enables: --enable-cxx-modules, enable-ccache: false, info: "modules, "}

0 commit comments

Comments
 (0)