fix(relinker): name --trap-sdk-syscall-stubs when a refused syscall is an SDK stub #9549
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9549"
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 DavidSamir on 2026-10-22T01:39:35Z.
What
A converted title that carries the ps5-payload-dev SDK syscall stubs is refused with
Forbidden syscall instruction at code offset 0x..., and nothing in the message says that--trap-sdk-syscall-stubsconverts it. The scanner already has the matchers for the sequences that option traps, so when the refused instruction is one of them the message now ends with; it is a ps5-payload-dev SDK syscall stub, which --trap-sdk-syscall-stubs replaces with UD2. Any other syscall keeps the message it had, so a real syscall never suggests the flag.Titles whose refusal now names the flag (catalog, Linux relinker,
--to-intel, no trap option):Forbidden syscall instruction at code offset 0xdeb8f7; it is a ps5-payload-dev SDK syscall stub, ...... at code offset 0x214385a: syscall number 9; it is a ps5-payload-dev SDK syscall stub, ...0x1108bf7), PPSA99203 (0x10a2d37), PPSA99360 (0x1699f07) and PPSA99288 (0x24a67ba) show the hint in the same way; the other titles of that list are not re-run here.Spot5 and ForgeNX convert and run for 60 s once
--trap-sdk-syscall-stubsis given (Linux, same harness as the other sweeps): first frame, no stderr.The change is in
SyscallScanner.cpp: the SDK-stub test that decided whether to trap is evaluated once intosdkStuband used for both the trap and the hint. Nothing else in the conversion changes.Tested
syscall_scanner(Linux;SyscallScannerTests.cpp, registered on Linux only): the numbered and the generic SDK stubs are refused with the hint, and the seven bare syscall shapes of the existing tests (unsigned constant, register,int 0x80,sysenter,sysret, clobbered, prefixed) are refused without it. The existing prefix andsyscall number Nchecks are unchanged and pass.SyscallScanner.cppfrom before the change and the same test,syscall_scannerfails withRelinker did not name --trap-sdk-syscall-stubs for the numbered SDK stub. With the change it passes.syscall_scanner,syscall_number,sdk_mman_syscall,conversion_diagnostics,executable_segmentsandsce_code_gapspass, 6 of 6.syscall_scanneritself is not registered on Windows).python tools/check_conventions.py --base origin/mainpasses.git merge-tree: clean againstmain. #8729 renamesIsSdkMmanSyscallStubtoIsSdkInlineSyscallStuband edits the trap condition, so it conflicts with this change on that line; whichever merges second only needs the function name inconst bool sdkStub = ...brought up to date.python tools/pr_overlap.py --branch fix/relinker-name-trap-flag(the version from #9539, which merges only the pull requests that share files with the branch; 1 min 18 s): #8729 conflicts onSyscallScanner.cppL293-294, the trap condition this change turns intosdkStub, and #8042 could not be compared because it conflicts withmainitself. Nothing else overlaps.Not run on macOS.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:46:05Z.
Review: CHANGES_REQUESTED
The message change and negative-control coverage are narrowly scoped and the PR is based on current main. I manually inspected the two reported overlap candidates. #8042 changes only the scanner construction/resynchronization option earlier in
SyscallScanner.cpp; it is separate from this PR’s SDK-stub classification and message hunk, so I found no ordering requirement there.#8729 does change the same trap-condition line and renames
IsSdkMmanSyscallStubtoIsSdkInlineSyscallStub. This branch still calls the old name. If #8729 lands first, this PR will need that call updated; the checklist currently saysDepends on: none, and I found no landing-order agreement in the PR discussion. Please coordinate with @hyvvs on which change lands first, update theDepends onentry to reflect that agreement, then rebase/recheck the combined line. The current hosted relinker matrix is still running on Windows; Ubuntu, macOS x86_64/arm64 and ASAN have passed so far, while platform product-build jobs are skipped.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:53:43Z.
Review: CHANGES_REQUESTED
Thanks for adding the same-line overlap explanation and recording that the second branch needs a small adaptation. The live overlap check still reports #8729 on the exact syscall predicate line. This branch continues to call
IsSdkMmanSyscallStub, while #8729 renames it toIsSdkInlineSyscallStub; the checklist still saysDepends on: none, and I do not see an agreed landing order in the discussion.Please coordinate the order with #8729's author, record the required predecessor on
Depends onif one must land first, then rebase/update the helper call and rerun the relinker matrix. The hosted Ubuntu, both macOS architectures and ASAN jobs pass; the hosted Windows relinker job is still running. Product Linux/Windows jobs are skipped. The PR's reported Linux and Windows focused tests are author-reported; I did not run local tests.The #8042 shared-file result remains a non-blocker: its scanner-construction change is separate from this classification/message hunk. This request is limited to the unresolved #8729 same-line integration rule.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:53:44Z.
The latest update keeps the accurate same-line overlap description, but the code still calls the old helper and the checklist still says
Depends on: none. Please agree the order with #8729’s author, record any required predecessor, then update the helper call after the agreed integration and rerun the matrix. The Windows relinker job has now passed along with Ubuntu, macOS x86_64/arm64 and ASAN; product builds are skipped.Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-22T02:18:50Z.
@MarcZX10 thanks. I have asked @hyvvs on #8729 about the order. Their PR is a draft that its author is holding for a decision on
nmountandunmount, so I proposed that this one lands first and that #8729 updates the helper name insideconst bool sdkStub = ...when it is rebased, which is one word. Until they answer,Depends on: nonestays, since this PR does not need #8729.If they would rather land first, I will rebase this branch onto #8729, call
IsSdkInlineSyscallStub, and changeDepends onto #8729. I will update this PR as soon as the order is agreed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:29:14Z.
The #8729 ordering is now settled: its author agrees this PR lands first, then #8729 rebases and adapts the helper call.
Depends on: noneis correct for this branch. I also built the PR snapshot with the repository relinker-only configuration in/dev/shmand ranctest -R ^syscall_scanner$: 1/1 passed.git diff --check, current-main conventions and merge-tree pass. One remaining requirement is freshness: the branch is 2 ahead/116 behind current upstream/main4777caca34(merge base94fbb8cea). No intervening main commit changes the scanner paths, but CONTRIBUTING still requires the branch to stay current. Please update and rerun the relinker matrix/focused tests on the resulting head. Hosted Ubuntu, Windows, both macOS architectures and ASAN relinker jobs pass; product builds are skipped.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:29:15Z.
Review: DISMISSED
The scanner message and negative-control test look sound. I built the PR snapshot with
ANYPS5_RELINKER_ONLY=ON, built the relinker and scanner test target, and ranctest -R ^syscall_scanner$: 1/1 passed. The #8729 author has now agreed this PR lands first, so the prior overlap blocker is resolved andDepends on: noneis accurate. I am retaining changes requested only because this branch is 2 ahead/116 behind current upstream/main4777caca34(merge base94fbb8cea). Please update to current main and rerun the focused tests and relinker matrix. Conventions, diff-check and merge-tree pass on the current head; hosted product jobs are skipped.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T09:23:21Z.
Review: CHANGES_REQUESTED
MarcZX10's CHANGES_REQUESTED (2026-10-22, on this head) is still open, and the queue will not merge past it:
Depends on: #10479; if this PR goes first, say so in the thread so the other two lists match. The code needs no change either way: whichever lands later adapts thesdkStubexpression.main. Rebase it and rerunsyscall_scannerand the relinker matrix; the scanner paths themselves have no intervening change.The change itself (
sdkStubhoisting, hint text,RequireHintfailing without the change) is fine; once the order is recorded and the branch is current this is a merge.