Skip to content

feat(libkernel): implement coredump user data calls - #4197

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MarcZX10:codex/audit-coredump-userdata
Oct 13, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MarcZX10:codex/audit-coredump-userdata

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Carries only screamm’s first ready commit from #4144, preserving its original author. Implements sceCoredumpWriteUserData and sceCoredumpDebugTextOut: because the core dump handler is not invoked in this runtime, WriteUserData returns the not-in-handler error and stores no data, while debug text is written to stderr with the existing coredump prefix.

The signatures come from Orbital and SharpProspero; the outside-handler rule is supported by Vita documentation. Error 0x81180003 is shadPS4’s PS4 numbering and is unverified on PS5; that uncertainty is recorded in TechnicalDebt. sceCoredumpWriteUserString and the other undocumented calls remain throwing stubs.

Coordination: open #3821 implements the separate attach calls. It shares the error constant and region-validation helper in Coredump.cpp; this PR does not implement those attach calls. The changes are independent, but a small textual rebase may be needed if #3821 lands first.

Tested

  • Linux Release configure with GCC, BUILD_TESTING=ON, and ANYPS5_ENABLE_SPIRV_TOOLS=ON completed.
  • Built guest_coredump_user_data_tests with Ninja (62/62 steps).
  • ctest --test-dir /tmp/AnyPS5-4173-build -R '^guest_coredump_user_data$' --output-on-failure --timeout 60 passed (1/1).
  • python3 tools/check_conventions.py --base upstream/main --head HEAD passed.
  • git diff --check passed.

Checklist

  • Based on current main; no other open PR implements these calls
  • 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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none; see coordination note about feat(libkernel): answer the coredump attach calls made outside the handler #3821’s adjacent helper
  • AI-assisted: yes (original commit co-authored by Claude; carried and validated with Codex)

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Progress report (e51428b → c8379be)

📈 System libraries: 87.98% (+0.06%, +2 implemented functions)

✅ 2 implemented
Library Name
libkernel sceCoredumpDebugTextOut
libkernel sceCoredumpWriteUserData

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@MarcZX10
MarcZX10 force-pushed the codex/audit-coredump-userdata branch from 6577699 to 039fbed Compare October 12, 2026 16:12
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Independent verification of your rebase — the new head builds and passes the full local suite on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): 960/960, conventions green. From my side this is merge-ready.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks for independently verifying the rebased head. The full Linux suite result (960/960) and conventions check are useful confirmation.

@xXPBSXx

xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Windows test of head 7fc689fbe merged onto current main (fa0cc752a, clean merge; built together with four other open PRs, so the run is for the combination): Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build 0 errors, -j2.

guest_coredump_user_data (the test this PR changes) passes. The seven tests of the five PRs (guest_coredump_user_data, guest_np_web_api2, guest_execvp, guest_math, guest_wide_conversion, guest_wide_strings, guest_character) all pass.

Not checked: that the test fails without the change, Linux, a title run.

AI-assisted (Claude Code).

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Needs a rebase: it conflicts with #3821 in Coredump.cpp, the CMake list and two files under docs/dev/debt/. Please put it on top of the helper #3821 added.

sceCoredumpWriteUserData (Dbbkj6YHWdo) and sceCoredumpDebugTextOut
(dei8oUx6DbU) get the signatures of Orbital's db_types.json (cc408367)
and SharpProspero's KernelSystem.cs (5dfdb4b0): ssize_t (const void*,
size_t) and void (const char*, int). WriteUserData moves out of
Unimplemented.cpp.

User data belongs to the core dump handler: the Vita's
sceCoredumpWriteUserData returns 0x800A0003 ("No user-data capture is
active") outside it (vita-headers e66ebe90), and the RED engine's PS4
crash handler makes every coredump call from its handler (Vangaurd
4f86d2b0). The handler is never invoked here, so WriteUserData returns
SCE_COREDUMP_ERROR_NOT_IN_COREDUMP_HANDLER (0x81180003, shadPS4
coredump_error.h e0a46675) sign-extended and keeps nothing; a null,
empty or wrapping buffer throws because the order of the console's
checks is unknown. DebugTextOut prints its text to stderr with the
[coredump] prefix; a negative length or a null text with a nonzero
length throws.

Evidence: Broken Sword Reforged (PPSA21480) reaches the family through
its sibling, boykopovar#3704 comment 6113687542: "`ERROR agc_graphics.cpp:266
Sony call failed with code 8a6c9018` (the resource registration error,
followed by the error dialog), then `sceCoredumpWriteUserString not
implemented`." WriteUserString has no declaration in any source and
keeps throwing; its TechnicalDebt entry records the call. 007 First
Light (PPSA11386) imports WriteUserData (boykopovar#2523) without calling it
before its stop.

Test: guest_coredump_user_data.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@MarcZX10
MarcZX10 force-pushed the codex/audit-coredump-userdata branch from 7fc689f to c8379be Compare October 13, 2026 04:44
@MarcZX10

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the overlap with merged #3821, preserving screamm as the commit author and the existing commit metadata.

Linux validation (GCC 12.2, Release, Ninja, BUILD_TESTING=ON, SPIRV-Tools off): configured successfully; built guest_coredump_user_data_tests and guest_coredump_attach_tests; guest_coredump_user_data and guest_coredump_attach both passed (2/2). tools/check_conventions.py --base upstream/main --head HEAD and git diff --check pass.

The focused Linux tests passed; I did not run a Windows build. Updated head: c8379be9226271befd37624611390822de276d6c.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

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
#4588 core/libs/prx/libkernel/Unimplemented.cpp L8-17

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 13, 2026
@oneandonlydean
oneandonlydean merged commit 2cc97e1 into boykopovar:main Oct 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants