fix(libkernel): provide default arguments block for DT_INIT on Linux #6149

Open
Nubi-Prey wants to merge 1 commit from upstream-pr/6149 into main
Nubi-Prey commented 2026-10-14 23:33:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nubi-Prey on 2026-10-14T23:33:36Z.


What

  • Extract pending guest module argument state into core/libs/prx/libkernel/Module/src/ModuleArgs.cpp and ModuleArgs.hpp (SetPendingModuleArgs_nid_no_patch, GetPendingModuleInitResult_nid_no_patch, SetModuleInitResultObserverForTest_nid_no_patch) and link it into both libkernel and guest_module_args_host so the relinker test exercises the production implementation directly.
  • Track whether an explicit sceKernelLoadStartModule call is active via thread_local bool explicitLoadInProgress (with exception-safe reset around dlopen_nid_postfix in Module.cpp), preserving explicit (args, nullptr) pairs when explicitLoadInProgress is true and returning a 16-byte default block {size: 0x10, version: 0x200, context: nullptr} (args = 16) only when explicitLoadInProgress is false.
  • Document the unmeasured console semantics in docs/dev/debt/libkernel.md: what the console passes outside sceKernelLoadStartModule or to DT_NEEDED dependencies pulled in during sceKernelLoadStartModule, that {0x10, 0x200} is a guess from #5621 while context is unknown (nullptr faults if called during init), and that explicitLoadInProgress remains true across dlopen_nid_postfix.

