fix(netctl): start the library initialized, as titles find it #9459
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9459"
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 hugodearaujo on 2026-10-21T22:37:54Z.
What
Since
ea086b2374(#9137), every NetCtl call answersSCE_NET_CTL_ERROR_NOT_INITIALIZED(0x80412101) until the title callssceNetCtlInit. Titles don't call it.sceNetCtlInit, counting the main executable and the bundled modules: 007 First Light (PPSA11386), EA SPORTS FC 25 (PPSA20049), PRAGMATA (PPSA02530), LEGO Horizon Adventures (PPSA14632) and Propagation VR (PPSA15878).0x80000009, which the system has started before the title runs.int 0x42atapp.elf+0x60295runs whensceNetCtlRegisterCallbackdoesn't return 0 (#9458).The change:
g_initializedstarts true.sceNetCtlInitstill returns 0, andsceNetCtlTermstays a no-op as in the supplied module, so the NOT_INITIALIZED answers are no longer reachable.guest_net_ctlnow makes the calls before anysceNetCtlInit, as the titles do. The argument errors are as before.CheckCallbacksregisters, checks and unregisters withoutsceNetCtlInit.#8398 adds its NpToolkit functions to the same not-initialized block of
guest_net_ctl. Whichever lands second updates those three lines.Tested
maina6dcea9279it traps at 6 s.sceSystemServiceParamGetIntwith parameter 100, the second stop in #9458, which this PR doesn't change.guest_net_ctlandguest_sce_netpass.main'sg_initialized{false}, the newguest_net_ctlaborts at its first check.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pylists #8398 on the same test lines. It couldn't compare #7201, #8658 (macOS ports), #6044, #9120 and #6039, which touch the same files; none of them changes the initialization.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)sceSystemServiceParamGetIntparameter 100)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T22:40:54Z.
Review: APPROVED
Reviewed the current diff. The behavior change is limited to the initial NetCtl state, preserves validation of null arguments and callback IDs, and adds pre-init coverage for those paths; the test still exercises callback registration and dispatch. The debt entry records the title evidence and makes the remaining uncertainty about the console lifecycle explicit. I found no blocking issue in this change.
Local validation: compiled
Export.cppwithGuestNetCtl.cppand ran the focused executable successfully on Linux (using a temporary test-onlyNotImplemented_nid_no_patchimplementation for the standalone link).git diff --checkis clean. Hosted eligibility, intake, conventions, labels, and report checks pass; build jobs were skipped by path rules.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T23:44:25Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/tests/GuestNetCtl.cppL275-288Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/debt/libSceNetCtl.mdcore/libs/tests/GuestNetCtl.cppcore/libs/prx/libSceNetCtl/Export.cppImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T01:52:14Z.
@boykopovar, merging this as the fix for the boot trap in #9458. A note on why the initialization check from #9137 stays in the code but can no longer be reached:
I checked the imports of PPSA11386. None of its 5 executables (eboot.bin and the 4 bundled modules) imports
sceNetCtlInitorsceNetCtlTerm. The eboot importssceNetCtlRegisterCallback,sceNetCtlCheckCallbackandsceNetCtlGetState, and it traps when the register call doesn't return 0. A title like that only runs if the library is already initialized when it starts, so starting initialized matches what titles see. The other argument checks from #9137 are unchanged.If you'd rather remove the now-unused flag, or keep it for a future
sceNetCtlTerm, that's your call.