Skip to content

Commit e8c8bd1

Browse files
committed
previous commit was wrong msg
1 parent d967813 commit e8c8bd1

1 file changed

Lines changed: 60 additions & 48 deletions

File tree

.github/workflows/Linux-asan-ubsan.yml

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ name: CI Linux ASan + UBSan [No Menu]
99
# argv duplication, the getopt walk, and the print functions.
1010
# Strict ASan + UBSan -- baseline confirmed clean (run #1).
1111
#
12-
# 2. Headless imageviewer core under Xvfb + xvideo video driver +
12+
# 2. Headless imageviewer core under Xvfb + sdl2 video driver +
1313
# null audio driver, --max-frames=300 for a clean shutdown
1414
# through the normal runloop teardown. Exercises core loading
1515
# via dlopen, the imageviewer's stb_image-driven loader, the
16-
# X11 + XVideo color-conversion pipeline, the runloop, and
16+
# SDL2 + X11 + MIT-SHM rendering pipeline, the runloop, and
1717
# cleanup-on-shutdown. Soft-fail (continue-on-error) on this
18-
# first iteration: lots can go wrong (Xvfb quirks, libGL leaks,
19-
# driver init noise) that aren't RetroArch bugs but would fail
20-
# the run if treated strictly. Sanitizer findings are still
18+
# first iteration: lots can go wrong (libGL leaks, driver
19+
# init noise) that aren't RetroArch bugs but would fail the
20+
# run if treated strictly. Sanitizer findings are still
2121
# surfaced in step output for triage.
2222
#
2323
# The per-sample tests under .github/workflows/Linux-samples-gfx.yml,
@@ -61,19 +61,16 @@ jobs:
6161
# known-good headless configuration. Adds:
6262
# xvfb / x11-utils -- virtual X server for the imageviewer
6363
# smoke step + xdpyinfo for diagnostics
64-
# libxv-dev -- XVideo extension headers, for the
65-
# xvideo video driver
66-
# libxext-dev / libxxf86vm-dev -- transitive X11 deps that
67-
# configure's xvideo check requires
68-
# No sanitizer-specific packages required; libasan / libubsan
69-
# ship with the gcc that ubuntu-latest has installed by
70-
# default.
64+
# libsdl2-dev (already in the base set) provides the SDL2
65+
# video driver used by that smoke -- see the smoke step's
66+
# comment for why SDL2 over xvideo. No sanitizer-specific
67+
# packages required; libasan / libubsan ship with the gcc
68+
# that ubuntu-latest has installed by default.
7169
run: |
7270
sudo apt-get update -y
7371
sudo apt-get install -y \
7472
build-essential \
7573
libxkbcommon-dev libx11-xcb-dev \
76-
libxv-dev libxext-dev libxxf86vm-dev \
7774
xvfb x11-utils \
7875
zlib1g-dev libfreetype6-dev \
7976
libegl1-mesa-dev libgles2-mesa-dev libgbm-dev \
@@ -84,13 +81,13 @@ jobs:
8481
- name: Checkout
8582
uses: actions/checkout@v3
8683

