Commit b9777c8
committed
CI: build full RetroArch with ASan + UBSan and run headless smoke
Stands up a complementary CI job to the per-sample regression-test
workflows shipped in v3-v6 (Linux-samples-gfx.yml). Builds full
RetroArch with -fsanitize=address,undefined via the existing top-
level Makefile SANITIZER= plumbing, then runs `./retroarch --help`
and `./retroarch --features` under AddressSanitizer's abort-on-error
mode and UBSan in soft-fail mode.
The per-sample harnesses regression-test specific predicates that
had bugs and by design only cover code that can be exercised by a
small standalone test program with mocked dependencies. This job
is complementary -- it sanitizer-instruments the entire RetroArch
binary as it actually links and runs, so any future heap-corruption
/ use-after-free / signed-overflow / null-deref bug in code
reachable from main() is caught for free as a side effect of any
change. Same template as c82db9f's libretro-db samples build under
sanitizer in CI, scaled up to the full retroarch binary.
* .github/workflows/Linux-asan-ubsan.yml
- Build matches Linux-Headless.yml's apt set and --disable-menu
choice. Adds --disable-discord --disable-cheevos
--disable-networking on the first iteration to shrink the
third-party surface so that any sanitizer hit is a RetroArch-
internal bug rather than noise from a vendored subsystem.
Each can be re-enabled in follow-ups as the baseline stays
green.
- Build with `make SANITIZER=address,undefined`, which the top-
level Makefile (line 153) propagates into CFLAGS / CXXFLAGS /
LDFLAGS for every TU and the final link. No new apt packages:
libasan / libubsan ship with the default gcc on ubuntu-latest.
- Smoke runs --help and --features. Both exit(0) directly after
printing. Coverage scope is honest in the inline comment: libc
init, main(), frontend driver bootstrap, argv duplication, the
getopt walk over the full option table, the print functions
themselves, and the static feature-table walks --features
performs. Doesn't reach core loading, video init, or cleanup-
on-shutdown -- a follow-up step running with --max-frames=N
against a noop core can extend coverage to the full lifecycle,
but adding the noop-core dependency to CI is a separate step
better handled in its own patch.
- Sanitizer settings:
ASAN_OPTIONS=abort_on_error=1:detect_leaks=0:
print_stacktrace=1:strict_string_checks=1
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=0
LSAN_OPTIONS=exitcode=0
ASan in abort-on-error: any heap corruption fails the job
immediately. Leak detection off for now -- libGL / Mesa /
Wayland symbol-resolution drives a non-trivial baseline of
"leaks" at process shutdown that aren't RetroArch bugs; can
revisit with a suppression file once the rest is clean.
UBSan in report-only: the first iteration is a discovery run.
Pre-existing signed-overflow / alignment / shift-too-large
diagnostics in audio resampling, color math, and vendored deps
are likely to be present. The "Summarize UBSan baseline"
step prints the deduplicated list so follow-up patches have
a target to drive to zero. Once that count reaches zero,
flip halt_on_error=1 in the smoke steps to enforce.
Each smoke step independently greps stderr for
"AddressSanitizer:" and exits 1 on any match -- belt-and-
suspenders to abort_on_error in case a future ASan release
changes its default exit semantics.
- Kept as its own workflow rather than folded into Linux-Headless
so the existing green-path build smoke stays fast (no ~3-5x
ASan slowdown), and so this one can own its longer 25-minute
timeout independently.
- Trigger matches the per-sample workflows: push to master,
pull_request to master, workflow_dispatch.1 parent aa4a196 commit b9777c8
1 file changed
Lines changed: 170 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
0 commit comments