ci(relinker): run TLS function coverage tests under ASan on Linux #7096
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7096"
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 pushkarreddyy on 2026-10-17T11:20:45Z.
What
Runs the relinker TLS function coverage tests (-L tls_function_coverage) under AddressSanitizer (-DANYPS5_ENABLE_ASAN=ON) on Linux in the existing
elinker workflow job using a Debug build with --no-tests=error.
In #6401, a 1-byte read past EOF in WindowsTlsBuilder.cpp was fixed and the segment-prefix-at-eof case was added. As noted in #7062 and demonstrated by @inmert in #7097, GCC at -O3 (Release) does not emit the unreferenced load and can mask the overread; building with -DCMAKE_BUILD_TYPE=Debug ensures ASan reliably catches the heap-buffer-overflow in ls_function_coverage_rejected whenever the bounds check is reverted.
Closes #7062.
Tested
Checklist
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T11:27:35Z.
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.yml.github/workflows/build.yml.github/workflows/build.yml.github/workflows/build.ymlImported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T13:27:09Z.
Hi @MarcZX100, following up on your comparison with #7097: #7096 is cleanly rebased on latest
origin/main(04788b090), with all 31/31 TLS function coverage tests passing under AddressSanitizer in the hosted Linux relinker job. All CI checks are green and ready for review/merge whenever convenient!Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:35:50Z.
The #7062 done-when asks that reverting the #6401 bounds check makes the ASan CI job fail. #7097's description reports that a separate Release+ASan control still passes all 31 TLS tests with the fix reverted, while its Debug+ASan run catches the heap-buffer-overflow in
tls_function_coverage_rejected. Could you use Debug for this ASan job or coordinate with #7097 so the chosen job demonstrably catches the regression?Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T13:44:36Z.
Hi @MarcZX100, thank you for catching that!
I have updated the Linux relinker ASan step to build with -DCMAKE_BUILD_TYPE=Debug and added --no-tests=error to ctest (commit d7d9d194e). As demonstrated by @inmert in #7097, Debug ensures GCC emits the unreferenced load and ASan reliably catches the heap-buffer-overflow in ls_function_coverage_rejected whenever the #6401 bounds check is reverted.
I kept the steps inside the existing Linux relinker job as you noted to avoid the extra runner slot/setup overhead, and credited @inmert in the PR description. Full CI is running cleanly now!
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-17T14:23:11Z.
Independent revert-negative check for the exact current #7096 head
f297c8a39ea54db866dee26853bef011a9ec1145, addressing the #7062 done-when and the Debug-vs-Release review question.Ubuntu 24.04 x86-64, GCC 13.3. I used the workflow's
Debug,ANYPS5_RELINKER_ONLY=ON,ANYPS5_ENABLE_ASAN=ON,BUILD_TESTING=ONconfiguration and its CTest selection:ctest --show-only=json-v1 -L tls_function_coverageselects 31 tests, includingtls_function_coverage_rejected.addressRegisterconditional revertedtls_function_coverage_rejectedfailsThe failing run contains
AddressSanitizer: heap-buffer-overflow,READ of size 1, with its first frame inWindowsTlsBuilder::Buildat the revertedbytes[position + 1]read (WindowsTlsBuilder.cpp:152). This is the intended EOF regression, rather than a missing-test or unrelated sanitizer failure.For the negative arm I rebuilt only that source object using the original Debug+ASan compile command, replaced it in a copy of the production archive, and relinked the same CLI. All test sources and other objects stayed identical. The fixed binary was restored before the final passing test; repository source was not changed.
This verifies the local Linux workflow configuration and its sensitivity to the regression. I did not dispatch or modify a GitHub-hosted workflow run, and I did not repeat #7097's Release control.
Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-17T14:42:41Z.
Thank you so much @simonbbby for running the independent revert-negative validation on Ubuntu 24.04 with GCC 13.3! Really appreciate you verifying that the Debug+ASan configuration cleanly passes all 31/31 tests on the current head and reliably catches the heap-buffer-overflow in \ ls_function_coverage_rejected\ when the check is reverted.
Ready for review/merge whenever convenient!
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T18:51:34Z.
Rebase handoff — rebased onto current
main(authorship unchanged). One conflict in.github/workflows/build.yml:main's newer--parallel 4ctest line kept, followed by your ASan TLS-coverage job.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the knownmainregression (agc_driver_tessellationsegfault — Mesa, #5444), not this PR.To pick it up:
Head is
577521a36.Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-18T02:34:38Z.
Closing as superseded by #7097, which introduced the dedicated
relinker-asanworkflow job to address #7062.Pull request closed