Commit Graph
5 Commits
Author SHA1 Message Date
Dean Galvin a25e4f1704 test(exception): report the failing check in guest_exception_fault
Require now prints the failed expression with its file and line before
aborting, and the Windows child of the remove-and-return case writes its
stderr into the pipe the parent already reads instead of NUL. When the
child's exit code or marker output is not what the test expects, the parent
prints the child's status and everything it wrote before the check aborts.

Windows CI has twice ended this test with exit code 0xc0000409 right after
the fix-and-return fault, and the log cannot say which check fired. No check
is changed, relaxed or retried.
2026-11-06 14:07:38 +13:00
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