feat(libkernel): answer the coredump attach calls made outside the handler #3821

Merged
13hourstilliland merged 2 commits from upstream-pr/3821 into main 2026-10-12 20:19:52 +00:00
13hourstilliland commented 2026-10-11 17:13:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 13hourstilliland on 2026-10-11T17:13:26Z.


What

Picks up #3243 by @dantdmdarealguy (auto-closed by the intake pause), rebased onto current main with no changes.

sceCoredumpAttachMemoryRegion and sceCoredumpAttachUserMemoryFile take (uint32_t userValue, const void* mem, size_t size), per Orbital and SharpProspero. Attaching only works inside the core dump handler, and AnyPS5 never invokes the handler. So both calls now return NOT_IN_COREDUMP_HANDLER without recording anything. The value 0x81180003 is inferred from fpPS4's 0x8118000x codes plus the Vita error table. A null, empty or wrapping region throws.

Tested

Linux x86-64, GCC 14, Release, BUILD_TESTING=ON. The new guest_coredump_attach passes, and check_conventions and check_test_registration pass. Not tested with a title.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820842814 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821). Originally posted by [13hourstilliland](https://github.com/13hourstilliland) on 2026-10-11T17:13:26Z. --- ### What Picks up #3243 by @dantdmdarealguy (auto-closed by the intake pause), rebased onto current main with no changes. `sceCoredumpAttachMemoryRegion` and `sceCoredumpAttachUserMemoryFile` take `(uint32_t userValue, const void* mem, size_t size)`, per Orbital and SharpProspero. Attaching only works inside the core dump handler, and AnyPS5 never invokes the handler. So both calls now return `NOT_IN_COREDUMP_HANDLER` without recording anything. The value 0x81180003 is inferred from fpPS4's 0x8118000x codes plus the Vita error table. A null, empty or wrapping region throws. ### Tested Linux x86-64, GCC 14, Release, BUILD_TESTING=ON. The new guest_coredump_attach passes, and check_conventions and check_test_registration pass. Not tested with a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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-11 17:13:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T17:13:49Z.


Progress report (9742ec1 → 5b73ecb)

📈 System libraries: 86.48% (+0.05%, +2 implemented functions)

✅ 2 implemented
Library Name
libkernel sceCoredumpAttachMemoryRegion
libkernel sceCoredumpAttachUserMemoryFile
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111574770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821#issuecomment-6111574770). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T17:13:49Z. --- <!-- progress-report --> ### Progress report (9742ec1 → 5b73ecb) 📈 **System libraries**: 86.48% (+0.05%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libkernel | `sceCoredumpAttachMemoryRegion` | | libkernel | `sceCoredumpAttachUserMemoryFile` | </details>
adriadam10 commented 2026-10-11 22:06:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:06:57Z.


Checked on Linux: build + ctest of libs/libkernel (113/113) with the PR on current main; guest_coredump_attach passes and fails without the Coredump.cpp change.

Added a commit on your branch:

  • TechnicalDebt: the line said no PS4/PS5 reference has 0x81180003; shadPS4's coredump_error.h has ORBIS_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER = 0x81180003, now cited (still not confirmed on a PS5).
  • Moved the line a few lines down, away from #3500's edits to the neighbouring TextToSpeech2 line.

Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114372233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821#issuecomment-6114372233). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T22:06:57Z. --- Checked on Linux: build + ctest of libs/libkernel (113/113) with the PR on current main; `guest_coredump_attach` passes and fails without the Coredump.cpp change. Added a commit on your branch: - TechnicalDebt: the line said no PS4/PS5 reference has `0x81180003`; shadPS4's `coredump_error.h` has `ORBIS_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER = 0x81180003`, now cited (still not confirmed on a PS5). - Moved the line a few lines down, away from #3500's edits to the neighbouring TextToSpeech2 line. Merging once CI is green.
oneandonlydean commented 2026-10-11 23:57:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:57:01Z.


A title is required for this to merge: which title calls sceCoredumpAttachMemoryRegion or sceCoredumpAttachUserMemoryFile on main? With the title ID and the log line where it stops, this can go in.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115336243 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821#issuecomment-6115336243). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:57:01Z. --- A title is required for this to merge: which title calls `sceCoredumpAttachMemoryRegion` or `sceCoredumpAttachUserMemoryFile` on main? With the title ID and the log line where it stops, this can go in.
adriadam10 commented 2026-10-12 20:06:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:06:40Z.


Rebased onto current main: TechnicalDebt entries now live in docs/dev/debt/libkernel.md, so the updated Coredump line (with the shadPS4 coredump_error.h citation for 0x81180003) moved there. Build + ctest of libs/libkernel on the rebase: guest_coredump_attach passes.

@oneandonlydean's request for a title that calls these exports is still open; no title in our static data imports them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131742062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821#issuecomment-6131742062). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T20:06:40Z. --- Rebased onto current main: TechnicalDebt entries now live in `docs/dev/debt/libkernel.md`, so the updated Coredump line (with the shadPS4 `coredump_error.h` citation for `0x81180003`) moved there. Build + ctest of libs/libkernel on the rebase: `guest_coredump_attach` passes. @oneandonlydean's request for a title that calls these exports is still open; no title in our static data imports them.
github-actions[bot] commented 2026-10-12 20:12:42 +00:00 (Migrated from github.com)

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


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
#4197 core/libs/prx/libkernel/CMakeLists.txt L1176
core/libs/prx/libkernel/System/src/Coredump.cpp L4, L11
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131829810 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3821#issuecomment-6131829810). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T20:12:42Z. --- <!-- 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 | |---|---|---|---| | #4197 | `core/libs/prx/libkernel/CMakeLists.txt` [L1176](https://github.com/boykopovar/AnyPS5/blob/0428328b79af7820990ffc6964fb9009041bcdcf/core/libs/prx/libkernel/CMakeLists.txt#L1176)<br>`core/libs/prx/libkernel/System/src/Coredump.cpp` [L4](https://github.com/boykopovar/AnyPS5/blob/0428328b79af7820990ffc6964fb9009041bcdcf/core/libs/prx/libkernel/System/src/Coredump.cpp#L4), [L11](https://github.com/boykopovar/AnyPS5/blob/0428328b79af7820990ffc6964fb9009041bcdcf/core/libs/prx/libkernel/System/src/Coredump.cpp#L11) | | |
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!3821
No description provided.