fix(json): implement allocator error notification #2308
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2308"
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 yeahboi233 on 2026-10-09T15:14:31Z.
What
Calling the existing
sce::Json::MemAllocator::notifyErrorexport raises a not-implemented exception instead of reporting the allocation error. Implement its default notification by printing the error code and requested byte count to stdout, returning normally and leaving allocator/user-data storage untouched.Replace the parameterless, integer-returning placeholder with a void callback taking the implicit allocator pointer, error code, 64-bit requested size and user-data pointer. The argument types come from the existing PS5 mangled export; the void return and default printing behavior come from the related VitaSDK JSON API. TechnicalDebt records that the PS5 return contract and exact diagnostic wording remain unverified on hardware.
This implements one existing gray cell in the JSON library: 92/94 to 93/94 functions in the progress report. It does not change JSON allocation or dispatch custom allocator callbacks. #992 originally declared this throwing import. No title-compatibility or unresolved-import fix is claimed.
Tested
macOS 26.6.2, Apple Silicon, AppleClang 21, current main
d70b89989473ba1f6ae13e44e079e67f1f8a44b0:GuestJson.cpptest fail on the original production stub with its not-implemented exception.Export.cppplus the completeGuestJson.cpppasses in an arm64 Release build (-O2 -DNDEBUG), arm64 AddressSanitizer/UBSan build, and x86-64 Release build executed through the already installed Rosetta.size_t, null/non-null user data, diagnostic contents, normal return and unchanged opaque storage. Existing JSON checks still run.NotImplemented_nid_no_patchthat throws for the remaining unrelated RTTI stub. They exercise the production JSON source; they do not constitute the full runtime build or patched.prxloader validation.git diff --checkpass. The existingguest_jsonCTest registration runs the added checks in a full build.Full Linux/Windows builds and console/game execution have not been run locally. Native Windows stdout capture and the guest calling convention need their platform checks.
Checklist
main; open-PR overlap checked before submission, with the later concurrent #2309 overlap recorded belowNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Open-PR overlap
The overlap bot reports #2281 and #2309. Neither is a dependency of this implementation.
sceNetResolverAbortand removes that entry from the same one-line unknown-signature list inTechnicalDebt.mdfrom which this PR removesnotifyError. The source and tests are separate. When both changes are integrated, the documentation list must omit both entries and retain both functions' individual uncertainty notes.notifyErrorexport and test declaration. Its current implementation discards the error code, requested size and user data, and validates the allocator pointer without printing a notification; this PR implements the default stdout diagnostic described by the related VitaSDK API and tests its contents. The two alternatives cannot merge unchanged. This PR does not incorporate #2309's separately inferred RTTI constructor layout.Depends on: noneremains accurate. The shared export is a competing implementation requiring a maintainer choice or removal from one PR; declaring a dependency solely to suppress the bot would not reconcile the behavior.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T15:14:55Z.
Progress report (
d70b899→a979c66)📈 System libraries: 84.72% (+0.03%, +1 implemented functions)
✅ 1 implemented
_ZN3sce4Json12MemAllocator11notifyErrorEimPvImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T15:29:46Z.
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)docs/dev/TechnicalDebt.mdL59core/libs/tests/GuestJson.cppL88Imported from boykopovar/AnyPS5. Originally posted by yeahboi233 on 2026-10-09T16:17:19Z.
Following up on the overlap report:
TechnicalDebt.md: it removessceNetResolverAbort, while this PR removesnotifyError. The implementation and tests are independent. After either merges, I can rebase this PR and preserve both removals and both functions' limitation notes.notifyErrorexport. Its current implementation discards the error code and requested size without printing a notification. This PR prints the default diagnostic described by the related VitaSDK JSON API and tests the diagnostic, argument limits and unchanged opaque storage. The PS5-specific uncertainty remains documented. This PR leaves the unverified RTTI constructor unimplemented.Neither PR is a dependency, so
Depends on: noneremains accurate. A maintainer choice or removal of the duplicated export from one PR is needed before both can merge.The local arm64 Release, ASan/UBSan and x86-64 Rosetta JSON tests passed, as did the relinker CI matrix and conventions checks. Full Linux/Windows library builds were skipped by the automatic workflow. Could a collaborator run those full checks and review which notification implementation to retain?
Imported from boykopovar/AnyPS5. Originally posted by AnzouBelilita on 2026-10-09T16:40:20Z.
Independent Windows validation for PR #2308:
BUILD_TESTING=ON.guest_json_teststarget successfully (96 build steps).guest_jsonpassed (1/1, 0 failures).python tools/check_conventions.py --base d70b89989473ba1f6ae13e44e079e67f1f8a44b0passed.git diff --check d70b89989473ba1f6ae13e44e079e67f1f8a44b0...HEADpassed.This independently confirms that the PR builds and its JSON tests pass on native Windows. It does not verify the PS5-specific calling convention or exact behavior on console hardware.
No production code was modified during validation.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:11:42Z.
Closing: no title calls
MemAllocator::notifyErroron main, so the only effect is +1 in the progress report. Please reopen with the title ID and the log line if one reaches it.Pull request closed