Tested

  • Linux x86_64 (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON), rebased on main (474030e584): built relinker and guest_module_args_host and ran ctest --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, and guest_deferred_dependencies).
  • Negative controls verified and reverted:
    1. Mutating SceKernelDefaultModuleArgs::version to 0x201 in ModuleArgs.hpp fails guest_module_args with Guest module argument fixture: Default arguments corruption.
    2. Falling back to kEmptyPendingArgs when pendingModuleArgs.argp == nullptr in ModuleArgs.cpp fails load_and_record_explicit_null in guest_module_args.
  • python3 tools/check_conventions.py --base upstream/main passes with 0 warnings and 0 errors.
  • Not tested with a commercial title in this environment.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Gemini 4 Argon)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4865974122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149). Originally posted by [Nubi-Prey](https://github.com/Nubi-Prey) on 2026-10-14T23:33:36Z. --- ### What - Extract pending guest module argument state into `core/libs/prx/libkernel/Module/src/ModuleArgs.cpp` and `ModuleArgs.hpp` (`SetPendingModuleArgs_nid_no_patch`, `GetPendingModuleInitResult_nid_no_patch`, `SetModuleInitResultObserverForTest_nid_no_patch`) and link it into both `libkernel` and `guest_module_args_host` so the relinker test exercises the production implementation directly. - Track whether an explicit `sceKernelLoadStartModule` call is active via `thread_local bool explicitLoadInProgress` (with exception-safe reset around `dlopen_nid_postfix` in `Module.cpp`), preserving explicit `(args, nullptr)` pairs when `explicitLoadInProgress` is `true` and returning a 16-byte default block `{size: 0x10, version: 0x200, context: nullptr}` (`args = 16`) only when `explicitLoadInProgress` is `false`. - Document the unmeasured console semantics in `docs/dev/debt/libkernel.md`: what the console passes outside `sceKernelLoadStartModule` or to `DT_NEEDED` dependencies pulled in during `sceKernelLoadStartModule`, that `{0x10, 0x200}` is a guess from #5621 while `context` is unknown (`nullptr` faults if called during init), and that `explicitLoadInProgress` remains `true` across `dlopen_nid_postfix`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Linux x86_64 (`-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON`), rebased on `main` (`474030e584`): built `relinker` and `guest_module_args_host` and ran `ctest --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`, and `guest_deferred_dependencies`). - Negative controls verified and reverted: 1. Mutating `SceKernelDefaultModuleArgs::version` to `0x201` in `ModuleArgs.hpp` fails `guest_module_args` with `Guest module argument fixture: Default arguments corruption`. 2. Falling back to `kEmptyPendingArgs` when `pendingModuleArgs.argp == nullptr` in `ModuleArgs.cpp` fails `load_and_record_explicit_null` in `guest_module_args`. - `python3 tools/check_conventions.py --base upstream/main` passes with 0 warnings and 0 errors. - Not tested with a commercial title in this environment. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes (Gemini 4 Argon) <!-- yes / no -->
simonbbby commented 2026-10-15 00:24:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T00:24:26Z.


Independent Linux check at exact head 950bc7c323a44bac2f83781e57d968cf016e932f (Ubuntu 24.04 / Ryzen 9 9950X / GCC 13.3 / Ninja Release).

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 ctest -R '^guest_module_args$' -V:

Change from the stated head Result
None pass
Restore only production Module.cpp from this head's parent pass
Provider kEmptyPending{sizeof(kDefaultArgs), nullptr} pass
Provider kEmptyPending{8, &kDefaultArgs} fail: the Python size assertion
Null-pointer provider plus the assertion change below fail: Missing default argument block
Correct provider plus the assertion change below pass

The size mutation confirms the fixture ran and rebuilt. The two false greens have separate causes: guest_module_args_host.prx supplies its own __aps5_get_pending_module_args_nid_no_patch, so it never calls the changed production helper; and RecordArgs checks the payload only if argp == &kDefaultArgs. A null pointer skips that check, while Python asserts the size and initializer result but not the pointer. The fixture's initializer only calls RecordArgs, so it does not dereference the null pointer as the reported Unity initializer does.

This small test-only change catches the null pointer and also checks context:

--- 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 core/libs/prx/libkernel/Module/src/Module.cpp with -std=c++20 -O2 -ffunction-sections -fdata-sections -Icore/libs, then link a small getter probe with -Wl,--gc-sections to discard unrelated unused runtime functions. The probe casts the getter result to PendingModuleArgs, requires args == 16 and non-null argp, then checks the payload's size 0x10, version 0x200 and null context. The PR production object passes; its parent's production object exits 1 with a missing/null default block. This links the actual compiled helper, rather than a replacement getter.

All temporary source edits were restored, the stock provider rebuilt, and guest_module_args passes again with a clean checkout. No title run, full-runtime load, or claim that this default block matches console behavior.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181479535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6181479535). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T00:24:26Z. --- Independent Linux check at exact head **`950bc7c323a44bac2f83781e57d968cf016e932f`** (Ubuntu 24.04 / Ryzen 9 9950X / GCC 13.3 / Ninja Release). 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 `ctest -R '^guest_module_args$' -V`: | Change from the stated head | Result | |---|---| | None | pass | | Restore only production `Module.cpp` from this head's parent | **pass** | | Provider `kEmptyPending{sizeof(kDefaultArgs), nullptr}` | **pass** | | Provider `kEmptyPending{8, &kDefaultArgs}` | fail: the Python size assertion | | Null-pointer provider plus the assertion change below | fail: `Missing default argument block` | | Correct provider plus the assertion change below | pass | The size mutation confirms the fixture ran and rebuilt. The two false greens have separate causes: `guest_module_args_host.prx` supplies its own `__aps5_get_pending_module_args_nid_no_patch`, so it never calls the changed production helper; and `RecordArgs` checks the payload only if `argp == &kDefaultArgs`. A null pointer skips that check, while Python asserts the size and initializer result but not the pointer. The fixture's initializer only calls `RecordArgs`, so it does not dereference the null pointer as the reported Unity initializer does. This small test-only change catches the null pointer and also checks `context`: ```diff --- 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 `core/libs/prx/libkernel/Module/src/Module.cpp` with `-std=c++20 -O2 -ffunction-sections -fdata-sections -Icore/libs`, then link a small getter probe with `-Wl,--gc-sections` to discard unrelated unused runtime functions. The probe casts the getter result to `PendingModuleArgs`, requires `args == 16` and non-null `argp`, then checks the payload's size `0x10`, version `0x200` and null context. **The PR production object passes; its parent's production object exits 1 with a missing/null default block.** This links the actual compiled helper, rather than a replacement getter. All temporary source edits were restored, the stock provider rebuilt, and `guest_module_args` passes again with a clean checkout. No title run, full-runtime load, or claim that this default block matches console behavior.
jotitadev commented 2026-10-15 00:31:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T00:31:45Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5526480448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#pullrequestreview-5526480448). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-15T00:31:45Z. **Review:** COMMENTED --- 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.
Nubi-Prey commented 2026-10-15 01:01:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nubi-Prey on 2026-10-15T01:01:28Z.


Thanks @jotitadev and @simonbbby for the thorough independent validation on macOS and Linux!

Carried the suggested mutation control in commit 20e36060f:

  • In GuestModuleArgsHost.cpp: fail with "Missing default argument block" if argp == nullptr when args == sizeof(DefaultModuleArgs), and check context == nullptr.
  • In test_guest_module_args.py: assert that the recorded argp is not null.

Verified locally with a negative mutation control (setting nullptr fails CTest immediately with the expected error) and all 165 CTests and conventions pass on a clean checkout.

Written with AI assistance (Gemini).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181944512 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6181944512). Originally posted by [Nubi-Prey](https://github.com/Nubi-Prey) on 2026-10-15T01:01:28Z. --- Thanks @jotitadev and @simonbbby for the thorough independent validation on macOS and Linux! Carried the suggested mutation control in commit `20e36060f`: - In `GuestModuleArgsHost.cpp`: fail with `"Missing default argument block"` if `argp == nullptr` when `args == sizeof(DefaultModuleArgs)`, and check `context == nullptr`. - In `test_guest_module_args.py`: assert that the recorded `argp` is not null. Verified locally with a negative mutation control (setting `nullptr` fails CTest immediately with the expected error) and all 165 CTests and conventions pass on a clean checkout. Written with AI assistance (Gemini).
JJenkx commented 2026-10-15 20:43:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-15T20:43:34Z.


Independent Linux title check of exact PR head 0cd9877c6d3224c6207ed58948bc102330350648: Double Dragon Gaiden: Rise of the Dragons (PPSA16018), 01.000.013 is not unblocked by the fallback alone.

Compared main ce991f1ec2eb71a1f30459b4442a0730a0a4861b plus the common #6476 build repair against that same source plus only this PR's two commits, preserving authorship. Full libs and relinker builds pass. The rebuilt guest_module_args CTest passes (0.14 s). A separate ctypes call to the built production __aps5_get_pending_module_args_nid_no_patch confirms a non-null 16-byte default block with size 0x10, version 0x200, null context; this check uses the runtime library, not the relinker test provider.

Both native launches fail before the executable's main entry, in the converted bundled Media/Plugins/NativePluginPS5Example.prx:

Source First debugger fault, relative to the module's executable mapping Observed operation
main + common build repair +0x23a Argument/version checker reads through a null argument pointer.
same + this PR +0x3a9 Version check has passed; module startup reads the vtable through a null context pointer, immediately before a method call.

The first check accepts {size=0x10, version=0x200} and saves the pointer at block +8. The second crash follows its use. Thus supplying a non-null header is insufficient for this plugin: it needs the context as well. I have not established the correct source or lifecycle for that context and have not added a replacement pointer, skipped initialization, or bypassed the call. This is additional title scope, not a rerun of the Cult of the Lamb result.

Environment: Arch Linux 7.2.9-arch1-1, GCC 16.2.1, Ryzen 9 7950X. Both regular runs exit 139; debugger runs confirm the distinct sites above. Same converted executable and guest modules, with verified library paths. No game assets, raw title logs, binaries or screenshots attached. AI-assisted investigation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201881775 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6201881775). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-15T20:43:34Z. --- Independent Linux title check of exact PR head `0cd9877c6d3224c6207ed58948bc102330350648`: **Double Dragon Gaiden: Rise of the Dragons (PPSA16018), 01.000.013 is not unblocked by the fallback alone.** Compared main `ce991f1ec2eb71a1f30459b4442a0730a0a4861b` plus the common #6476 build repair against that same source plus only this PR's two commits, preserving authorship. Full `libs` and relinker builds pass. The rebuilt `guest_module_args` CTest passes (0.14 s). A separate ctypes call to the built production `__aps5_get_pending_module_args_nid_no_patch` confirms a non-null 16-byte default block with size `0x10`, version `0x200`, **null context**; this check uses the runtime library, not the relinker test provider. Both native launches fail before the executable's main entry, in the converted bundled `Media/Plugins/NativePluginPS5Example.prx`: | Source | First debugger fault, relative to the module's executable mapping | Observed operation | |---|---|---| | main + common build repair | `+0x23a` | Argument/version checker reads through a null argument pointer. | | same + this PR | `+0x3a9` | Version check has passed; module startup reads the vtable through a null context pointer, immediately before a method call. | The first check accepts `{size=0x10, version=0x200}` and saves the pointer at block `+8`. The second crash follows its use. Thus supplying a non-null header is insufficient for this plugin: it needs the context as well. I have not established the correct source or lifecycle for that context and have not added a replacement pointer, skipped initialization, or bypassed the call. This is additional title scope, not a rerun of the Cult of the Lamb result. Environment: Arch Linux 7.2.9-arch1-1, GCC 16.2.1, Ryzen 9 7950X. Both regular runs exit 139; debugger runs confirm the distinct sites above. Same converted executable and guest modules, with verified library paths. No game assets, raw title logs, binaries or screenshots attached. AI-assisted investigation.
MarcZX10 commented 2026-10-17 00:08:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T00:08:19Z.


I checked the independent Double Dragon result in the linked issue thread against this PR's stated fallback. On the exact earlier PR head, the {0x10, 0x200, nullptr} block gets past the plugin's header check, but NativePluginPS5Example.prx then dereferences the null context at +0x3a9 before the executable reaches main (https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6201881775).\n\nThat does not disprove the narrower Cult of the Lamb fix, but it shows the default block does not make every needed-module DT_INIT safe. Could you clarify whether Cult of the Lamb was run past this initializer on the current head, and keep the PR's claim scoped to the reproduced case if that remains unverified?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227095103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6227095103). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T00:08:19Z. --- I checked the independent Double Dragon result in the linked issue thread against this PR's stated fallback. On the exact earlier PR head, the {0x10, 0x200, nullptr} block gets past the plugin's header check, but NativePluginPS5Example.prx then dereferences the null context at +0x3a9 before the executable reaches main (https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6201881775).\n\nThat does not disprove the narrower Cult of the Lamb fix, but it shows the default block does not make every needed-module DT_INIT safe. Could you clarify whether Cult of the Lamb was run past this initializer on the current head, and keep the PR's claim scoped to the reproduced case if that remains unverified?
oneandonlydean commented 2026-10-17 02:17:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T02:17:48Z.


Two things before this can go further. The fallback also fires for an explicit sceKernelLoadStartModule with no arguments, since that path stores {0, nullptr} too, so those loads now get the guessed block as well; could you limit it to the DT_NEEDED initializers this PR is about? And on @MarcZX100's question: was Cult of the Lamb run past this initializer on the current head? @JJenkx's Double Dragon run shows the block gets past the header check and then hits the null context, so I'd like the claim scoped to what was reproduced.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228407852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6228407852). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T02:17:48Z. --- Two things before this can go further. The fallback also fires for an explicit `sceKernelLoadStartModule` with no arguments, since that path stores `{0, nullptr}` too, so those loads now get the guessed block as well; could you limit it to the `DT_NEEDED` initializers this PR is about? And on @MarcZX100's question: was Cult of the Lamb run past this initializer on the current head? @JJenkx's Double Dragon run shows the block gets past the header check and then hits the null context, so I'd like the claim scoped to what was reproduced.
socket1001 commented 2026-10-17 21:12:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by socket1001 on 2026-10-17T21:12:07Z.


Suggestion for this PR, with measurements (AI-assisted - note at the end).

Cross-posting this from #5621 because it is about the fallback this PR installs, rather than a per-title finding.

The default block here is {0x10, 0x200} with context = nullptr. On a title that actually consumes that block (PPSA16018, Double Dragon Gaiden: Rise of the Dragons), the field turns out not to be a data pointer - it gets called:

  • the plugin's init reads the value from args[8] (the +8 field, 0x10/0x200 format) into a module global;
  • an accessor inside the module later does rc = g_context(id, &out); return rc ? 0 : out; - so the field is invoked as int (*)(int id, void **out);
  • the caller then dereferences the object written to *out and calls [obj->vtable + 0x10], with rsi pointing at the module's own static table (where the module has just registered its callback pointers);
  • with the field left nullptr, this title faults inside plugin init at module offset +0x3a9 - a call rax with rax = 0, which is the null it was handed.

What I measured locally. Setting that field to a getter of that shape, returning 0 and handing back a statically built object whose [vtable+0x10] is a harmless stub, is enough for this title to get through: plugin init completes and the game runs - Vulkan device, swapchain 2224x1251 with 3 images, then its prologue, character select and mission select on input, into the first stage at 45-60 FPS. Same three commits cherry-picked onto main as of 13d07428a, 127 runtime libraries rebuilt, both this title and an unaffected one re-run as a control.

To be clear: a real loader-side context object is presumably the right answer and this is not a proposal to merge - it is a throwaway probe to demonstrate the shape of the field, and it should not be committed as-is. Two things a proper version would have to do differently are reflected in the code below: no mutable static state (the module may call this from more than one thread), and a real decision about the block size.

// The plugin consumes the default block's context as:
//   g_context = args[8]                       (the {0x10, 0x200} layout)
//   accessor:  rc = g_context(id, &out);  return rc ? 0 : out;
//   caller:    obj = *out;  obj->vtable[0x10](obj, module_static);   // virtual call
// i.e. the field is a getter function, not a data pointer - so a no-op is enough here
// only because the object it hands back is never used for anything this title needs.
//
// Everything here is statically initialised: the getter can be reached from more than one
// thread during module init, so there is deliberately no lazy-init guard and no mutable state.
// The signature of the virtual slot that gets called is not established, hence the loose one.

using ModuleContextNoop = long (*)(void*, void*);

extern "C" long moduleContextNoop(void* /*self*/, void* /*arg*/) { return 0; }

// slot +0x10 = element 2 (8-byte pointers), so every slot is filled rather than guessing
extern "C" constinit ModuleContextNoop moduleContextVtable[8] = {
    moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop,
    moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop,
};

struct ModuleContextObject { ModuleContextNoop const* vtable; };  // *(obj) -> vtable

extern "C" constinit ModuleContextObject moduleContextObject{moduleContextVtable};

extern "C" int moduleContextGetter(int /*id*/, void** out) {
    if (out != nullptr) *out = &moduleContextObject;
    return 0;
}

alignas(16) const SceKernelDefaultModuleArgs kDefaultModuleArgs{
    0x10, 0x200, reinterpret_cast<const void*>(&moduleContextGetter)};

The id argument's meaning is not established - the plugin passes a value of its choosing and the getter above ignores it. Whether the returned object's other methods matter beyond this title is untested.

One size caveat while picking a default: the block above is the 16-byte {0x10, 0x200} shape, and this plugin also carries code for the {0x48, 0x103} shape, which reads the same field from a 0x48-byte block (offset 0x40). It selects between the two from the version field, so a consistent 16-byte block does not reach the larger path here - but anything handed the 16-byte default while taking that path would read past the end of it. Not something I could trigger, just worth knowing.

Disassembly, register state and the thread-level evidence behind the shape claim are in my comment on #5621; happy to test anything more specific you would like tried.

Note: written by an AI agent (Hermes, running on the reporter's own machine) while testing the emulator locally. The builds, runs and measurements are real and reproducible; the prose is the agent's. Not affiliated with the project.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241178569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#issuecomment-6241178569). Originally posted by [socket1001](https://github.com/socket1001) on 2026-10-17T21:12:07Z. --- **Suggestion for this PR, with measurements (AI-assisted - note at the end).** Cross-posting this from #5621 because it is about the fallback this PR installs, rather than a per-title finding. The default block here is `{0x10, 0x200}` with `context = nullptr`. On a title that actually consumes that block (PPSA16018, *Double Dragon Gaiden: Rise of the Dragons*), the field turns out not to be a data pointer - it gets **called**: - the plugin's init reads the value from `args[8]` (the `+8` field, `0x10`/`0x200` format) into a module global; - an accessor inside the module later does `rc = g_context(id, &out); return rc ? 0 : out;` - so the field is invoked as `int (*)(int id, void **out)`; - the caller then dereferences the object written to `*out` and calls `[obj->vtable + 0x10]`, with `rsi` pointing at the module's own static table (where the module has just registered its callback pointers); - with the field left `nullptr`, this title faults inside plugin init at module offset `+0x3a9` - a `call rax` with `rax = 0`, which is the null it was handed. **What I measured locally.** Setting that field to a getter of that shape, returning 0 and handing back a statically built object whose `[vtable+0x10]` is a harmless stub, is enough for this title to get through: plugin init completes and the game runs - Vulkan device, swapchain 2224x1251 with 3 images, then its prologue, character select and mission select on input, into the first stage at 45-60 FPS. Same three commits cherry-picked onto `main` as of `13d07428a`, 127 runtime libraries rebuilt, both this title and an unaffected one re-run as a control. To be clear: a real loader-side context object is presumably the right answer and **this is not a proposal to merge** - it is a throwaway probe to demonstrate the shape of the field, and it should not be committed as-is. Two things a proper version would have to do differently are reflected in the code below: no mutable static state (the module may call this from more than one thread), and a real decision about the block size. ```cpp // The plugin consumes the default block's context as: // g_context = args[8] (the {0x10, 0x200} layout) // accessor: rc = g_context(id, &out); return rc ? 0 : out; // caller: obj = *out; obj->vtable[0x10](obj, module_static); // virtual call // i.e. the field is a getter function, not a data pointer - so a no-op is enough here // only because the object it hands back is never used for anything this title needs. // // Everything here is statically initialised: the getter can be reached from more than one // thread during module init, so there is deliberately no lazy-init guard and no mutable state. // The signature of the virtual slot that gets called is not established, hence the loose one. using ModuleContextNoop = long (*)(void*, void*); extern "C" long moduleContextNoop(void* /*self*/, void* /*arg*/) { return 0; } // slot +0x10 = element 2 (8-byte pointers), so every slot is filled rather than guessing extern "C" constinit ModuleContextNoop moduleContextVtable[8] = { moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop, moduleContextNoop, }; struct ModuleContextObject { ModuleContextNoop const* vtable; }; // *(obj) -> vtable extern "C" constinit ModuleContextObject moduleContextObject{moduleContextVtable}; extern "C" int moduleContextGetter(int /*id*/, void** out) { if (out != nullptr) *out = &moduleContextObject; return 0; } alignas(16) const SceKernelDefaultModuleArgs kDefaultModuleArgs{ 0x10, 0x200, reinterpret_cast<const void*>(&moduleContextGetter)}; ``` The `id` argument's meaning is not established - the plugin passes a value of its choosing and the getter above ignores it. Whether the returned object's other methods matter beyond this title is untested. One size caveat while picking a default: the block above is the 16-byte `{0x10, 0x200}` shape, and this plugin also carries code for the `{0x48, 0x103}` shape, which reads the same field from a 0x48-byte block (offset `0x40`). It selects between the two from the version field, so a consistent 16-byte block does not reach the larger path here - but anything handed the 16-byte default while taking that path would read past the end of it. Not something I could trigger, just worth knowing. Disassembly, register state and the thread-level evidence behind the shape claim are in my comment on #5621; happy to test anything more specific you would like tried. *Note: written by an AI agent (Hermes, running on the reporter's own machine) while testing the emulator locally. The builds, runs and measurements are real and reproducible; the prose is the agent's. Not affiliated with the project.*
XairRrR commented 2026-10-29 06:25:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T06:25:09Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The head conflicts with current main. The fallback also replaces the arguments of explicit sceKernelLoadStartModule calls, not only DT_NEEDED initializers. The new regression still passes when the production change is reverted.

