feat(libkernel): answer the coredump attach calls made outside the handler #3243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3243"
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 dantdmdarealguy on 2026-10-11T03:12:01Z.
What
sceCoredumpAttachMemoryRegionandsceCoredumpAttachUserMemoryFile(libkernel, Coredump.cpp) were(void)stubs that threw. They now have their signatures and answer as the console does for a call made outside the core dump handler.(uint32_t userValue, const void* mem, size_t size). ForsceCoredumpAttachMemoryRegionthe Orbital IDA type database (int32_t sceCoredumpAttachMemoryRegion(uint32_t user_value, const void* mem, size_t size)) and the SharpProspero bindings agree.sceCoredumpAttachUserMemoryFilehas only SharpProspero (uint userValue, void* mem, nuint size, "as an unnamed file"): the PS4 5.05 firmware does not export it, so Orbital has no entry. The RED engine's PS4 crash handler (Vangaurd) calls the siblingsceCoredumpAttachMemoryRegionAsUserFile(999, buffer, bytesWritten, "LoggerQueueCrashDump.txt"), confirming the(user value, memory, size, ...)order on a title.SCE_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER, "function was not called from registered core dump handler". AnyPS5 records the handler but never invokes it, so every call is outside the handler and returns that error; nothing is recorded, as there is no dump to attach to. Registrations are neither kept nor acknowledged, because on the console there is no registration outside the handler to keep.0x81180003is inferred. fpPS4 hasSCE_COREDUMP_ERROR_NOT_REGISTERED0x81180001 andSCE_COREDUMP_ERROR_ALREADY_REGISTERED0x81180002, and the Vita table numbersPARAM0,NOT_REGISTERED1,ALREADY_REGISTERED2,NOT_IN_COREDUMP_HANDLER3. No PS4 or PS5 reference carries the value.PARAMorNOT_IN_COREDUMP_HANDLER), so a null, empty or wrapping region throwsstd::runtime_errornaming the function.userValueis not interpreted (SharpProspero names bits 31 and 30 as truncation flags for the user file variants).The other coredump exports in the file (
sceCoredumpAttachUserFile,sceCoredumpAttachMemoryRegionAsUserFile,sceCoredumpSetUserDataType,sceCoredumpDebugTextOut,sceCoredumpGetStopInfoCpu,sceCoredumpGetStopInfoGpu_Agc,sceCoredumpWriteUserString) are untouched and still throw.Tested
-DBUILD_TESTING=ON.cmake --build(full) and--target libssucceed with no warnings in the touched files.guest_coredump_attach_tests(ctestguest_coredump_attach, registered incore/libs/prx/libkernel/CMakeLists.txt): both calls return0x81180003with no handler, with a registered handler (from the registering thread and from another thread) and after unregistering; the handler is never run and the region's bytes are untouched; a null, empty (size0) or wrapping (sizeSIZE_MAX) region throws astd::runtime_errorwhose message names the function. Runs in 0.07 s.ctest -R "guest_coredump_attach|patched_libraries": 2/2 pass. The patchedlibkernel.prxexports+YX0z-GUSNwandDoKHmUw1yiQ(objdump -p).0x81180000(PARAM) instead.python tools/check_test_registration.pyandpython tools/check_conventions.py --base origin/mainpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T03:12:10Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed