Skip to content

fix(libkernel): pass module arguments to loaded modules - #4972

Closed
ducloc080202 wants to merge 4 commits into
boykopovar:mainfrom
ducloc080202:fix/cq3-module-args
Closed

ducloc080202 wants to merge 4 commits into
boykopovar:mainfrom
ducloc080202:fix/cq3-module-args

Conversation

@ducloc080202

Copy link
Copy Markdown
Contributor

What

Rebases #4296 (closed unmerged) onto current main and resolves the docs/dev/TechnicalDebt.md conflict by keeping main's split debt files.

SceKernelLoadStartModule now 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's PSN.prx version check) see garbage and can crash during startup: Cat Quest III (PPSA15065) crashed 4/4 boots in PSN.prx before this change.

Tested

  • Windows (MinGW 15.2.0, Release): full build passes; all 16 *module* ctests pass, including guest_module_args (the new test from this change builds and runs on Linux/macOS CI; the NOT_WIN32 guard is unchanged).
  • Cat Quest III (PPSA15065), Windows: before — deterministic early 0xc0000005 in PSN.prx.guest.prx after 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

eliyarson and others added 4 commits October 12, 2026 01:23
… the calling thread's stack

The block is still passed to its own load. The test covers a stack block followed by a zero-argument load, then a heap block recorded as before.
This was referenced Oct 13, 2026
@xXPBSXx

xXPBSXx commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Windows build check of this PR.

Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, BUILD_TESTING=ON, -j2, libusb-cmake from a local checkout. Built from main c2565f014 with 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 in libkernel/CMakeLists.txt (if(NOT WIN32)).

Not checked: any behaviour of the change on Windows; no title run.

AI-assisted (Claude Code).

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 4563 core/libs/prx/libkernel/CMakeLists.txt
PR 5021 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Module/src/Module.cpp
PR 6044 core/libs/prx/libkernel/CMakeLists.txt
PR 6149 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6226 core/libs/prx/libkernel/CMakeLists.txt
PR 6469 core/libs/prx/libkernel/CMakeLists.txt
PR 6519 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6586 core/libs/prx/libkernel/CMakeLists.txt
PR 6830 core/libs/prx/libkernel/CMakeLists.txt
PR 6879 core/libs/prx/libkernel/Module/src/Module.cpp
PR 6893 core/libs/prx/libkernel/CMakeLists.txt
PR 6936 core/libs/prx/libkernel/CMakeLists.txt
PR 6977 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Module/src/Module.cpp
PR 7090 core/libs/prx/libkernel/CMakeLists.txt
PR 7156 core/libs/prx/libkernel/CMakeLists.txt
PR 7192 core/libs/prx/libkernel/CMakeLists.txt
PR 7201 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Module/src/Module.cpp
PR 7299 core/libs/prx/libkernel/CMakeLists.txt
PR 7450 core/libs/prx/libkernel/CMakeLists.txt
PR 7532 core/libs/prx/libkernel/CMakeLists.txt
PR 7853 core/libs/prx/libkernel/CMakeLists.txt
PR 8041 core/libs/prx/libkernel/CMakeLists.txt
PR 8463 core/libs/prx/libkernel/CMakeLists.txt
PR 8477 core/libs/prx/libkernel/CMakeLists.txt
PR 8487 core/libs/prx/libkernel/CMakeLists.txt
PR 8520 core/libs/prx/libkernel/CMakeLists.txt
PR 8626 core/libs/prx/libkernel/CMakeLists.txt
PR 8658 core/libs/prx/libkernel/CMakeLists.txt
PR 8700 core/libs/prx/libkernel/CMakeLists.txt
PR 8717 core/libs/prx/libkernel/CMakeLists.txt
PR 8726 core/libs/prx/libkernel/CMakeLists.txt
PR 8850 core/libs/prx/libkernel/CMakeLists.txt

This was referenced Oct 15, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build libkernel needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants