Repository navigation
CI: Add Address Sanitizer (ASan) and Undefined Behavior Sanitizer (UBSan) tests. - #6
Merged
Merged
Conversation
Add a job to the CI workflow that builds openvcl and the tests in Debug with -fsanitize=address,undefined and runs them. It needs no PS2 toolchain, so it runs on ubuntu-latest without the ps2sdk container. The integration tests run openvcl as a child process, and a test that expects openvcl to fail would pass over a sanitizer report on its stderr. Reports go to files instead, and any report fails the job. openvcl does not free its register allocation data before it exits, and LeakSanitizer would fail 132 of the 444 tests on that, so leaks are not checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No test compiles the ps2gl programs in test/fixtures, so the sanitizer job never ran them through openvcl. Compile each one after the tests, with the same handling of reports. They take the whole compiler, software pipeliner included, through real programs. Build at -O1, as ASan's documentation suggests for speed: at -O0 the fixtures alone take several minutes to compile, and -O1 cuts that to about a third. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the CI runner -O1 made the sanitized build take four minutes instead of half a minute, more than it saved on the fixtures, and the job took over seven minutes. Build at -O0 again and compile the twelve fixtures at the same time: the slowest alone takes over a minute, and together they need under 5 GB of memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fjtrujy
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
sanitizersjob to the CI workflow. It builds openvcl and the tests in Debug with-fsanitize=address,undefined, runsctest, then compiles the 12 ps2gl programs intest/fixtures. No test compiles those today, and they take the whole openvcl, software pipeliner included, through real programs. The job needs no PS2 toolchain, so it runs onubuntu-latestwithout the ps2sdk container. It takes about 3 minutes (183 s on the last run), next to about 2.5 for theps2job.log_path) and printed at the end of the step. The integration tests runopenvclas a child process, so a test that expects it to fail would otherwise pass even with a report on its stderr.detect_leaks=0). openvcl doesn't free its register allocation data before it exits. With LeakSanitizer on, 132 of the 444 tests would fail on leak reports.-O0. With the sanitizers, the slowest takes over a minute. The second commit tried-O1instead: on the runner, the build itself then took 4 minutes instead of half a minute, and the job over 7. The third commit goes back to-O0, the fastest run of the two.On master the job passes with no reports. To check that it catches bugs, I added an off-by-one read past the end of a
std::vectorin the register allocator and tested locally. The step failed with 13heap-buffer-overflowreports: one from the test binary and one from each fixture.