test(relinker): cover out-of-range return address register in CIE header #14543

Closed
slopgobblercobbler wants to merge 1 commit from upstream-pr/14543 into main
slopgobblercobbler commented 2026-11-01 15:35:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-01T15:35:10Z.


What

Add test for CIE record with out-of-range return address column in UnwindRecordBoundsTests.

Tested

  • Ran unwind_record_bounds_tests successfully.
  • Ran python tools/check_conventions.py --base upstream/main --head HEAD with 0 findings.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5108824210 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14543). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-01T15:35:10Z. --- ### What Add test for CIE record with out-of-range return address column in UnwindRecordBoundsTests. ### Tested - Ran `unwind_record_bounds_tests` successfully. - Ran `python tools/check_conventions.py --base upstream/main --head HEAD` with 0 findings. ### Checklist - [x] Based on current main; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 04:46:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:46:49Z.

Review: COMMENTED


Reviewed — no blocking findings

The new case builds a CIE whose mapped address is near the top of the address space and expects a RelinkerException. The reader's checks for this path are in the same function as the CIE size and range checks (EhFrameReader.cpp lines 159-162). The test catches any RelinkerException without checking the message, so it would pass for a rejection from an unrelated check.

What I ran

  • Head be521e975fbb3abf236cdaafe3ac17dde3843fcc; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 1 file: core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp (test-only; the existing test file already runs in the relinker jobs).
  • Read the full diff and the matching checks in core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp (lines 159-165 and 210-234 at base).
  • Read-only checks from the trusted main checkout (precheck not run: this session does not run code from PR heads): diff check, conventions, the ABI audit (no export changed) and the stack check.
  • Hosted: the relinker ubuntu g++, windows g++, asan and macOS jobs passed; the main windows job was skipped.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed depends on none; the stack check passed
CIE return-address overflow is rejected passed by reading; the rejecting check was not pinned down by the test
ABI audit (main-checkout tool) not applicable no exported symbol changed
Build and runtime tests not run no local build
Negative controls not run no local build
Hosted CI passed relinker jobs passed; the main windows job was skipped
Read-only check output

Precheck was not run: this session does not run code from PR heads. Hosted: gh api repos/boykopovar/AnyPS5/commits/be521e975fbb3abf236cdaafe3ac17dde3843fcc/check-runs.

Negative control

Not run here. A negative control needs a build, and code from this head is not run here.

Findings

Blocking

None.

Non-blocking

  • The new case does not check which check rejected the record, so it would pass for an unrelated RelinkerException. Asserting a message (or the record size) would make the case specific.
  • This PR, #14513 and #14527 all change the same line ("30 unwind record cases passed") of UnwindRecordBoundsTests.cpp, so they will conflict when merged.

Sources

Not verified

  • Whether the relinker jobs run this test file was not confirmed.
  • The fixture layout (offsets in the test) was not traced beyond the reader's order.

To get this to a good state

  • Nothing blocking.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732182915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14543#pullrequestreview-5732182915). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:46:49Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The new case builds a CIE whose mapped address is near the top of the address space and expects a `RelinkerException`. The reader's checks for this path are in the same function as the CIE size and range checks (`EhFrameReader.cpp` lines 159-162). The test catches any `RelinkerException` without checking the message, so it would pass for a rejection from an unrelated check. ## What I ran - Head `be521e975fbb3abf236cdaafe3ac17dde3843fcc`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 1 file: `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp` (test-only; the existing test file already runs in the relinker jobs). - Read the full diff and the matching checks in `core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp` (lines 159-165 and 210-234 at base). - Read-only checks from the trusted main checkout (precheck not run: this session does not run code from PR heads): diff check, conventions, the ABI audit (no export changed) and the stack check. - Hosted: the relinker ubuntu g++, windows g++, asan and macOS jobs passed; the main windows job was skipped. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | depends on none; the stack check passed | | CIE return-address overflow is rejected | passed | by reading; the rejecting check was not pinned down by the test | | ABI audit (main-checkout tool) | not applicable | no exported symbol changed | | Build and runtime tests | not run | no local build | | Negative controls | not run | no local build | | Hosted CI | passed | relinker jobs passed; the main windows job was skipped | <details><summary>Read-only check output</summary> Precheck was not run: this session does not run code from PR heads. Hosted: `gh api repos/boykopovar/AnyPS5/commits/be521e975fbb3abf236cdaafe3ac17dde3843fcc/check-runs`. </details> ## Negative control Not run here. A negative control needs a build, and code from this head is not run here. ## Findings **Blocking** None. **Non-blocking** - The new case does not check which check rejected the record, so it would pass for an unrelated `RelinkerException`. Asserting a message (or the record size) would make the case specific. - This PR, #14513 and #14527 all change the same line ("30 unwind record cases passed") of `UnwindRecordBoundsTests.cpp`, so they will conflict when merged. ## Sources - Changed test: https://github.com/boykopovar/AnyPS5/blob/be521e975fbb3abf236cdaafe3ac17dde3843fcc/core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp - Reader checks: https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp#L159-L234 ## Not verified - Whether the relinker jobs run this test file was not confirmed. - The fixture layout (offsets in the test) was not traced beyond the reader's order. ## To get this to a good state - Nothing blocking.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14543
No description provided.