ci: run the relinker TLS coverage tests under AddressSanitizer #7097
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7097"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by inmert on 2026-10-17T11:20:46Z.
What
Fixes #7062. #6401 (MarcZX100) fixed a 1-byte read past the end of the input in
WindowsTlsBuilderand added thesegment-prefix-at-eofcase to the TLS coverage tests, but as Dextroid17 showed there, that case only catches the bug when the relinker is built with AddressSanitizer, and no CI job did that.This adds a
relinker-asanjob next torelinker. It runs under the same condition, merges the pull request intomainthe same way, builds the relinker alone in Debug with-DANYPS5_ENABLE_ASAN=ON, and runs thetls_function_coveragelabel (31 tests) with--no-tests=error, so the job also fails if the label ever stops matching.It has to be Debug. With
-DCMAKE_BUILD_TYPE=Releaseand ASan, all 31 tests still pass with the #6401 fix reverted: at -O3 GCC no longer emits the stray load (its result is only used whenaddressis set), so there is nothing for ASan to catch. In a Debug build the same revert failstls_function_coverage_rejected:I also tried the whole relinker set under ASan (187 tests, about 95 s here). Everything passes except
guest_module_args,guest_module_finiandguest_deferred_dependencies, which load the ASan-built output into a plain Python process and stop with "ASan runtime does not come first in initial library list". That is the test harness, not a finding, so the job keeps to the TLS label as the issue asks. The other suites can be added once those three run with the runtime preloaded.Tested
Ubuntu 24.04, GCC 13.3.0, on
main864729dc0, with the commands the job runs:ctest --label-regex '^tls_function_coverage$' --no-tests=error: 31/31 pass, about 20 s.WindowsTlsBuilder.cppput back to its state before #6401:tls_function_coverage_rejectedfails with the report above, the other 30 pass.python3 tools/check_conventions.py --base origin/mainpasses.build.ymlchanges.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T11:27:37Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
.github/workflows/build.yml.github/workflows/build.ymlImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:16:36Z.
I compared the overlapping #7096 PR and ran its current check result. Both add an ASan build and
tls_function_coveragerun for this issue; #7096 places those steps in the existing Linux relinker job and its hosted run completed 31/31 TLS coverage tests successfully. This PR adds a separate Ubuntu job that rebuilds the relinker and manually replays the PR merge setup already performed by the existing workflow. Could you coordinate with @pushkarreddyy on consolidating into #7096, or explain a required behavior that #7096 does not cover? I’d avoid landing both paths because that would duplicate the ASan build and test cost on each relinker change.AI-assisted: yes (Codex); comparison and check result reviewed.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T13:21:11Z.
Thanks @MarcZX100 for the thorough comparison and review!
Hi @inmert — happy to coordinate on this! As Marc noted, #7096 integrates the ASan build and test execution directly into the existing Linux relinker matrix step, avoiding spinning up a separate runner and duplicate build setup while verifying all 31/31 TLS function coverage tests.
I have just rebased #7096 cleanly onto latest
origin/main(04788b090). If there are any specific flags, additional test steps, or refinements from your PR you would like to see incorporated, please let me know and I'm very happy to add them to #7096 so we have the best combined coverage.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T15:29:30Z.
Thanks for coordinating. The current #7096 head now satisfies the issue’s done-when: Debug+ASan selects all 31 TLS coverage tests, passes 31/31 with the fix, and the independent revert control fails specifically in
WindowsTlsBuilder::Buildwith the expected one-byte heap-buffer-overflow. I do not see additional behavior in #7097 that this evidence leaves uncovered; the two PRs target the same workflow coverage.