test(relinker): audit eh_frame augmentation string parsing and format bounds #17451

Closed
slopgobblercobbler wants to merge 1 commit from upstream-pr/17451 into main
slopgobblercobbler commented 2026-11-08 19:53:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-08T19:53:42Z.


What

Adds standalone guest unit tests in core/relinker/relinker/tests/GuestRelinkerEhFrameAug.cpp auditing DWARF .eh_frame CIE augmentation string parser bounds, unknown fields, and record overflow handling.

Tested

Verified locally with guest_relinker_ehframe_aug test suite and tools/check_conventions.py.

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:5214586690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17451). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-08T19:53:42Z. --- ### What Adds standalone guest unit tests in `core/relinker/relinker/tests/GuestRelinkerEhFrameAug.cpp` auditing DWARF `.eh_frame` CIE augmentation string parser bounds, unknown fields, and record overflow handling. ### Tested Verified locally with `guest_relinker_ehframe_aug` test suite and `tools/check_conventions.py`. ### 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
gabichuuuuu commented 2026-11-08 21:47:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T21:47:30Z.

Review: COMMENTED


Windows run of head e12720400d, merged onto main 095ff72367 in one tree with other open PRs that touch different files (each PR's test is its own file, so they don't interact). Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release, BUILD_TESTING=ON.

  • guest_relinker_ehframe_aug fails, 1 / 1: EH frame augmentation parser validation failed. This matches the PR's failing relinker checks on Ubuntu, Windows and macOS.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819806155 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17451#pullrequestreview-5819806155). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T21:47:30Z. **Review:** COMMENTED --- Windows run of head `e12720400d`, merged onto `main` `095ff72367` in one tree with other open PRs that touch different files (each PR's test is its own file, so they don't interact). Setup: Windows 11, WinLibs GCC 15.2 r7 (`x86_64-ucrt-posix-seh`, the CI toolchain), Release, `BUILD_TESTING=ON`. - **`guest_relinker_ehframe_aug` fails, 1 / 1:** `EH frame augmentation parser validation failed`. This matches the PR's failing `relinker` checks on Ubuntu, Windows and macOS.
PrivacyOnion commented 2026-11-11 17:27:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T17:27:46Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against e12720400d:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • GitHub CI: failing check(s): relinker (macos-latest, clang++), relinker (ubuntu-latest, g++), relinker (windows-latest, g++).
  • Build: guest_relinker_ehframe_aug_tests built cleanly.
  • CTest (guest_relinker_ehframe_aug):
    1/1 Test #4567: guest_relinker_ehframe_aug .......***Failed    0.02 sec
    0% tests passed, 1 tests failed out of 1
    
    The following tests FAILED:
    
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5862788576 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17451#pullrequestreview-5862788576). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-11T17:27:46Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `e12720400d`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **GitHub CI**: failing check(s): `relinker (macos-latest, clang++)`, `relinker (ubuntu-latest, g++)`, `relinker (windows-latest, g++)`. - **Build**: `guest_relinker_ehframe_aug_tests` built cleanly. - **CTest** (`guest_relinker_ehframe_aug`): ``` 1/1 Test #4567: guest_relinker_ehframe_aug .......***Failed 0.02 sec 0% tests passed, 1 tests failed out of 1 ``` ``` The following tests FAILED: ``` - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-16 13:45:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T13:45:10Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 33de7e6427:

  • Conventions: tools/check_conventions.py passed; git diff --check reported whitespace errors.
  • Build: guest_relinker_ehframe_aug_tests built cleanly.
  • CTest (guest_relinker_ehframe_aug):
    1/1 Test #5842: guest_relinker_ehframe_aug .......***Failed    0.02 sec
    0% tests passed, 1 tests failed out of 1
    
    The following tests FAILED:
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5920995044 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17451#pullrequestreview-5920995044). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-16T13:45:10Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `33de7e6427`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` reported whitespace errors. - **Build**: `guest_relinker_ehframe_aug_tests` built cleanly. - **CTest** (`guest_relinker_ehframe_aug`): ``` 1/1 Test #5842: guest_relinker_ehframe_aug .......***Failed 0.02 sec 0% tests passed, 1 tests failed out of 1 ``` ``` The following tests FAILED: ``` Requesting changes for the points above.
PrivacyOnion commented 2026-11-19 23:54:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T23:54:41Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b3d9f61540:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_relinker_ehframe_aug_tests built cleanly.
  • CTest (guest_relinker_ehframe_aug):
    1/1 Test #6331: guest_relinker_ehframe_aug .......   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Code reading:
    • Verified CMakeLists.txt target definition: guest_relinker_ehframe_aug_tests links EhFrameReader.cpp and BufferUtils.cpp directly, properly isolated without full relinker_core bloat.
    • Verified CIE augmentation parsing in GuestRelinkerEhFrameAug.cpp: valid case checks augmentation string 'zR' with correct DWARF offset placement immediately following version byte at 72.
    • Verified CIE augmentation error handling: invalid size check (bytes[79] = 5) correctly tests exception 'CIE augmentation exceeds record'.
    • Verified unknown augmentation field and unsupported augmentation tests: bytes[74]='X' and bytes[73]='X' correctly exercise parser rejection and exception matching.
    • Verified FDE augmentation error handling: bytes[120]=5 correctly asserts 'FDE augmentation exceeds record' exception.
    • Verified AGENTS.md conventions: no comments in source code, no new debt fragments needed (test-only PR), and no platform-dependent LP64/LLP64 type mismatch.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5985317656 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17451#pullrequestreview-5985317656). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T23:54:41Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `b3d9f61540`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_relinker_ehframe_aug_tests` built cleanly. - **CTest** (`guest_relinker_ehframe_aug`): ``` 1/1 Test #6331: guest_relinker_ehframe_aug ....... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Code reading**: - Verified CMakeLists.txt target definition: guest_relinker_ehframe_aug_tests links EhFrameReader.cpp and BufferUtils.cpp directly, properly isolated without full relinker_core bloat. - Verified CIE augmentation parsing in GuestRelinkerEhFrameAug.cpp: valid case checks augmentation string 'zR' with correct DWARF offset placement immediately following version byte at 72. - Verified CIE augmentation error handling: invalid size check (bytes[79] = 5) correctly tests exception 'CIE augmentation exceeds record'. - Verified unknown augmentation field and unsupported augmentation tests: bytes[74]='X' and bytes[73]='X' correctly exercise parser rejection and exception matching. - Verified FDE augmentation error handling: bytes[120]=5 correctly asserts 'FDE augmentation exceeds record' exception. - Verified AGENTS.md conventions: no comments in source code, no new debt fragments needed (test-only PR), and no platform-dependent LP64/LLP64 type mismatch. Looks Good To Me

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!17451
No description provided.