feat(libkernel): log guest exception context #7655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7655"
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 farosch on 2026-10-18T20:28:39Z.
What
Log the saved guest signal context before invoking a guest exception handler: signal number, RIP/RSP, flags, trap/error/fault fields, and general-purpose registers. Format into a fixed buffer and write directly to stderr, avoiding the normal logger in the POSIX signal-handler path. Debug-raise APIs now print exception codes in hex and include the caller address. These diagnostics do not change handler or termination behavior.
Tested
Linux x86-64:
cmake --build build --target libs --parallelpassed; no source errors reported. Manual runtime check produced:[src/Exception.cpp:576 sceKernelDebugRaiseExceptionOnReleaseMode] ... c1=0xa0020004 c2=0x00000000 caller=...The process still terminates on its existing SIGILL. The guest-register dump path was not exercised by that run because the unhandled host SIGILL bypasses guest exception dispatch. Windows not tested.
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 github-actions[bot] on 2026-10-18T20:48:15Z.
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.
main)core/libs/prx/libkernel/System/src/Exception.cppL125-128Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/System/src/Exception.cppcore/libs/prx/libkernel/System/src/Exception.cppcore/libs/prx/libkernel/System/src/Exception.cppcore/libs/prx/libkernel/System/src/Exception.cppImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T20:52:12Z.
Windows run, since the description covers Linux only. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON. Build:maine8ad642fewith #7651, #7650, #7647, #7655 and #7648 merged together (each merge clean, built once).The build is clean. The existing guest exception tests pass 3 runs of 3:
guest_raise_exception,guest_mutex_raise_exception,guest_raise_nested_sleepandwindows_exceptions. I didn't check whether any of them reaches the new log line, so this covers the build and no regression in those paths.AI-assisted
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T00:30:07Z.
Checked the context dump: the fixed 768-byte buffer holds the longest line (~520 bytes), it only uses
write/WriteFile(no allocation or logger in the signal path), theGuestMcontextfields exist, and handler behaviour is unchanged. Windows build confirmed by @LeandroLP23; merged.