What I ran

  • PR head: 0cd9877c6d3224c6207ed58948bc102330350648
  • main: 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree with a Release/Ninja build.
git fetch -q origin main pull/6149/head:refs/review/6149
git checkout -q --detach origin/main
git merge -q --no-ff --no-edit refs/review/6149   # conflicts, aborted
git checkout -q --detach refs/review/6149
git diff --check origin/main...refs/review/6149
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target relinker guest_module_args_host
ctest --test-dir build -R '^guest_module_args$' --output-on-failure
cmake --build build -j10 --target libs
# negative control
git checkout 92e50418f33b8950ceea950cb37331a941f5be0e -- core/libs/prx/libkernel/Module/src/Module.cpp
cmake --build build -j10 --target libs relinker guest_module_args_host
ctest --test-dir build -R '^guest_module_args$' --output-on-failure
git checkout refs/review/6149 -- core/libs/prx/libkernel/Module/src/Module.cpp

Results

Check Result
Merge onto main Conflict in core/relinker/relinker/tests/test_guest_module_args.py and docs/dev/debt/libkernel.md
git diff --check clean
tools/check_conventions.py --base origin/main passed
Build relinker, guest_module_args_host (PR head) passed
Build libs (PR head) passed
guest_module_args (PR head) passed, 0.11 s
guest_module_args with production Module.cpp reverted passed, 0.11 s
Merge conflict
CONFLIT (contenu) : Conflit de fusion dans core/relinker/relinker/tests/test_guest_module_args.py
CONFLIT (contenu) : Conflit de fusion dans docs/dev/debt/libkernel.md

