fix(sysmodule): acquire native providers before reporting loaded #1061
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1061"
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 eliasbruno124-dev on 2026-10-07T07:00:43Z.
What
Sysmodule reports a successful load after incrementing a counter without acquiring a native provider image. Unknown public IDs also report success, and the WithArg path ignores its payload.
Acquire the mapped provider through the existing libkernel loader from
libs/beside the executable. Publish loaded state only after acquisition, share references between public/internal calls, and release the owned loader reference at final unload. Native initialization/finalization run outside the state lock; callbacks can query state during both transitions. Independent native and dynamic-loader references remain owned by their callers.Missing/invalid images, failed attachment, unknown IDs, transitions in progress, reference overflow and nonempty WithArg payloads fail explicitly. Add the
0x125TextToSpeech2 ID from the pinned public PS5 module table. This supplies native transport and ID routing, not a speech implementation.Console module-start/module-stop entry points, version negotiation and nonempty load arguments remain unimplemented; TechnicalDebt records the limits.
The overlap report with #846 concerns declarations and calls of the existing
dlopen_nid_postfix; this PR does not change its implementation or define another loader export. #1055 adds an unrelated AGC entry at the same TechnicalDebt insertion point. Neither is a functional dependency of this native-provider change. If either merges first, rebase this branch and retain both debt entries. Combined native execution with #846 has not been tested.Tested
Windows, MinGW-w64 GCC 15.2.0, Release/Ninja. Rebased onto
mainat78b8f058fbd89477eb1806d0551e8b79f512933b, then rebuilt the affected provider, loader and fixtures from final commit11730063with unchanged source inputs.guest_sysmodule: 20 native process cases, ten each for Fiber and TextToSpeech2 identities. Checks actual image acquisition/final release, preloaded images, shared loader ownership, missing/invalid images, failed attachment, unknown load/query/unload IDs and nonempty arguments. Positive cases require native image presence and an attach/detach pair; negative cases require explicit diagnostics and native aborts.guest_dynamic_loaderandguest_elf_phdr_match: both existing adjacent groups passed with the rebuilt dependencies. The final selection passed all three groups.Native Linux execution is untested. The provider fixture is not TextToSpeech2 emulation. The previous local Shadows integration still stopped at missing
libSceTextToSpeech2.prx(0xC0000135); this contribution was not retested in the title and claims no menu, gameplay or performance improvement.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T07:15:22Z.
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)dlopen_nid_postfixImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T09:00:42Z.
Thanks for the detailed write-up and the native test fixture. I'm closing it for now, because it changes what every title gets from sysmodule and no title is shown to need that:
libs/*.prx;sceSysmoduleLoadModuledoesn't need to map anything for the title to call into the module. Reporting a load as successful is therefore not a missing step on main.libs/<name>.prxthrows. About 200 of the 268 names inModuleTable.hpphave no library incore/libs/prx, so titles that load one of them today and carry on would now stop at boot. The.nativelibraries are also built as<name>.native.prx, which this lookup never finds.b4db9fdd6. This PR makes them throw again.sceSysmoduleLoadModuleInternalWithArgnow throws for any nonzerounk, and nobody has checked which values titles pass there.libs/beside the executable, so it ignores a custom--rpath.libSceTextToSpeech2.prx. That failure happens when the import is loaded, not in sysmodule.If a title misbehaves on main because sysmodule reports success, please open an issue or a new PR with the title ID and the log line where it stops. Adding id
0x125→libSceTextToSpeech2to the table on its own is fine as a small PR once a title loads that id.Pull request closed