Skip to content

test(relinker): pin invalid guest lifecycle function relocation - #13711

Closed
rooklz wants to merge 1 commit into
boykopovar:mainfrom
rooklz:fix/guest-lifecycle-function-reloc-test
Closed

rooklz wants to merge 1 commit into
boykopovar:mainfrom
rooklz:fix/guest-lifecycle-function-reloc-test

Conversation

@rooklz

@rooklz rooklz commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

What

GuestImageReader rejects a guest lifecycle slot relocated as R_X86_64_64 with a non-zero addend (Invalid guest lifecycle function relocation). The existing invalid-case harness in test_guest_none_relocations.py covered PLT lifecycle slots and incomplete arrays but not this branch. The new case pins that refusal for both ELF and SCE-tagged fixtures.

Tested

macOS arm64, upstream/main de5c21f4f0, Python 3.13, relinker-only Release -DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON:

  • ctest -R guest_none_relocations: pass (includes new invalid-lifecycle-function-addend for sce=False/True).
  • Full ctest: 529/529.
  • python3 tools/check_conventions.py --base upstream/main: passed.
  • python3 tools/pr_overlap.py --branch fix/guest-lifecycle-function-reloc-test: no overlap (1548 PRs probed).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@rooklz
rooklz force-pushed the fix/guest-lifecycle-function-reloc-test branch from 2e52593 to db0932d Compare October 31, 2026 02:12
@rooklz
rooklz force-pushed the fix/guest-lifecycle-function-reloc-test branch from db0932d to cb69cc3 Compare October 31, 2026 02:30

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The new invalid case uses a function relocation with a non-zero addend and verifies rejection for both ELF and SCE-tagged fixtures.

What I ran

Reviewed head a5c3a74c0b078435a7ae3d124bd91a2fd723c83a against PR base 0cc02f7cde69941f651819b1f7a80f7aa722a08b. Current main is e2df06e661f94d6e63b8f6622c8c58507b0245c1; the merge preview was clean. A pairwise local merge with #13714 head e6c4959ab5d262f5b9efb15ba7aa8457639dc098 also completed cleanly. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0. No local build was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13711
python3 -m py_compile core/relinker/relinker/tests/test_guest_none_relocations.py
git diff --check 0cc02f7cde69941f651819b1f7a80f7aa722a08b...a5c3a74c0b078435a7ae3d124bd91a2fd723c83a
python3 tools/check_test_registration.py --scripts
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/relinker/relinker/tests/test_guest_none_relocations.py
python3 tools/pr_stack_check.py 13711 --repo boykopovar/AnyPS5
git worktree add --detach /tmp/anyps5-pair-13711-13714 a5c3a74c0b078435a7ae3d124bd91a2fd723c83a
git -C /tmp/anyps5-pair-13711-13714 merge --no-commit --no-ff e6c4959ab5d262f5b9efb15ba7aa8457639dc098
gh pr checks 13711 --repo boykopovar/AnyPS5

Results

Check Result
Diff, conventions, Python syntax Passed.
Test registration Passed; CMake registers guest_none_relocations.
Test-quality heuristic No findings from the workspace copy. The isolated precheck checkout lacked this workspace-only helper.
Current-main merge preview Clean against e2df06e661f94d6e63b8f6622c8c58507b0245c1.
Pairwise merge with #13714 Clean; both PRs add distinct invalid-case rows in the shared test file.
Hosted CI Ubuntu relinker and relinker-asan passed. Windows and both macOS relinker jobs were pending at the last check. Linux, Windows product, register-context and write-watch jobs were skipped.
Selected unedited output from checks
All conventions checks passed.
230 test script(s), each run by an add_test or a workflow
{
  "findings": [],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}
Auto-merging core/relinker/relinker/tests/test_guest_none_relocations.py
Automatic merge went well; stopped before committing as requested
relinker (ubuntu-latest, g++)	pass	3m24s	https://github.com/boykopovar/AnyPS5/actions/runs/41160873526/job/124419262564
relinker-asan	pass	2m37s	https://github.com/boykopovar/AnyPS5/actions/runs/41160873526/job/124419262526
relinker (windows-latest, g++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41160873526/job/124419262504
relinker (macos-latest, clang++)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41160873526/job/124419262520
relinker (macos-latest, clang++, x86_64)	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41160873526/job/124419262583
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13711-a5c3a74c0b07/head-a5c3a74c0b07-dae92085/tools/pr_test_quality.py': [Errno 2] No such file or directory

Negative control

Assertion Mutation Result
Reject a lifecycle function relocation with a non-zero addend Remove the existing C++ addend check Not exercised; it requires a local C++ rebuild, which was not run.

Findings

Blocking

None.

Non-blocking

Windows and macOS relinker jobs were still pending. The Ubuntu relinker job passed; I did not reproduce hosted CI locally.

Sources

Not verified

No local build or test run, Windows/macOS relinker result, or console behavior was verified here. Linux product and specialized CI jobs were skipped.

@rooklz

rooklz commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #14079, which adds all of these guest_none_relocations invalid cases in one change so the test file has a single open pull request. Closing this per-case pull request in favour of that one.

@rooklz rooklz closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants