fix(relinker): skip an unreadable sce_module file instead of aborting the conversion #21221

Merged
MarcZX10 merged 2 commits from upstream-pr/21221 into main 2026-11-25 23:05:21 +00:00
MarcZX10 commented 2026-11-16 00:31:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T00:31:07Z.


What

  • core/relinker/cli/src/NativeModules.cpp: while scanning sce_module/ and sce_modules/ for native module candidates, ReadModules called ReadCandidateHeader for every regular file. That function throws Cannot read guest candidate when the file cannot be opened, so one unreadable file (permissions, a Windows lock) aborted the whole conversion. The sibling ReportUnconvertedNeeded in the same file already skips unreadable files. The change makes ReadModules do the same: it prints Skipping unreadable file: <path> and continues, like the existing SELF and backup-copy skips.
  • Second commit: ReadCandidateHeader had no callers left after the first commit, so it is removed.

Tested

  • Not built or run: this host builds no relinker in this session. Checked by reading: root, TryReadCandidateHeader and the CandidateHeader fields used are already in scope at the changed lines.
  • git diff --check upstream/main...HEAD: passed. python3 tools/check_conventions.py --base upstream/main: passed.
  • A test is not added: reproducing an unreadable file needs a non-root user or a locked file, which the test environment does not guarantee.
  • Overlap: open PRs #20281 and #18000 also touch this file. Their diffs do not change ReadCandidateHeader, TryReadCandidateHeader or the loop in ReadModules (checked on the diffs).

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
  • Unimplemented paths throw; 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
  • 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:5328925000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21221). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T00:31:07Z. --- ### What - `core/relinker/cli/src/NativeModules.cpp`: while scanning `sce_module/` and `sce_modules/` for native module candidates, `ReadModules` called `ReadCandidateHeader` for every regular file. That function throws `Cannot read guest candidate` when the file cannot be opened, so one unreadable file (permissions, a Windows lock) aborted the whole conversion. The sibling `ReportUnconvertedNeeded` in the same file already skips unreadable files. The change makes `ReadModules` do the same: it prints `Skipping unreadable file: <path>` and continues, like the existing SELF and backup-copy skips. - Second commit: `ReadCandidateHeader` had no callers left after the first commit, so it is removed. ### Tested - Not built or run: this host builds no relinker in this session. Checked by reading: `root`, `TryReadCandidateHeader` and the `CandidateHeader` fields used are already in scope at the changed lines. - `git diff --check upstream/main...HEAD`: passed. `python3 tools/check_conventions.py --base upstream/main`: passed. - A test is not added: reproducing an unreadable file needs a non-root user or a locked file, which the test environment does not guarantee. - Overlap: open PRs #20281 and #18000 also touch this file. Their diffs do not change `ReadCandidateHeader`, `TryReadCandidateHeader` or the loop in `ReadModules` (checked on the diffs). ### 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 and the licence notice of code adapted from upstream - [x] Unimplemented paths throw; silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [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
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!21221
No description provided.