libkernel: getrusage(RUSAGE_CHILDREN) throws "unsupported who" and aborts the title; fix branch ready #3120
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 milescoviello on 2026-10-10T22:35:23Z.
getrusageaccepts onlyRUSAGE_SELF(0) andRUSAGE_THREAD(1) and throwsstd::invalid_argument("getrusage: unsupported who")forRUSAGE_CHILDREN(-1). FreeBSD'skern_getrusage(sys/kern/kern_resource.c) accepts it and returnsp_cru, the summed usage of the children the process has waited for. A guest process here never has children (systemruns no command andwaitpidalways returns ECHILD), so the console's answer is a zeroedstruct rusageand 0.Fix on my fork:
milescoviello/AnyPS5:fix/getrusage-children(one commit,d5c92b22, onmain4d27834f; the 12 commits onmainsince then don't touch these files):RUSAGE_CHILDRENzero-fills the structure and returns 0, and other values still throw.guest_getrusagegains a check that aborts on main and passes with the fix. Linux only; Windows was not built or tested (the new path has no platform-specific code).Setup: Gentoo, Linux 7.2.8, GCC 15.3.0, Release with CI's configure flags,
main4d27834f.Tested: the new checks fail on
mainand pass with the fix. Fullctestwith the fix on Linux (RTX 5090 Laptop GPU): no new failures; the only failures are the knownagc_driver_dcc_keys_first_write(#2767) and twoguest_video_out_*tests that time out with the displays powered off.tools/check_conventions.pypasses. All five fixes I am filing today also pass their tests merged together on the currentmain.Not opened as a PR because intake is paused for new contributors; a maintainer is welcome to carry the commit.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by hikazey on 2026-10-11T00:53:16Z.
Windows check, since the issue says Windows wasn't tested. This branch merged onto
mainf1ae427b, Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release with CI's configure flags.guest_getrusageProcess.cppreverted tomain, test keptTwo of the full-suite failures also fail on plain
mainhere (pr_overlap_encoding: the two*_error_preserves_unicodecases;guest_filesystem: line 276, guest errno 14), so they are unrelated.agc_driver_draw_cache_reusealso crashed once with0xc0000374, the same intermittent heap-corruption exit as #3171.AI-assisted: yes (Claude Code).