fix(libc): print sceLibcInternalHeapErrorReportForGame's report as a PS5 does #10236
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10236"
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 orezraey on 2026-10-23T15:11:02Z.
What
sceLibcInternalHeapErrorReportForGamemeasured on a retail PS5 (firmware 13.60) throughlibSceLibcInternal.sprxfrom a payload process, with the call on a watchdog thread so a non-returning call could not block the loader. The sources and console logs are in this gist (pheapreptopheaprep7; non-ASCII log bytes escaped as\xNN).The console writes this to standard output, not standard error, and returns:
<name>is the C string atheap + 0x3B0, read without a length limit.(<number>)is the 32-bit value atheap + 0x3F4, printed with%2u(( 7),(4294967295)) and left out when it is 0.pheaprep4andpheaprep5).Before, AnyPS5 wrote one line with the three values to the host's standard error. It now writes the console's lines to the guest's standard output and keeps that diagnostic line on the host's standard error. The pid and tid are the host process's and thread's ids, where the console prints its own process and kernel thread ids. The block is not read here. A null heap throws. The debt entry is rewritten.
Tested
Windows 11, MinGW (winlibs).
guest_heap_report_for_gamechecks both reports (error 1 with a number, error 2 without), the pid, the host diagnostic and the throw for a null heap. It fails onmainand passes three runs in a row with the change, as do the 24 other heap tests.guest_heap_report_for_gamebuilds and passes three runs in a row atf90172bf48, covering thesyscall(SYS_gettid)path.tools/check_conventions.pypasses;tools/pr_overlap.pyreports only shared debt files.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)Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T12:30:04Z.
Review: COMMENTED
Checked against main
87666fc5d6and the gist 788804e121 (pheaprep–pheaprep7, probe.h):(%2u), "omitted when 0" and the null-heap fault all match the logs too. Nice probes.1u << (e - 16 + 4)loop covers 2^4–2^19, and the extra cases add 2^24 and 2^29–2^31, so 2^20–2^23 and 2^25–2^28 were never called. Could the description say which values were tested?Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.