fix(relinker): ignore unwind records that cover no code #6619
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6619"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T23:13:29Z.
What
An FDE whose address range is 0 describes no instructions, and an unwinder never matches a pc in it. The exception-table reader rejected one, which stopped the conversion of Limbo (CUSA01664) on
main5d9dcc42d:One of Limbo's 17328 FDEs covers 0 bytes at 0x47dd0, where the next record starts. Such a record is now read and validated as before, but left out of the function list. A record whose start differs from the
.eh_frame_hdrentry, or whose range overflows, is still rejected. Part of the PS4 work tracked in #3093.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, on
main5d9dcc42d:unwind_record_boundshas a new case: the fixture's FDE with a range of 0 reads as no functions. Each of these makes it fail: rejecting the record as before, and keeping it as an empty function.-DANYPS5_RELINKER_ONLY=ON): 177 of 177 tests pass. The relinker it builds gets Limbo past this record to its inline jump tables, which #6618 handles; with both, Limbo converts.tools/check_conventions.pypasses.Not tested on Linux or macOS hosts.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-16T02:27:12Z.
Independent Linux and native macOS parser coverage for exact head
a9fa0e8b088432e6a7ba7182390a41ff31648550, filling the host gap in the description.UnwindRecordBoundsTests.cpp,EhFrameReader.cppandBufferUtils.cpp, using the include directories ofunwind_record_bounds_tests. The stock test reports 14 cases passed on both hosts. Substituting onlyEhFrameReader.cppfromHEAD^fails on both withStrict filter: inconsistent FDE function range.Fixture()and sets the FDE range at offset 112 to zero while retaining eight existing malformed CIE/FDE/segment cases, plus a mismatched.eh_frame_hdrstart. All nine malformed zero-length cases remain rejected on both hosts.One small extra regression is worth keeping: a zero-sized FDE whose start disagrees with its header entry. In a scratch production copy, returning an empty region immediately after reading
size == 0still passes all 14 stock cases, but the external probe catches this malformed record on both hosts. Current PR code correctly rejects it. The case is:No repository source changed. Scope: the production exception-table reader and synthetic byte fixtures; no full relinker/CTest build, Limbo conversion, guest execution or Rosetta run. The existing Windows title-conversion evidence remains the title evidence.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T20:59:43Z.
Second-title data point: Hasbro Family Fun Pack (CUSA03312, my own dump) needs this PR, on Linux and Windows.
Relinker-only Release build, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7. Starting from
mainf3059421f, I merged, in this order: #7660, #6619 (a9fa0e8b0), #5138 (5f5641732), #6381 (6f8d9a09d),3b158c1e4from #6977, #6354 (81561867f), #6357 (32fe3aa8b), #6684 (ab9d21afc) and #6618 (bf06a8e5c). With that stack, the Linux and--windowsconversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out. Without this PR, both targets stop in the eboot:The other members each stop at their own step, so every one of them is needed for this title; the whole table is on #6977.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T08:00:18Z.
Checked: a zero-range FDE is still read and validated (start vs
.eh_frame_hdr, overflow) and only dropped from the function list; the new case inunwind_record_boundspins it and fails without the change. Relinker CI green on Linux, macOS and Windows, plus the independent Linux/macOS and Hasbro runs in the thread. Merged.