- 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 change moves the sanitizer runtime options out to dedicated files, such that they can be used in multiple places (CI, local runs) without any need to rewrite them.
ASAN wasn't able to keep track of `boost::coroutine` context switches, and would lead to many false positives being detected. By switching to `boost::coroutine2` and `ucontext`, ASAN is able to know about the context switches advertised by the `boost::fiber` class, which in turn leads to more cleaner ASAN analysis.
Subscribe tests have a problem that there is no way to synchronize application running in background threads and test threads. Threads are communicating via websocket messages. When the code is compiled in debug mode with code coverage enabled it executes quite slow, so receiving websocket messages by the client in subscribe tests may time out.
This change does 2 things to fix the problem:
* Increases timeout for receiving a websocket message.
* Decreases the number of tests running in parallel.
While testing the fix for subscribe test another flaky test in ledger replay was found, which has also been addressed.
The refs as previously used pointed to the source branch, not the target branch. However, determining the target branch is different depending on the GitHub event. The pull request logic was incorrect and needed to be fixed, and the logic inside the workflow could be simplified. Both modifications have been made in this commit.
The existing code added the git commit info (`GIT_COMMIT_HASH` and `GIT_BRANCH`) to every file, which was a problem for leveraging `ccache` to cache build objects. This change adds a separate C++ file from where these compile-time variables are propagated to wherever they are needed. A new CMake file is added to set the commit info if the `git` binary is available.