fix(relinker): read LSDA call-site tables only under a personality routine #1944
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1944"
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 babyhuey on 2026-10-09T01:33:29Z.
What
EhFrameReaderreads an FDE's LSDA as an Itanium C++ call-site table only when its CIE names a personality routine (Pin the augmentation). An LSDA under a CIE without one is skipped.The C++ LSDA format is defined by the personality routine that reads it. With no personality the unwinder never consults the LSDA, so its contents need not be a C++ table. .NET NativeAOT writes exactly this: every CIE is
zLR, and each LSDA points at the runtime's own EH info, which its runtime reads instead of a C++ personality routine. Its catch and finally funclets are separate functions with their own FDEs, so no code is lost by not reading these LSDAs.Three catalog titles are C# NativeAOT builds (
System.Private.CoreLibin the executable) and fail to relink with--windowsonmain:FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1f5950)0x1ffd0b0x153c03In these three, every CIE is
zLR, and 4474, 4699 and 2731 of their LSDAs respectively do not parse as call-site tables. The 38 other catalog titles I could relink use onlyzPLRCIEs, and all of their roughly 65,000 LSDAs parse as call-site tables, so this change does not affect them.exceptionLandingPadsused azLRCIE to exercise call-site parsing. It now useszPLR, with the personality as an extra target. The newexceptionDataWithoutPersonalitychecks that an LSDA that is not a call-site table, under azLRCIE, is accepted and adds no targets.Tested
Linux (Ubuntu 24.04, GCC 13, Release,
ANYPS5_RELINKER_ONLY=ON): all 38 relinker tests pass.strict_nid_filterfails when the personality check is removed. The three titles above now relink with--windows(exit 0); Linux output was already unaffected.check_conventions.pypasses. Windows: not run with this branch; the failure and its absence are both in the relinker, which I ran on Linux with--windows.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-09T01:34:46Z.
Windows run of the three titles. Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release,
mainf1451396with this branch (and my other open PRs) merged; relinked with--windowsand run.mainFAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1f5950)libSceZlib.prx, which no module providesFAIL: Strict filter: LSDA call-site table size mismatch (offset 0x1ffd0b)FAIL: unresolved ELF import JZKw5+Wrnaw from libkernel.prx(pthread_sigmask)FAIL: Strict filter: LSDA call-site table size mismatch (offset 0x153c03)FAIL: unresolved ELF import JZKw5+Wrnaw from libkernel.prx(pthread_sigmask)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T02:03:31Z.
Review: APPROVED
Reviewed the full diff against current main. The change is narrowly scoped to avoid parsing an LSDA as a C++ call-site table when its CIE has no personality routine; the fixture now explicitly covers both the personality and no-personality cases. I built the relinker-only configuration on Linux and ran all 38 CTests successfully, including strict_nid_filter. Conventions and diff checks pass, and the author has supplied Windows evidence for the three reported NativeAOT cases. The upstream workflow is not yet reported for this head, so normal CI evidence remains outstanding.
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-09T03:31:15Z.
Fork CI for this head (547b4588) while the upstream run waits for approval: Build run, all jobs green (Linux, Windows, relinker on Linux, macOS and Windows).
Imported from boykopovar/AnyPS5. Originally posted by danielradosa on 2026-10-09T18:34:29Z.
Windows run with a title for this PR. Prospero Vibrate PPSA99920 1.0 (catalog release, sha256 as in the record,
eboot.binandsce_module/libc.prxunwrapped from their SELF containers), Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.main0fdda7be(and4b005b22):relinker --windowsfails withFAIL: Strict filter: LSDA call-site table size mismatch (offset 0x153c03). Linux output relinks.main0fdda7be+ this PR (+ #1650, #1748, #1911, which do not touch the LSDA reader):--windowsrelinks, and the converted executable loads its libraries and stops at its first absent import,FAIL: unresolved ELF import Jahsnh4KKkg from libkernel.prx(madvise, #1633).AI-assisted: yes (Claude Code).