On main, the --load branch of the test now drives __aps5_guest_lifecycle_nid_no_patch itself, and the Linux setup copies the provider into libs/libkernel.prx. The PR's --load-default branch and its load_and_record_default calls were written against the earlier version of that code.

Negative control
1/1 Test #1224: guest_module_args ................   Passed    0.11 sec
100% tests passed out of 1

Negative control

I restored only core/libs/prx/libkernel/Module/src/Module.cpp from the PR's merge base 92e50418f3, then rebuilt libs, relinker and guest_module_args_host. guest_module_args still passes. I used the merge base rather than main because the PR head does not merge with main. This confirms, on the current head, what @simonbbby reported for 950bc7c32. The later null-pointer check in the fixture catches a null pointer in the fixture's own provider. It does not make the test exercise the production getter.

Findings

Blocking

  1. Conflicts with main. The PR conflicts in core/relinker/relinker/tests/test_guest_module_args.py and docs/dev/debt/libkernel.md. @oneandonlydean flagged this on 2026-10-25, and the head has not changed since. main has also changed the code this PR depends on. Linux explicit runtime directories now use deferred initialization, which reads the getter in InitializeLinuxGuestModule, and the debt doc has a Linux runtime module initialization entry. After the rebase, the claim that a DT_NEEDED module runs its entry at process start before any sceKernelLoadStartModule should be checked again against the deferred path.

  2. The fallback rewrites explicit load arguments, not only DT_NEEDED initializers. Module.cpp:276-281 substitutes {0x10, &kDefaultModuleArgs} whenever argp == nullptr. However, sceKernelLoadStartModule stores the caller's {args, argp} verbatim at line 294. @oneandonlydean raised the args == 0 case. One more input changes as well: an explicit sceKernelLoadStartModule(path, 8, nullptr, ...) reaches the module entry as (0x10, &kDefaultModuleArgs), so the caller's args value is replaced as well as argp. This is a value the title did not pass, and its console behaviour is unverified. The same happens for a guest dlopen on a thread without pending arguments, because pendingModuleArgs is thread_local.
    Suggested fix: record whether an explicit start is in flight, for example a separate thread-local flag set and cleared around dlopen_nid_postfix in sceKernelLoadStartModule. The default block should apply only when no explicit start is in progress. Explicit loads would then always pass the caller's arguments unchanged. Update the debt entry to say exactly which loads receive the block.

  3. The regression does not cover the production change. The fixture provider GuestModuleArgsHost.cpp:65-70 contains its own copy of the fallback, so --load-default checks the test's copy. The negative control above passes with the production fix reverted. Two options would fix this. A test could call the real __aps5_get_pending_module_args_nid_no_patch from Module.cpp: @simonbbby and @JJenkx both did this outside CTest, with a probe and with ctypes. Or the fixture could forward to the production object instead of reimplementing it. Either test should also cover the explicit-load case from finding 2, checking that (8, nullptr) reaches the entry unchanged.

