Commit Graph
4 Commits
Author SHA1 Message Date
Jevro1337andClaude Opus 5.5 d6628a4d1e test(libkernel): pass inheritable handles to the fault test's child and read its output while waiting
STARTF_USESTDHANDLES needs inheritable handles, but stdin and stderr were the
parent's own, which ctest need not make inheritable; the child now gets NUL
for both. The parent read the child's stdout only after it ended, so a child
that filled the pipe would have blocked until the timeout; a thread now reads
it while the parent waits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:19 +01:00
Jevro1337andClaude Opus 5.5 8a564d6c67 test(libkernel): take the fault test's imports from the libkernel and libc API headers
The test declared sceKernelInstallExceptionHandler, sceKernelRemoveExceptionHandler
and longjmp_nid_postfix itself, the last with a void* buffer. Include the API
headers instead and keep the jump buffer as std::uint64_t, as the canonical
longjmp_nid_postfix(std::uint64_t*, int) takes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:18 +01:00
Jevro1337andClaude Opus 5.5 33ec8a1b92 test(libkernel): cover exception handlers that return without fixing the fault
A handler that returns the context unchanged runs again on the same fault,
a handler that fixes the page with mprotect and returns lets the store
complete, and a handler that removes itself and returns ends the process
with the fault (checked in a child process, so a loop fails on a timeout).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:17 +01:00
Jevro1337andClaude Opus 5.5 ab363feecc feat(libkernel): deliver host faults to sceKernelInstallExceptionHandler handlers
A handler installed for SIGILL, SIGFPE, SIGBUS or SIGSEGV now receives
the faults raised in title code instead of the process ending, with
mc_trapno, mc_addr and mc_err filled as FreeBSD 11's amd64 trap() does.
On Windows the crash reporter's vectored handler offers unclaimed faults
to libkernel, which redirects the thread to a stub that runs the handler
outside the exception dispatcher; on Linux chained host signal handlers
classify faults by REG_TRAPNO.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 21:01:15 +01:00