87-
- name: Configure (no menu, no discord/cheevos/networking, xvideo on)
84+
- name: Configure (no menu, no discord/cheevos/networking, sdl2 on)
8885
# Trim the build surface for the first iteration so any
8986
# sanitizer hit is a RetroArch-internal bug rather than noise
9087
# from a vendored third-party subsystem. The disabled
9188
# subsystems will be re-enabled in follow-up patches as the
92-
# baseline stays green. --enable-xvideo is explicit because
93-
# the imageviewer smoke step below selects xvideo as the video
89+
# baseline stays green. --enable-sdl2 is explicit because
90+
# the imageviewer smoke step below selects sdl2 as the video
9491
# driver; if its build deps were ever missing, a silent fall-
9592
# back to a different driver would skew the smoke's coverage
9693
# without warning.
@@ -100,7 +97,7 @@ jobs:
10097
--disable-discord \
10198
--disable-cheevos \
10299
--disable-networking \
103-
--enable-xvideo
100+
--enable-sdl2
104101
105102
- name: Build with -fsanitize=address,undefined
106103
# The top-level Makefile (line 153) propagates SANITIZER into
@@ -244,27 +241,43 @@ jobs:
244241
# ~15-25s under sanitizer overhead), then exits via the
245242
# normal runloop teardown path. Covers what the --help and
246243
# --features smokes can't: dlopen of a libretro core,
247-
# retro_load_game, the stb_image decode path, the X11 +
248-
# XVideo color-conversion + shared-memory image-transfer
249-
# pipeline, the runloop, and full cleanup-on-shutdown.
244+
# retro_load_game, the stb_image decode path, the SDL2 +
245+
# X11 + MIT-SHM rendering pipeline, the runloop, and full
246+
# cleanup-on-shutdown.
250247
#
251-
# Soft-fail (continue-on-error: true) on this first
252-
# iteration. Reasoning: lots can go wrong here that aren't
253-
# RetroArch bugs -- Xvfb quirks, libGL / Mesa software-
254-
# rasterizer leaks at shutdown, X11 driver init noise --
255-
# and forcing the workflow to enforce strict cleanliness
256-
# before we've measured the baseline would block merges on
257-
# noise. Sanitizer findings ARE still surfaced in the step
258-
# output for triage; they just don't fail the job. Once
259-
# the baseline is characterised the same way the --help
260-
# step's was, this step can be flipped to strict.
248+
# Why sdl2 specifically: the v10 first attempt selected
249+
# xvideo (smaller, more self-contained, real YUV color
250+
# tables). Run #1 of that workflow tripped on Xvfb
251+
# exposing the XVideo extension but providing zero
252+
# adaptors:
253+
#
254+
# [XVideo] XvQueryAdaptors() found 0 adaptors.
255+
# [Video] Cannot open video driver. Exiting...
256+
#
257+
# That's correct defensive code in the xvideo driver, not
258+
# a bug -- but it means xvideo can't be exercised on Xvfb
259+
# without real video hardware, which the runner doesn't
260+
# have. SDL2 over X11 / MIT-SHM works on Xvfb out of the
261+
# box (verified via a standalone SDL_CreateRenderer probe
262+
# before this patch landed). Coverage tradeoff: we lose
263+
# xvideo's YUV color-conversion path but keep all the
264+
# high-leverage surface (dlopen, core lifecycle, stb_image,
265+
# runloop, video driver init, full cleanup).
266+
#
267+
# Soft-fail (continue-on-error: true) on this iteration.
268+
# Reasoning: lots can go wrong here that aren't RetroArch
269+
# bugs -- libGL / Mesa software-rasterizer leaks at
270+
# shutdown, X11 driver init noise -- and forcing strict
271+
# cleanliness before measuring the baseline would block
272+
# merges on noise. Sanitizer findings ARE still surfaced
273+
# in the step output for triage; they just don't fail
274+
# the job. Once the baseline is characterised, this step
275+
# can be flipped to strict the same way the --help step
276+
# was in v8.
261277
#
262278
# Audio driver is "null" (no PulseAudio / ALSA dependency
263-
# on the runner). Video driver is "xvideo" because Xvfb
264-
# exposes the XVideo extension and that's the smallest /
265-
# most self-contained X11 driver in the tree (1163 LOC,
266-
# adapted from bSNES/MPlayer, no GL dependency). Verbose
267-
# output is on so the run captures the full log for triage.
279+
# on the runner). Verbose output is on so the run captures
280+
# the full log for triage.
268281
continue-on-error: true
269282
env:
270283
# detect_leaks=0 because libGL / Mesa symbol-resolution
@@ -285,33 +298,32 @@ jobs:
285298
286299
# Start Xvfb on display :99. -screen geometry is small
287300
# because the imageviewer doesn't care about resolution
288-
# and we're trying to minimise X server memory. +extension
289-
# GLX is implicit in modern Xvfb; XVideo is exposed by
290-
# default.
301+
# and we're trying to minimise X server memory. SDL2's
302+
# X11 backend uses MIT-SHM (which Xvfb provides by
303+
# default) for image transfer.
291304
Xvfb :99 -screen 0 320x240x24 -nolisten tcp &
292305
XVFB_PID=$!
293306
# Ensure cleanup on any exit (including soft-fail ones).
294307
trap "kill $XVFB_PID 2>/dev/null || true" EXIT
295-
# Give Xvfb time to come up; xdpyinfo also confirms
296-
# XVideo is available before we waste cycles trying to
297-
# use it. xdpyinfo prints extension names indented with
298-
# leading whitespace, hence the ^[[:space:]]* in the
299-
# regex.
308+
# Give Xvfb time to come up; xdpyinfo confirms MIT-SHM is
309+
# available before we waste cycles trying to use it.
310+
# Extension names in xdpyinfo output are indented with
311+
# leading whitespace, hence ^[[:space:]]+.
300312
for i in 1 2 3 4 5; do
301313
if DISPLAY=:99 xdpyinfo -queryExtensions 2>/dev/null \
302-
| grep -qE "^[[:space:]]+XVideo\b"; then
314+
| grep -qE "^[[:space:]]+MIT-SHM\b"; then
303315
break
304316
fi
305317
sleep 1
306318
done
307319
DISPLAY=:99 xdpyinfo -queryExtensions \
308-
| grep -E "^[[:space:]]+(XVideo|MIT-SHM)\b" || true
320+
| grep -E "^[[:space:]]+MIT-SHM\b" || true
309321
310-
# Minimal config: xvideo video, null audio, one frame of
311-
# logging detail. Everything else takes built-in defaults.
322+
# Minimal config: sdl2 video, null audio. Everything
323+
# else takes built-in defaults.
312324
mkdir -p /tmp/asan-cfg
313325
cat > /tmp/asan-cfg/retroarch.cfg <<EOF
314-
video_driver = "xvideo"
326+
video_driver = "sdl2"
315327
audio_driver = "null"
316328
video_threaded = "false"
317329
video_fullscreen = "false"

0 commit comments

Comments
 (0)