Non-blocking

  1. Scope of the description. "Closes #5621" and "Unblocks: PPSA06464 #5621" are claimed, but the description does not say whether Cult of the Lamb ran past UnifyPS5Plugin.prx initialization on this head. @MarcZX10 and @oneandonlydean asked this, and it is still unanswered. @JJenkx's PPSA16018 run and @socket1001's analysis show a plugin that calls context as a function and crashes on the null value. I did not run a title, so I cannot add evidence either way. The description should say what was reproduced. The debt entry could also note that some plugins dereference context, because a later reader would otherwise assume that a null context is safe.

Not verified

  • No title was run. I have no evidence on whether PPSA06464 gets past the initializer.
  • I did not probe the production getter at runtime myself. I relied on code reading, and on the probes @simonbbby and @JJenkx describe, which show it returns the 16-byte block.
  • The merged tree was not built or tested because of the conflict. Everything above ran on the PR head, which is based on 92e50418f3.
  • I did not run macOS or Windows.

To get this to a good state

  1. Rebase onto current main and resolve the test and debt-doc conflicts against the deferred lifecycle path.
  2. Limit the default block to initializers that run without an explicit sceKernelLoadStartModule. Explicit loads should pass the caller's {args, argp} unchanged, including (0, nullptr) and (N, nullptr).
  3. Make the regression exercise the production getter, and show that it fails with the Module.cpp change reverted.
  4. Scope Unblocks and the debt entry to what was reproduced on the current head.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693687528 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#pullrequestreview-5693687528). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T06:25:09Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The head conflicts with current `main`. The fallback also replaces the arguments of explicit `sceKernelLoadStartModule` calls, not only `DT_NEEDED` initializers. The new regression still passes when the production change is reverted. ## What I ran - PR head: `0cd9877c6d3224c6207ed58948bc102330350648` - `main`: `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7` - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree with a Release/Ninja build. ```sh git fetch -q origin main pull/6149/head:refs/review/6149 git checkout -q --detach origin/main git merge -q --no-ff --no-edit refs/review/6149 # conflicts, aborted git checkout -q --detach refs/review/6149 git diff --check origin/main...refs/review/6149 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target relinker guest_module_args_host ctest --test-dir build -R '^guest_module_args$' --output-on-failure cmake --build build -j10 --target libs # negative control git checkout 92e50418f33b8950ceea950cb37331a941f5be0e -- core/libs/prx/libkernel/Module/src/Module.cpp cmake --build build -j10 --target libs relinker guest_module_args_host ctest --test-dir build -R '^guest_module_args$' --output-on-failure git checkout refs/review/6149 -- core/libs/prx/libkernel/Module/src/Module.cpp ``` ## Results | Check | Result | |---|---| | Merge onto `main` | **Conflict** in `core/relinker/relinker/tests/test_guest_module_args.py` and `docs/dev/debt/libkernel.md` | | `git diff --check` | clean | | `tools/check_conventions.py --base origin/main` | passed | | Build `relinker`, `guest_module_args_host` (PR head) | passed | | Build `libs` (PR head) | passed | | `guest_module_args` (PR head) | passed, 0.11 s | | `guest_module_args` with production `Module.cpp` reverted | **passed**, 0.11 s | <details><summary>Merge conflict</summary> ``` CONFLIT (contenu) : Conflit de fusion dans core/relinker/relinker/tests/test_guest_module_args.py CONFLIT (contenu) : Conflit de fusion dans docs/dev/debt/libkernel.md ``` On `main`, the `--load` branch of the test now drives `__aps5_guest_lifecycle_nid_no_patch` itself, and the Linux setup copies the provider into `libs/libkernel.prx`. The PR's `--load-default` branch and its `load_and_record_default` calls were written against the earlier version of that code. </details> <details><summary>Negative control</summary> ``` 1/1 Test #1224: guest_module_args ................ Passed 0.11 sec 100% tests passed out of 1 ``` </details> ## Negative control I restored only `core/libs/prx/libkernel/Module/src/Module.cpp` from the PR's merge base `92e50418f3`, then rebuilt `libs`, `relinker` and `guest_module_args_host`. `guest_module_args` **still passes**. I used the merge base rather than `main` because the PR head does not merge with `main`. This confirms, on the current head, what @simonbbby reported for `950bc7c32`. The later null-pointer check in the fixture catches a null pointer in the fixture's own provider. It does not make the test exercise the production getter. ## Findings ### Blocking 1. **Conflicts with `main`.** The PR conflicts in `core/relinker/relinker/tests/test_guest_module_args.py` and `docs/dev/debt/libkernel.md`. @oneandonlydean flagged this on 2026-10-25, and the head has not changed since. `main` has also changed the code this PR depends on. Linux explicit runtime directories now use deferred initialization, which reads the getter in [`InitializeLinuxGuestModule`](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libkernel/Module/src/DynamicLoader.cpp#L170-L173), and the debt doc has a [Linux runtime module initialization](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/docs/dev/debt/libkernel.md#L147) entry. After the rebase, the claim that a `DT_NEEDED` module runs its entry at process start before any `sceKernelLoadStartModule` should be checked again against the deferred path. 2. **The fallback rewrites explicit load arguments, not only `DT_NEEDED` initializers.** [`Module.cpp:276-281`](https://github.com/boykopovar/AnyPS5/blob/0cd9877c6d3224c6207ed58948bc102330350648/core/libs/prx/libkernel/Module/src/Module.cpp#L276-L281) substitutes `{0x10, &kDefaultModuleArgs}` whenever `argp == nullptr`. However, [`sceKernelLoadStartModule`](https://github.com/boykopovar/AnyPS5/blob/0cd9877c6d3224c6207ed58948bc102330350648/core/libs/prx/libkernel/Module/src/Module.cpp#L289-L302) stores the caller's `{args, argp}` verbatim at line 294. @oneandonlydean raised the `args == 0` case. One more input changes as well: an explicit `sceKernelLoadStartModule(path, 8, nullptr, ...)` reaches the module entry as `(0x10, &kDefaultModuleArgs)`, so the caller's `args` value is replaced as well as `argp`. This is a value the title did not pass, and its console behaviour is unverified. The same happens for a guest `dlopen` on a thread without pending arguments, because `pendingModuleArgs` is `thread_local`. Suggested fix: record whether an explicit start is in flight, for example a separate thread-local flag set and cleared around `dlopen_nid_postfix` in `sceKernelLoadStartModule`. The default block should apply only when no explicit start is in progress. Explicit loads would then always pass the caller's arguments unchanged. Update the debt entry to say exactly which loads receive the block. 3. **The regression does not cover the production change.** The fixture provider [`GuestModuleArgsHost.cpp:65-70`](https://github.com/boykopovar/AnyPS5/blob/0cd9877c6d3224c6207ed58948bc102330350648/core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp#L65-L70) contains its own copy of the fallback, so `--load-default` checks the test's copy. The negative control above passes with the production fix reverted. Two options would fix this. A test could call the real `__aps5_get_pending_module_args_nid_no_patch` from `Module.cpp`: @simonbbby and @JJenkx both did this outside CTest, with a probe and with ctypes. Or the fixture could forward to the production object instead of reimplementing it. Either test should also cover the explicit-load case from finding 2, checking that `(8, nullptr)` reaches the entry unchanged. ### Non-blocking 1. **Scope of the description.** "Closes #5621" and "Unblocks: PPSA06464 #5621" are claimed, but the description does not say whether Cult of the Lamb ran past `UnifyPS5Plugin.prx` initialization on this head. @MarcZX10 and @oneandonlydean asked this, and it is still unanswered. @JJenkx's PPSA16018 run and @socket1001's analysis show a plugin that calls `context` as a function and crashes on the null value. I did not run a title, so I cannot add evidence either way. The description should say what was reproduced. The debt entry could also note that some plugins dereference `context`, because a later reader would otherwise assume that a null context is safe. ## Not verified - No title was run. I have no evidence on whether PPSA06464 gets past the initializer. - I did not probe the production getter at runtime myself. I relied on code reading, and on the probes @simonbbby and @JJenkx describe, which show it returns the 16-byte block. - The merged tree was not built or tested because of the conflict. Everything above ran on the PR head, which is based on `92e50418f3`. - I did not run macOS or Windows. ## To get this to a good state 1. Rebase onto current `main` and resolve the test and debt-doc conflicts against the deferred lifecycle path. 2. Limit the default block to initializers that run without an explicit `sceKernelLoadStartModule`. Explicit loads should pass the caller's `{args, argp}` unchanged, including `(0, nullptr)` and `(N, nullptr)`. 3. Make the regression exercise the production getter, and show that it fails with the `Module.cpp` change reverted. 4. Scope `Unblocks` and the debt entry to what was reproduced on the current head.
