feat(libkernel): implement coredump handlers, named shm_open, event e… #4219

Closed
matthew565656 wants to merge 1 commit from upstream-pr/4219 into main
matthew565656 commented 2026-10-12 01:39:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by matthew565656 on 2026-10-12T01:39:42Z.


What

Implement several missing or stubbed `libkernel` functions:
- Coredump handlers and user data reporting (`sceCoredumpRegisterCoredumpHandler`,

sceCoredumpUnregisterCoredumpHandler, sceKernelDebugWriteCppExceptionInfo, sceCoredumpAttachUserFile,
sceCoredumpGetStopInfoGpu_Agc, sceCoredumpAttachMemoryRegionAsUserFile, sceCoredumpSetUserDataType,
sceCoredumpDebugTextOut, sceCoredumpGetStopInfoCpu, sceCoredumpWriteUserString,
sceCoredumpAttachUserMemoryFile, sceCoredumpAttachMemoryRegion, sceCoredumpWriteUserData).
- Windows named shm_open and shm_unlink file handling.
- Event error accessor sceKernelGetEventError reading EvError flag from KernelEvent.
- sceKernelGetPageTableStats providing default total and available page table statistics.
- Allow GuestAdviceProtect in madvise_nid_postfix.
- Safely populate ModuleSegmentInfo in sceKernelInternalMemoryGetModuleSegmentInfo_nid_postfix.
- Add GuestCoredump standalone test and update GuestEqueueEvents.

### Tested
Windows 11 x64, guest unit tests (`guest_coredump_tests`, `guest_equeue_events`), MiniGolf / Unity title startup.

### Checklist
- [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 in
TechnicalDebt
- [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
- [x] AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823928809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4219). Originally posted by [matthew565656](https://github.com/matthew565656) on 2026-10-12T01:39:42Z. --- ### What Implement several missing or stubbed `libkernel` functions: - Coredump handlers and user data reporting (`sceCoredumpRegisterCoredumpHandler`, `sceCoredumpUnregisterCoredumpHandler`, `sceKernelDebugWriteCppExceptionInfo`, `sceCoredumpAttachUserFile`, `sceCoredumpGetStopInfoGpu_Agc`, `sceCoredumpAttachMemoryRegionAsUserFile`, `sceCoredumpSetUserDataType`, `sceCoredumpDebugTextOut`, `sceCoredumpGetStopInfoCpu`, `sceCoredumpWriteUserString`, `sceCoredumpAttachUserMemoryFile`, `sceCoredumpAttachMemoryRegion`, `sceCoredumpWriteUserData`). - Windows named `shm_open` and `shm_unlink` file handling. - Event error accessor `sceKernelGetEventError` reading `EvError` flag from `KernelEvent`. - `sceKernelGetPageTableStats` providing default total and available page table statistics. - Allow `GuestAdviceProtect` in `madvise_nid_postfix`. - Safely populate `ModuleSegmentInfo` in `sceKernelInternalMemoryGetModuleSegmentInfo_nid_postfix`. - Add `GuestCoredump` standalone test and update `GuestEqueueEvents`. ### Tested Windows 11 x64, guest unit tests (`guest_coredump_tests`, `guest_equeue_events`), MiniGolf / Unity title startup. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 01:48:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T01:48:05Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#3795 core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp L228
#3821 core/libs/prx/libkernel/System/src/Coredump.cpp L4, L9-11, L76-78, L81-84 sceCoredumpAttachMemoryRegion
sceCoredumpAttachUserMemoryFile
#4064 core/libs/prx/libkernel/Equeue/src/EventAccessors.cpp L22-24
#4065 core/libs/prx/libkernel/System/src/Coredump.cpp L71-72, L76-77, L81-82 sceCoredumpAttachMemoryRegion
sceCoredumpAttachUserMemoryFile
sceCoredumpWriteUserString
#4101 core/libs/prx/libkernel/DirectMemory/Export.cpp L387-392
#4154 core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp L228, L230
#4193 core/libs/prx/libkernel/Module/src/Module.cpp L244-250
#4197 core/libs/prx/libkernel/System/src/Coredump.cpp L4, L9-11, L54-56 sceCoredumpDebugTextOut
sceCoredumpWriteUserData
#4270 core/libs/prx/libkernel/File/src/SharedMemory.cpp L474-475
#4311 core/libs/prx/libkernel/Unimplemented.cpp L8-12
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116305817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4219#issuecomment-6116305817). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T01:48:05Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3795 | `core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp` [L228](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp#L228) | | | | #3821 | `core/libs/prx/libkernel/System/src/Coredump.cpp` [L4](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L4), [L9-11](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L9-L11), [L76-78](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L76-L78), [L81-84](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L81-L84) | `sceCoredumpAttachMemoryRegion`<br>`sceCoredumpAttachUserMemoryFile` | | | #4064 | `core/libs/prx/libkernel/Equeue/src/EventAccessors.cpp` [L22-24](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/Equeue/src/EventAccessors.cpp#L22-L24) | | | | #4065 | `core/libs/prx/libkernel/System/src/Coredump.cpp` [L71-72](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L71-L72), [L76-77](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L76-L77), [L81-82](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L81-L82) | `sceCoredumpAttachMemoryRegion`<br>`sceCoredumpAttachUserMemoryFile`<br>`sceCoredumpWriteUserString` | | | #4101 | `core/libs/prx/libkernel/DirectMemory/Export.cpp` [L387-392](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/DirectMemory/Export.cpp#L387-L392) | | | | #4154 | `core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp` [L228](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp#L228), [L230](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/DirectMemory/PosixMemory.cpp#L230) | | | | #4193 | `core/libs/prx/libkernel/Module/src/Module.cpp` [L244-250](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/Module/src/Module.cpp#L244-L250) | | | | #4197 | `core/libs/prx/libkernel/System/src/Coredump.cpp` [L4](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L4), [L9-11](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L9-L11), [L54-56](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/System/src/Coredump.cpp#L54-L56) | `sceCoredumpDebugTextOut`<br>`sceCoredumpWriteUserData` | | | #4270 | `core/libs/prx/libkernel/File/src/SharedMemory.cpp` [L474-475](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/File/src/SharedMemory.cpp#L474-L475) | | | | #4311 | `core/libs/prx/libkernel/Unimplemented.cpp` [L8-12](https://github.com/boykopovar/AnyPS5/blob/436e310ddb56fcf5dd1d40ba1f8113fe8cb8c113/core/libs/prx/libkernel/Unimplemented.cpp#L8-L12) | | |
oneandonlydean commented 2026-10-12 07:37:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T07:37:36Z.


Closing: this turns thirteen throwing coredump stubs, sceKernelGetPageTableStats, sceKernelGetEventError, madvise(MADV_PROTECT) and sceKernelInternalMemoryGetModuleSegmentInfo into calls that return made-up results (zeroed 128-byte stop info, 1048576 page tables), and here a function does what the console does or throws. Reopen as one PR per function, with the title ID, the log line where it stops on main and the source of the behaviour; named shm_open on Windows is worth its own PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119864427 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4219#issuecomment-6119864427). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T07:37:36Z. --- Closing: this turns thirteen throwing coredump stubs, `sceKernelGetPageTableStats`, `sceKernelGetEventError`, `madvise(MADV_PROTECT)` and `sceKernelInternalMemoryGetModuleSegmentInfo` into calls that return made-up results (zeroed 128-byte stop info, 1048576 page tables), and here a function does what the console does or throws. Reopen as one PR per function, with the title ID, the log line where it stops on main and the source of the behaviour; named `shm_open` on Windows is worth its own PR.

Pull request closed

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!4219
No description provided.