fix(libkernel): pass module arguments to loaded modules #4972
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4972"
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 ducloc080202 on 2026-10-13T06:57:44Z.
What
Rebases #4296 (closed unmerged) onto current
mainand resolves thedocs/dev/TechnicalDebt.mdconflict by keepingmain's split debt files.SceKernelLoadStartModulenow remembers the first module-arguments block whose pointer does not lie on the calling thread's stack, and passes it to zero-argument module loads. Without this, modules that read their plugin arguments (e.g. Unity'sPSN.prxversion check) see garbage and can crash during startup: Cat Quest III (PPSA15065) crashed 4/4 boots inPSN.prxbefore this change.Tested
*module*ctests pass, includingguest_module_args(the new test from this change builds and runs on Linux/macOS CI; theNOT_WIN32guard is unchanged).0xc0000005inPSN.prx.guest.prxafter the "old version" error; after — boots past engine init and loads all 454 asset bundles to the loading screen. Linux/macOS rely on CI.Checklist
main; no other open PR implements the same functions (#4296 is closed)NotImplemented_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 xXPBSXx on 2026-10-13T08:20:45Z.
Windows build check of this PR.
Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
BUILD_TESTING=ON,-j2,libusb-cmakefrom a local checkout. Built frommainc2565f014with this PR and ten other open PRs (#4972, #4967, #4966, #4945, #4938, #4936, #4933, #4898, #4896, #4888) merged together; the merges had no conflict.Result: the merged tree builds, but no test of this PR runs on Windows: its tests (
guest_load_start_module_args) are registered only for non-Windows builds inlibkernel/CMakeLists.txt(if(NOT WIN32)).Not checked: any behaviour of the change on Windows; no title run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T06:19:00Z.
ResolveModuleArgs(Module.cpp) gives a load with no arguments the first arguments block an earlier load passed, picked by whether its pointer is on the caller's stack. That's a guess rather than what the kernel does, and it isn't allowed here. What does the console handmodule_startwhensceKernelLoadStartModulegetsargs == 0? IfPSN.prxreads its arguments from somewhere else (the loading module's own arguments, for example), model that and throw on anything else.The branch also has a merge commit; please rebase onto main.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T21:33:11Z.
Any news on the 10-14 point?
ResolveModuleArgshands a load withargs == 0an earlier load's arguments block, which is a guess rather than what the kernel does. What does the console pass tomodule_startin that case? Model that and throw on anything else, and please rebase onto main without the merge commit.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:07:12Z.
Some 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.
core/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/Module/src/Module.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T04:52:34Z.
Thanks for this. Since the questions from 14 Oct are still open and it has gone quiet, I'm closing it for now to keep the queue current. Please reopen it once you've had a chance to address them, and we'll pick it up.
Pull request closed