fix(libSceLibcInternal): export sigvec through shared runtime #10953
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10953"
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 AZLisme on 2026-10-25T11:20:37Z.
What
Implement native
libSceLibcInternalsigvec(yhxKO9LYc8A) and preserve libc compatibility. Each patched module owns its public NID and calls one unique private libc conversion core with shared sigaction registration state. Distinct existing host aliases avoid the libc preserve-export-list collision without changing patcher policy or forwarding through the public NID. One canonical shared header supplies the 16-byte vector ABI and typed declarations.Conversion retains the low mask word, flags XOR 2, null combinations, input/output aliasing and forwarded results. Complete previous-vector HostWrite is checked before backend mutation; rejection returns EFAULT without partial output or disposition changes. Missing backend registration throws runtime_error. Independent kernel registration keeps #10749's siginterrupt ownership separate.
Credit BunnyFl's firmware 13.42 report for identifying Internal as the native owner and checking ABI/conversion by executing firmware code under an emulator with recording imports. This was not a physical-console measurement. The source contract follows pinned FreeBSD 11.4 sigcompat.c; inherited signal-backend gaps remain in debt.
The standalone native fixture loads the actual patched modules without guest-runtime startup links, checks module ownership and cold registration, then loads its exception probe. The mixed-ABI source has final no-exceptions/no-asynchronous-unwind options, while utility sources retain native MinGW unwind tables/static runtimes. Windows images are explicitly pinned until process exit while original LoadLibrary references still receive FreeLibrary. Separate child processes retain both cold load orders. Explicit DLL unloading remains outside the fixture; the earlier unload crash's cause is unknown.
Rebased as
581d45c28237onto mainaebeaa53f54d. The final implementation, canonical ABI, positional CMake wrapper and fixtures are preserved. The debt conflict retains upstreamfrexpfand the remaining SIG gaps;sigblock/sigsetmaskremain deferred.Tested
2026-11-01 UTC manual review of four overlap leads (source only)
Reviewed these frozen foreign heads against this PR's
e7725d7111d0aaa2cc04729dae0a5be9ab485ce8, using its authored delta from26fa1212b82f76dd49cf12d65e445d6ff3e0844cand each foreign topic's actual authored merge-base. Inherited main changes were excluded from topic comparisons.79b02b3bdbb4301d6f7638d8026b4374b7e22803pwriteuses the existing shared POSIX provider; its NIDC2kJ-byS5rMdiffers fromsigvec. Shared kernel CMake edits split Windows named-memory tests, separate from SIG production registration.fe748d4f48743f437bb180bc0f3731a4a07fbe3asigvec.e908061e3243c54655215bec7d156276baa4cb6casctime_rhas distinct NID488p6whx47U; shared libc API/debt edits commute with the SIG edits on the pinned own parent, preserving SIG declarations and debt.f9474c5040b453603ae1a07668607e022812363b_execve/_execvpeexports have distinct NIDs; the shared process provider is unchanged. Kernel CMake changes exec tests, separate from SIG production registration.No current owned export/new-file collision, source fix, rebase or new dependency is supported by these exact inputs. Future shared CMake/API/debt integration must preserve both topics and inherited entries. For #9019, complete raw CMake/debt hunks have inherited context mismatches; exact-span preservation and selected-hunk commutation are bounded source checks, not a full Git union. Foreign
mergeable=falseand the bot's later-main compare link establish no owned conflict or rebase requirement. Future foreign head changes require fresh review.No new tests, builds or branch changes occurred. This review adds no full composition, current-main, runtime or native qualification. Existing CI/review/integration requirements, SDK/native ABI, default SIGPIPE, context behavior, module-order and unload holds remain; all earlier results retain their stated scope.
2026-11-01 Windows CI: run 41295117301,
e7725d7111d0aaa2cc04729dae0a5be9ab485ce8+ main26fa1212b82f76dd49cf12d65e445d6ff3e0844c: 1,679 selected CTests passed, 904 skipped, zero failed.guest_sigvecandguest_signalspassed;guest_sigvec_modulescompiled but did not run. Separate matrix jobs passed 549 Linux/552 Windows relinker cases, 34 ASan TLS cases and 25 macOS write-watch cases repeated three times. Windows general full-suite, skip-audit and header CTests were not run. Native context, module/unload and existing dependency gates remain.2026-11-01: preserving rebase
e7725d7111d0aaa2cc04729dae0a5be9ab485ce8onto fixed main26fa1212b82f76dd49cf12d65e445d6ff3e0844c. Linux GCC 16.2.1 Release: baseline 61 plain + 4 logging-enabled runtime CTests; private SIG-plus-six-ICU union4908848dab02fb1f0a9fad7e9525ddb8a628177a71 + 6. All passed, with 65 public-header tests per side. Relevant:guest_sigvec,guest_sigvec_modules. Scope is this fixed baseline/private composition; bare heads, later main, Windows, native ABI and unloading remain unqualified. Earlier results retain their original scope.Fresh fixed-main Linux validation on
0362b1521c4eand private SIG+all-six-ICU composition8a5c8c499f0e: baseline passed 53 plain runtime CTests, four with logging enabled and 65 public-header checks; composition passed 63, six and 65 respectively, with zero failures, skips or NotRun cases. Both SIG fixtures passed plain and with logging enabled, including both requested native module-open orders. The published head remains581d45c28237. This qualifies selected cases on that fixed private composition; full CI, later main, Windows/macOS, native signal context and provider unload remain outside this new run.Native Windows: ycbuzi reports current head
581d45c282merged cleanly with mainc547deaacb(reported mergefa54b0eba1), Windows 11 Home 10.0.26200 / WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release,BUILD_TESTING=ON. The seven named targets (libc,libkernel,libSceLibcInternal,nid_patcher,sigvec_modules_exceptions,guest_sigvec_tests,guest_sigvec_modules_tests) built, and bothguest_sigvecandguest_sigvec_modulespassed two repetitions withctest --repeat until-fail:2. This is attributed focused contributor validation, not local reproduction or full maintainer CI. No negative control, full-suite, five-PR-union, macOS or title run was reported.Fresh normal-root Linux Release build at
581d45c28237/ baseaebeaa53f54d: all 68 selected CTests passed with zero failures or skips:guest_sigvec,guest_sigvec_modules,guest_exit_orderand 65 public-header checks. Both Internal-first and libc-first child processes passed module ownership, shared conversion/callback state, exception and guest-output assertions. Independent source, build-input, artifact and runtime review passed.Conventions and whitespace checks passed. Static integration with current main
801d5b9bc110is clean; that later-main union was not run.Earlier maintainer Linux/Windows CI applies to the ordered five-PR union (#10953, #11137, #10995, #11165 and #11219) containing
e0382c66298eon mainb986c11a344e. Earlier native Windows contributor results apply tob397eedc42with main2cce8bc51d: Windows 11, WinLibs GCC 15.2.0 r7, Release, both SIG fixtures passed three repetitions. These results remain historical. Current-head full maintainer CI remains pending; focused Windows contributor validation is recorded above. No title, physical PS5 or macOS run is claimed.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-25T11:54:22Z.
Review: CHANGES_REQUESTED
Requesting changes for the open integration conflict. The
sigvecconversion itself matches the pinned FreeBSD compat-43 path, and the focused tests cover flag/mask round-trips, aliasing, invalid input and missing registration. However, I rangit merge-treebetween the current #10953 head and open #10749; it reports a content conflict incore/libs/prx/libkernel/System/src/Signals.cpp. If #10749 lands first, its removal/move of theRegisterSignalsOnLoadcallback setup can also drop this PR'sRegisterSigvec_nid_no_patchregistration unless that is explicitly carried into the new owner path.The PR description anticipates preserving that callback, but I could not find an agreed merge order with #10749's author. Please coordinate the order/resolution with that author and record the result (and any needed
Depends onentry) before approval. The submitted Linux checks pass; this is specifically about maintaining a buildable and registered integration after the shared-file conflict is resolved.Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T12:07:20Z.
Review: COMMENTED
Checked head
fa4e8f1698femerged onto maina5a780eaaa7f(clean merge). Linux, GCC 13.3, Release.What I ran:
guest_sigvec_tests,guest_signal_tests,guest_signal_set_tests;ctest -R '^(guest_sigvec|guest_signals|guest_signal_sets)$'is 3/3 green^ 2on install makesguest_sigvecfail with "legacy interrupt flag reverses restart flag", so the flag loop really catches a wrong conversionLegacySignals.cppagainst FreeBSD 11.4lib/libc/compat-43/sigcompat.csigvec()line by line: same^ SV_INTERRUPTboth ways, empty mask plus low word on install,osvwritten only whenret == 0, nullsv/osvpassed through. Convertingsvbefore the call also keeps the aliased case rightcompute_nid("sigvec")fromtools/nid_names.pygivesyhxKO9LYc8AOne thing to change: the progress report counts
sigvecas a stub (libc 1340/1351 -> 1340/1352 in the bot comment above).tools/progress.pymarks anyAPS5_VABIbody that callsNotImplemented_nid_no_patchas todo, and the missing-backend guard does that.siginterrupthandles the same missing registration with a plain throw (Process.cpp:309), which counts as done. Withprogress.py --module libcgives 1341 done / 11 todo withsigvecdone, andguest_sigvecstill passes (NotImplemented_nid_no_patchthrowsstd::runtime_errortoo, so theMissingBackendcatch is unchanged).Not checked: which PS5 module exports
sigvec(no dump here), Windows/macOS. The #10749 ordering question in the earlier review still stands; I didn't look into that part.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T12:15:15Z.
Review: CHANGES_REQUESTED
I found one guest-memory output path that needs guarding before this is ready. When
previousis non-null,sigvec_nid_postfixwriteshandler,mask, andflagsdirectly into that caller buffer after the forwardedsigactioncall. Ifpreviouspoints into GuestArena-backed memory, these stores bypass theGuestArena::HostWritebookkeeping used to notify shared backing/write-watch and do not handle a rejected read-only Windows mapping. Please open a writable scope for the fullGuestSignalVectoroutput before mutating it and handleOpen()failure without partially writing the result; add a guest-backed or read-only-view regression if the harness supports it. The current test uses stackGuestSignalVectorobjects, so it does not exercise that path. I checked the frozen-head diff withgit diff --checkandpython3 tools/check_conventions.py --base upstream/main --head refs/pr/10953; both pass. The hosted eligibility, intake, conventions, labels and report checks pass; hosted product builds are skipped. The 5/5 Linux CTests in the PR description are author-reported, not independently rerun here, and PS5/Windows/macOS behavior remains unverified.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T13:27:02Z.
Review: APPROVED
Reviewed exact updated head
9a8104e0296bf7d7f882b99f5749744557298fe7. The previous-vector buffer is guarded across its full range before calling the forwardedsigaction, so a rejected guest write returns-1/EFAULTwithout changing the disposition or partially updating the vector. Guest-backed tests cover cross-page output, input/output aliasing, canaries, and Windows read-only rejection. The missing backend now throws an ordinary runtime error, so progress no longer classifies this implementation as a stub.The registration setup was moved to a separate kernel translation unit; the author reports
git merge-treeis clean with #10749 and a combined libc/kernel/Internal build with 5/5 focused tests, including the relocatedsiginterruptregistration. I independently ranpython3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --check upstream/main...HEAD; both pass. Windows rejection cases are present but not reported as executed, and broad hosted product jobs are skipped. The previously raised guest-output and integration-conflict issues are addressed.