refactor(libSceLibcInternal): serve siginterrupt from libSceLibcInternal #10749
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10749"
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 ycbuzi on 2026-10-24T20:45:37Z.
What
Follow-up to #8872, as suggested by @harisibrar1 in its review:
siginterrupt(TsrS8nGDQok) moves from libc tolibSceLibcInternal/SignalList.cpp. On the console it is alibSceLibcInternal.sprxfunction (STT_FUNC, 128 bytes, absent from the kernel modules) that imports_sigintrandUDCI-WazohQ, which hashes from_sigaction(@mazen320's dynsym parse and Ghidra decompile on #8872, and the NID check there).libSceLibcInternallinks libkernel and already calls libkernel exports directly (utimesinFileTime.cpp,fcntlandcloseinDirectory.cpp). Sosiginterruptnow calls_sigaction_nid_postfix(UDCI-WazohQ, the import the console function uses; onmainit forwards tosigaction_nid_postfix,Signals.cpp:513-514) and sets or clears its bit in_sigintr_nid_postfixitself. The sequence is unchanged: FreeBSD 11.4lib/libc/gen/siginterrupt.c. Read the disposition, set or clear the bit withSA_RESTARTcleared or set, then install it again.EINVALfor a signal outside 1 to 128 comes from the first_sigaction, before the set is touched.This removes what #8872 needed while
siginterruptlived in libc:SigactionFn_nid_no_patchandRegisterSigaction_nid_no_patchin libc'sGeneral.hpp;Process.cpp, including the throw for a call before registration;Signals.cppthat registeredsigaction.On
mainthe relinker gives a module that importslibSceLibcInternalbothlibSceLibcInternal.prxandlibc.prx(GuestModuleBuilder.cpp:368-371), so a title'ssiginterruptimport now resolves inlibSceLibcInternal.prx. With #10706's export headers,SignalList.cpptakesGuestSigactionand_sigaction_nid_postfixfromlibkernel/include/Api.hpp, and thesiginterrupt_nid_postfixdeclaration moves fromlibc/include/Api.hpptolibSceLibcInternal/include/Api.hpp, sopublic_headersstill finds one declaration per export.guest_signal_testslinkslibSceLibcInternalandGuestSignals.cppincludes its header for the existingsiginterruptchecks. The debt entry moves fromlibc.mdtolibSceLibcInternal.md.#9001 (@Queuse, test only) merged first, as @oneandonlydean asked on this PR. Its
guest_signal_interrupt_testslinkedlibkernel libcand tooksiginterrupt_nid_postfixfrom libc'sApi.hpp. With this PR it linkslibSceLibcInternaltoo (target_link_libraries(guest_signal_interrupt_tests PRIVATE libkernel libSceLibcInternal libc)), andGuestSignalInterrupt.cppincludesprx/libSceLibcInternal/include/Api.hppnext to its libc include. Those two lines are in29c52418f2, after mergingmain.Overlap: #9499 (@EagleBearerYS) touches the same spots without changing what it does. In
Signals.cppitsRegisteredForJumpsregistration goes in the anonymous namespace whoseRegisterSignalsOnLoadthis PR removes, and inlibkernel.mditssigactionentry sits next to thesignalentry changed here. #9499 merged first after all; mergingmainhere keeps itsRegisteredForJumpsregistration in that namespace and dropsRegisterSignalsOnLoad, and keeps itssigactionentry next to this PR'ssignalentry. #10706 and #9001 landed first;mainis merged in with the header moves and the two lines above. #10615 and #10648 only touch the neighbouring lines oflibc.md.Tested
Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0, Release, head
68a0d205c0(main809c7fa2dfmerged in): 24 focused tests (thelibSceLibcInternaltests, the signal tests,guest_user_contextandguest_user_context_exit) andpublic_headers(65 tests) pass 2 of 2;tools/check_conventions.pypasses.Windows 11 Home 10.0.26200, WinLibs MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release. Head
1c060e99b9(mainefd368fec6, with #9001, #10706 and #9499, merged in):libkernel,libc,libSceLibcInternaland the test executables with no errors. The one warning ismain's existing_sigintr_nid_postfix"initialized and declared 'extern'" atSignals.cpp:24.ctest --repeat until-fail:2:guest_signal_interrupt(#9001's test),guest_signal_handler_mask(#9499's),guest_signal_sets,guest_signals, the 17 libSceLibcInternal tests andguest_user_context(22 tests) pass both runs.public_headersand its 64 compile batches (65 tests) pass.tools/check_conventions.py --base origin/mainpasses.objdump -p): onlylibSceLibcInternal.prxexportssiginterrupt_nid_postfix;libkernel.prxexports_sigaction_nid_postfixand_sigintr_nid_postfix;libc.prxhas none of them.main88795ed448(head432aed7b7b, 0 behind): the same 22 tests pass 2 of 2,public_headers(65 tests) passes,tools/check_conventions.py --base origin/mainpasses and the export tables are the same. The only warning is stillmain's_sigintr_nid_postfixone, now atSignals.cpp:26.maine0cd1259a9(head32c682c803, 0 behind; the one conflict was the neighbouringcollate<char> vtableentry indocs/dev/debt/libc.md, kept asmainhas it): the same 22 tests pass 2 of 2, the 64public_headers_compile_*batches pass,tools/check_conventions.py --base origin/mainpasses and the export tables are the same. Thepublic_headersaudit passes (368 libraries, 12811 exports) run directly, but took 120 s on this machine against the test's 90 s timeout while another build ran, so under ctest it timed out.main420b6a064e(headf430c9ec4e, 0 behind; the one conflict was #11504's removal of the_Xfilesystem_errorentry next to this one indocs/dev/debt/libSceLibcInternal.md, kept asmainhas it): the same 22 tests pass 2 of 2,public_headers(65 tests) passes,tools/check_conventions.py --base origin/mainpasses and the export tables are the same. The only warning is stillmain's_sigintr_nid_postfixone, now atSignals.cpp:30.Before #9001 merged, on
main2dc85609fc: itsGuestSignalInterrupt.cppatb5e40d1d3e(all four set words, extreme flags, errno, neighbouring bits, thesignalinterplay, invalid signals) passed both runs on this branch withlibSceLibcInternaladded to its link line, and linked aslibkernel libcit failed with undefined references.libSceLibcInternal.prximports_sigaction_nid_postfixand_sigintr_nid_postfixfromlibkernel.prx.Not tested: Linux, macOS, a title.
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 MarcZX10 on 2026-10-24T20:48:26Z.
Review: CHANGES_REQUESTED
I reviewed the relocation and the reported Windows coverage. The console evidence and the sequence match the stated FreeBSD implementation; the layout assertions and use of
_sigactionbefore indexing the signal set are useful safeguards. I have not run the PR's Windows tests locally; the focused Windows results inTestedare author-reported, and hosted product jobs are currently skipped.There are two unresolved integration points that affect the build/test result:
libkernelandlibc. Once this PR removessiginterruptfromlibc, that test cannot link until its target also linkslibSceLibcInternal. The PR description notes this, but there is no confirmed order with #9001's author, and the checklist still saysDepends on: none. Please coordinate the target-link change with that author and record the agreed order/dependency in both PR descriptions.git merge-treeon the current heads of this PR and #9499. The combined result has content conflicts incore/libs/prx/libkernel/System/src/Signals.cppanddocs/dev/debt/libkernel.md. The described resolution appears possible (retainRegisteredForJumps, omit the obsolete sigaction-registration initializer, and retain both debt updates), but the heads do not merge as-is. Please confirm the order/resolution with #9499's author and record it in the checklist before this can be approved.The implementation may be correct independently, but the known open test and code conflicts need an agreed integration path. The relinker/product matrix is still running, so I will recheck it after these coordination points are resolved.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:19:35Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
32c682c803c4a11bd4d137c95f77e2e723f9911bagainst currentmainf99d7fece316e31878f0195f8bbc2ad2fbe635e4.The earlier overlap items are resolved: #9001 and #9499 are merged, and #11504 now declares
Depends on: #10749. The current-main merge preview is clean;git diff --checkandtools/check_conventions.pypass against current main. I found no new issue in the relocation itself.I cannot clear the review yet because the tested tree is still based on
e0cd1259a9, while currentmainhas moved substantially and changed the relatedlibkernel/System/src/Signals.cppinitialization and signal-debt entries. Please sync this branch to currentmainand rerun the focused signal tests, public-header/export checks, and conventions on that integrated head. The current hosted Windows relinker matrix also has one redshader_cache_native_pathstimeout (368/369 passed); it is unrelated by path, but remains a failed check. Please obtain a green rerun on the updated head.The author-reported Windows/macOS results on the prior integrated heads are useful, but I did not run a local product build or tests. Product Linux CI is skipped. My existing changes-requested review remains for current-main validation and the failed hosted check.