XairRrR commented 2026-11-03 08:25:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T08:25:37Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

This pull request does not merge cleanly into main (4f41f4c375): head a407a5ef83 conflicts in

  • core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp

Please rebase it onto current main. I will review the change once it merges cleanly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5749054624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#pullrequestreview-5749054624). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T08:25:37Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested This pull request does not merge cleanly into `main` (4f41f4c375f5abb487dbd184fbc150f31994d762): head a407a5ef836405798b7e248b876acd66aa3f39e7 conflicts in - `core/relinker/elfpatcher/tests/GuestModuleArgsHost.cpp` Please rebase it onto current `main`. I will review the change once it merges cleanly. <!-- anyps5-bots job=3198 head=a407a5ef836405798b7e248b876acd66aa3f39e7 -->
MarcZX10 commented 2026-11-14 11:23:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T11:23:42Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5904067339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#pullrequestreview-5904067339). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T11:23:42Z. **Review:** COMMENTED --- # 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.
ligmaSec commented 2026-12-03 13:45:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:45:55Z.

Review: COMMENTED


The exact branch passed guest_module_args in a Linux relinker-only build. A trial merge against main 13aa5703b3 reports conflicts in Module.cpp and GuestModuleArgsHost.cpp, which block an integrated kernel-loader run.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170995746 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6149#pullrequestreview-6170995746). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:45:55Z. **Review:** COMMENTED --- The exact branch passed guest_module_args in a Linux relinker-only build. A trial merge against main 13aa5703b390 reports conflicts in Module.cpp and GuestModuleArgsHost.cpp, which block an integrated kernel-loader run. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/6149:upstream-pr/6149'
git switch 'upstream-pr/6149'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/6149'
git switch 'upstream-pr/6149'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/6149'
git switch 'upstream-pr/6149'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/6149'
git switch 'main'
git merge --squash 'upstream-pr/6149'
git switch 'main'
git merge --ff-only 'upstream-pr/6149'
git switch 'main'
git merge 'upstream-pr/6149'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6149
No description provided.