test(relinker): cover unsupported CIE version in unwind record parsing #14527

Merged
slopgobblercobbler merged 1 commit from upstream-pr/14527 into main 2026-11-21 09:16:59 +00:00
slopgobblercobbler commented 2026-11-01 15:27:43 +00:00 (Migrated from github.com)

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


What

Cover unsupported CIE version (!= 1, 3, 4) in unwind record parsing with unit tests in UnwindRecordBoundsTests.cpp.

Tested

Built and executed unwind_record_bounds_tests.exe successfully (all 86 cases passed).

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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:5108766132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14527). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-01T15:27:43Z. --- ### What Cover unsupported CIE version (!= 1, 3, 4) in unwind record parsing with unit tests in UnwindRecordBoundsTests.cpp. ### Tested Built and executed unwind_record_bounds_tests.exe successfully (all 86 cases passed). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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) and the licence notice of code adapted from upstream (see AGENTS.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
BunnyFl commented 2026-11-02 01:26:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:26:43Z.

Review: APPROVED


Windows 11, WinLibs GCC 15.2.0 r7, relinker-only Release. Head 03598c6f5c merged into upstream/main 93dbd0f82a:

  • unwind_record_bounds_tests: 34 unwind record cases passed.
  • Mutation check: with the version check in EhFrameReader.cpp:165 disabled, this branch's test fails (Unwind record validation failed, exit 1), while main's test still passes (30 cases). So the new cases cover the check, and matching on the unsupported CIE version message keeps them from passing on another error.

Heads-up: #14513 and #14573 replace the same "30 unwind record cases passed" line, so this will conflict with whichever merges first.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731230967 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14527#pullrequestreview-5731230967). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:26:43Z. **Review:** APPROVED --- Windows 11, WinLibs GCC 15.2.0 r7, relinker-only Release. Head 03598c6f5c merged into upstream/main 93dbd0f82a: - `unwind_record_bounds_tests`: `34 unwind record cases passed`. - Mutation check: with the version check in `EhFrameReader.cpp:165` disabled, this branch's test fails (`Unwind record validation failed`, exit 1), while main's test still passes (30 cases). So the new cases cover the check, and matching on the `unsupported CIE version` message keeps them from passing on another error. Heads-up: #14513 and #14573 replace the same `"30 unwind record cases passed"` line, so this will conflict with whichever merges first.
MarcZX10 commented 2026-11-02 04:45:45 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

The new cases feed the relinker's eh_frame reader four unsupported CIE versions (0, 2, 5 and 255) and expect the "unsupported CIE version" rejection. The reader accepts versions 1, 3 and 4 and rejects others with that message (EhFrameReader.cpp lines 164-165), and the byte layout of the test record matches the reader's order (length, zero identifier, then version). The relinker jobs passed at this head; I did not confirm that they run UnwindRecordBoundsTests.

What I ran

  • Head 03598c6f5cc8c1cd737be3abec8ecfb3a097048d; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 1 file, +32/-1: core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp.
  • Read the full diff and the reader's CIE check (core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp lines 159-165 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, stack check and the ABI audit (no export changed).
  • 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
Versions 0, 2, 5, 255 are rejected passed the reader accepts only 1, 3 and 4 (EhFrameReader.cpp line 165)
Record layout in the test passed length, zero identifier and version are at the offsets the reader reads
Relinker jobs (hosted) passed ubuntu g++, windows g++, asan and macOS jobs passed
Whether those jobs run this test file not confirmed the job logs were not read
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. The read-only checks were run from the trusted main checkout. Hosted: gh api repos/boykopovar/AnyPS5/commits/03598c6f5cc8c1cd737be3abec8ecfb3a097048d/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

None.

Sources

Not verified

  • Whether the relinker jobs run UnwindRecordBoundsTests was not confirmed.
  • The Linux run of the test was not checked here.

To get this to a good state

  • Nothing to change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732177559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14527#pullrequestreview-5732177559). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:45:45Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The new cases feed the relinker's `eh_frame` reader four unsupported CIE versions (0, 2, 5 and 255) and expect the "unsupported CIE version" rejection. The reader accepts versions 1, 3 and 4 and rejects others with that message (`EhFrameReader.cpp` lines 164-165), and the byte layout of the test record matches the reader's order (length, zero identifier, then version). The relinker jobs passed at this head; I did not confirm that they run `UnwindRecordBoundsTests`. ## What I ran - Head `03598c6f5cc8c1cd737be3abec8ecfb3a097048d`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 1 file, +32/-1: `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp`. - Read the full diff and the reader's CIE check (`core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp` lines 159-165 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, stack check and the ABI audit (no export changed). - 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 | | Versions 0, 2, 5, 255 are rejected | passed | the reader accepts only 1, 3 and 4 (`EhFrameReader.cpp` line 165) | | Record layout in the test | passed | length, zero identifier and version are at the offsets the reader reads | | Relinker jobs (hosted) | passed | ubuntu g++, windows g++, asan and macOS jobs passed | | Whether those jobs run this test file | not confirmed | the job logs were not read | | 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. The read-only checks were run from the trusted main checkout. Hosted: `gh api repos/boykopovar/AnyPS5/commits/03598c6f5cc8c1cd737be3abec8ecfb3a097048d/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** None. ## Sources - CIE version check: https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp#L159-L165 - Changed test: https://github.com/boykopovar/AnyPS5/blob/03598c6f5cc8c1cd737be3abec8ecfb3a097048d/core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp ## Not verified - Whether the relinker jobs run `UnwindRecordBoundsTests` was not confirmed. - The Linux run of the test was not checked here. ## To get this to a good state - Nothing to change.
MarcZX10 commented 2026-11-14 04:32:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T04:32:38Z.

Review: APPROVED


Reviewed — looks good

The added cases exercise rejected CIE versions 0, 2, 5, and 255 against the existing unsupported-version check at the exact reviewed head f7e40a1368e4116c548f9f5d671ae999be691e25.

What I ran

No commands or tests were run in this review; source was inspected with the pinned reader.

Results

Check Result Note
Changed test source read passed Full changed file inspected
Test execution not run Description reports 34 cases passed; not independently confirmed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported test run, compilation, and runtime behavior were not independently verified. The only changed file listed in the manifest was read: core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp. No files were excluded in the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5901635326 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14527#pullrequestreview-5901635326). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T04:32:38Z. **Review:** APPROVED --- # Reviewed — looks good The added cases exercise rejected CIE versions 0, 2, 5, and 255 against the existing unsupported-version check at the exact reviewed head `f7e40a1368e4116c548f9f5d671ae999be691e25`. ## What I ran No commands or tests were run in this review; source was inspected with the pinned reader. ## Results | Check | Result | Note | |---|---|---| | Changed test source read | passed | Full changed file inspected | | Test execution | not run | Description reports 34 cases passed; not independently confirmed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The reported test run, compilation, and runtime behavior were not independently verified. The only changed file listed in the manifest was read: `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp`. No files were excluded in the manifest. ## To get this to a good state Nothing is required.
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!14527
No description provided.