Repository navigation
Conversation
|
Independent Linux check at exact head The relinker-only suite passes 165/165 (28.88 s), and the real production getter returns the proposed default block in a separate native probe. There is a gap in the new regression, though: it remains green with the runtime fix removed, and also with a null default pointer in its own provider. Controls, rebuilt and run with
The size mutation confirms the fixture ran and rebuilt. The two false greens have separate causes: This small test-only change catches the null pointer and also checks --- a/core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp
+++ b/core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp
@@ -48,9 +48,10 @@
std::snprintf(line, sizeof(line), "args=%016zx argp=%016zx\n", args,
static_cast<std::size_t>(reinterpret_cast<std::uintptr_t>(argp)));
Write(line);
- if (args == sizeof(DefaultModuleArgs) && argp == &kDefaultArgs) {
+ if (args == sizeof(DefaultModuleArgs)) {
+ if (argp == nullptr) Fail("Missing default argument block");
const auto* defaultArgs = static_cast<const DefaultModuleArgs*>(argp);
- if (defaultArgs->size != 0x10 || defaultArgs->version != 0x200) Fail("Default arguments corruption");
+ if (defaultArgs->size != 0x10 || defaultArgs->version != 0x200 || defaultArgs->context != nullptr) Fail("Default arguments corruption");
}
}
It still needs a regression that calls the real runtime getter. I checked that independently without the full SDL build: compile the actual All temporary source edits were restored, the stock provider rebuilt, and |
jotitadev
left a comment
There was a problem hiding this comment.
macOS run of the new --load-default path, which has its own darwin branch (RTLD_GLOBAL) that the Linux runs don't cover.
Machine: Apple M2 Max, macOS 27.2, Xcode 27 toolchain, relinker-only Release.
Head: 950bc7c32, merged onto main @ ab9a47684 (clean).
The test only executes natively on macOS when the interpreter is x86_64 (platform.machine() == 'x86_64'). Under ctest on Apple silicon, both the arm64 build and the x86_64 build print native execution skipped, because /usr/bin/python3 starts as arm64. So I ran it by hand from the x86_64 build:
arch -x86_64 /usr/bin/python3 core/relinker/relinker/tests/test_guest_module_args.py <build>/core/relinker/relinker <build>/core/relinker/guest_module_args_host.prx
| Change | Result (x86_64 under Rosetta, Python 3.9.6) |
|---|---|
| None | pass |
Fixture provider GuestModuleArgsHost.cpp restored from main |
fail: args=0000000000000000 argp=0000000000000000 |
--load-default with DEFAULT_MODE instead of RTLD_GLOBAL |
fail: dlopen(...): symbol not found in flat namespace '_RecordArgs' |
So the darwin branch works and the RTLD_GLOBAL is required there. As @simonbbby showed on Linux, what the test checks is the fixture's own provider, not the production __aps5_get_pending_module_args_nid_no_patch in Module.cpp. That is the same on macOS: Module.cpp is not part of the relinker-only build.
Full relinker-only suite with the PR: arm64 163/163; x86_64 + Python 3.9.6 159/163, with the same 4 failures as main.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Thanks @jotitadev and @simonbbby for the thorough independent validation on macOS and Linux! Carried the suggested mutation control in commit
Verified locally with a negative mutation control (setting Written with AI assistance (Gemini). |
|
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.
|
|
Correction: In the previous review (at head OK Findings
Freshness Envelope
Cross-PR Ledger
|
|
We hit the same problem while running Sonic Superstars (PPSA06888) on Linux, and this PR's default argument block fixes it. What we saw without it: a guest module started through The code we tested was a smaller version of the same idea (a zeroed block returned from Two things we observed that may matter for this PR:
If it helps, we can test a rebased version of this PR against the title on our side. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The reviewed changes look consistent with the stated behavior, but I could not run the reported checks in this session, so a formal approval is not justified.
What I ran
Reviewed head a407a5ef836405798b7e248b876acd66aa3f39e7. I read every changed line in all 8 changed files using the review reader; no checks were run in this session.
Results
| Check | Result | Note |
|---|---|---|
| Diff review | passed | All changed lines read |
| Reported Linux tests | not run | Reported as passing by the author |
| Convention check | not run | Reported as passing by the author |
| Console behavior | not run | Commercial title not tested |
Negative control
Not run in this session. The description reports two negative controls that were verified and reverted.
Findings
Blocking
None.
Non-blocking
None.
Sources
Reviewed core/libs/prx/libkernel/CMakeLists.txt, core/libs/prx/libkernel/Module/ModuleArgs.hpp, core/libs/prx/libkernel/Module/src/Module.cpp, core/libs/prx/libkernel/Module/src/ModuleArgs.cpp, core/relinker/CMakeLists.txt, core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp, core/relinker/relinker/tests/test_guest_module_args.py, and docs/dev/debt/libkernel.md at the pinned head. All were included in the review folder and their changed lines were read.
Not verified
The author-reported test and convention command results were not independently confirmed. Commercial title and console behavior remain unverified.
To get this to a good state
Nothing is required. Optional: independently run the reported Linux tests and convention check before merge.
What
core/libs/prx/libkernel/Module/src/ModuleArgs.cppandModuleArgs.hpp(SetPendingModuleArgs_nid_no_patch,GetPendingModuleInitResult_nid_no_patch,SetModuleInitResultObserverForTest_nid_no_patch) and link it into bothlibkernelandguest_module_args_hostso the relinker test exercises the production implementation directly.sceKernelLoadStartModulecall is active viathread_local bool explicitLoadInProgress(with exception-safe reset arounddlopen_nid_postfixinModule.cpp), preserving explicit(args, nullptr)pairs whenexplicitLoadInProgressistrueand returning a 16-byte default block{size: 0x10, version: 0x200, context: nullptr}(args = 16) only whenexplicitLoadInProgressisfalse.docs/dev/debt/libkernel.md: what the console passes outsidesceKernelLoadStartModuleor toDT_NEEDEDdependencies pulled in duringsceKernelLoadStartModule, that{0x10, 0x200}is a guess from Linux: Cult of the Lamb (PPSA06464) faults at process start in UnifyPS5Plugin.prx, a needed library started with a null arguments block #5621 whilecontextis unknown (nullptrfaults if called during init), and thatexplicitLoadInProgressremainstrueacrossdlopen_nid_postfix.Tested
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON), rebased onmain(474030e584): builtrelinkerandguest_module_args_hostand ranctest --test-dir build-relinker -R "guest_module_args|guest_deferred_dependencies" --output-on-failure -V(2/2 passed:load_and_record,load_and_record_default,load_and_record_explicit_null, andguest_deferred_dependencies).SceKernelDefaultModuleArgs::versionto0x201inModuleArgs.hppfailsguest_module_argswithGuest module argument fixture: Default arguments corruption.kEmptyPendingArgswhenpendingModuleArgs.argp == nullptrinModuleArgs.cppfailsload_and_record_explicit_nullinguest_module_args.python3 tools/check_conventions.py --base upstream/mainpasses with 0 warnings and 0 errors.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)