mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
fix: Switch GCC ASAN to -mcmodel=medium and reduce TSAN build parallelism
- Change -mcmodel=large to -mcmodel=medium for GCC ASAN builds. The large model inflates code size with 64-bit absolute addresses, pushing the binary past the 2GB limit where GCC's pre-compiled CRT startup code (crtstuff.c) can't reach data sections with 32-bit relocations. Medium model keeps code compact (CRT-compatible) while allowing data beyond 2GB. - Add nproc_subtract=20 for TSAN builds to reduce build parallelism. TSAN instrumentation significantly increases per-compilation-unit memory usage, causing OOM on CI runners with high parallelism. - Plumb nproc_subtract from the CI matrix through to the build workflow so individual configurations can control their parallelism. - Temporarily restrict CI matrix to only the two previously-failing configs (gcc-13 asan-ubsan, clang-20 tsan-ubsan) to validate fixes without burning CI resources on passing configs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
17
.github/scripts/strategy-matrix/generate.py
vendored
17
.github/scripts/strategy-matrix/generate.py
vendored
@@ -256,6 +256,8 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
||||
}
|
||||
)
|
||||
# Add TSAN + UBSAN configuration.
|
||||
# TSAN instrumentation significantly increases memory usage during
|
||||
# compilation, so reduce build parallelism to avoid OOM on CI runners.
|
||||
configurations.append(
|
||||
{
|
||||
"config_name": config_name + "-tsan-ubsan",
|
||||
@@ -266,6 +268,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
||||
"os": os,
|
||||
"architecture": architecture,
|
||||
"sanitizers": "thread,undefinedbehavior",
|
||||
"nproc_subtract": 20,
|
||||
}
|
||||
)
|
||||
else:
|
||||
@@ -282,6 +285,20 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
||||
}
|
||||
)
|
||||
|
||||
# TEMPORARY: Only build previously-failing sanitizer variants to save CI.
|
||||
# Remove this filter once these configs pass.
|
||||
sanitizer_only = [
|
||||
c
|
||||
for c in configurations
|
||||
if c["sanitizers"]
|
||||
and (
|
||||
("gcc-13" in c["config_name"] and "asan" in c["config_name"])
|
||||
or ("clang-20" in c["config_name"] and "tsan" in c["config_name"])
|
||||
)
|
||||
]
|
||||
if sanitizer_only:
|
||||
return sanitizer_only
|
||||
|
||||
return configurations
|
||||
|
||||
|
||||
|
||||
1
.github/workflows/reusable-build-test.yml
vendored
1
.github/workflows/reusable-build-test.yml
vendored
@@ -58,5 +58,6 @@ jobs:
|
||||
image: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || '' }}
|
||||
config_name: ${{ matrix.config_name }}
|
||||
sanitizers: ${{ matrix.sanitizers }}
|
||||
nproc_subtract: ${{ matrix.nproc_subtract && matrix.nproc_subtract || 2 }}
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -13,7 +13,7 @@ include(default)
|
||||
|
||||
{% if "address" in sanitizers %}
|
||||
{% set _ = sanitizer_list.append("address") %}
|
||||
{% set model_code = "-mcmodel=large" %}
|
||||
{% set model_code = "-mcmodel=medium" %}
|
||||
{% set _ = defines.append("BOOST_USE_ASAN")%}
|
||||
{% set _ = defines.append("BOOST_USE_UCONTEXT")%}
|
||||
{% elif "thread" in sanitizers %}
|
||||
|
||||
Reference in New Issue
Block a user