feat(libkernel): answer kern.proc.proc with the calling process #13532
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13532"
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 relativespace2K on 2026-10-30T17:45:34Z.
What
sysctl{CTL_KERN,KERN_PROC,KERN_PROC_PROC} (kern.proc.proc,{1, 14, 8}) now answers with the calling guest process'skinfo_procinstead of throwing on the unsupported MIB: the same 1,088-byte FreeBSD 11 amd64 recordkern.proc.pidbuilds, because the runtime hosts one guest process.KERN_PROC_PROCtakes no pid, so a fourth element is ignored, more than four elements returnEINVAL, a write returnsEPERMand a short bufferENOMEM, as in the siblingkern.procnodes.The record construction moves into
GuestProcessRecord(), shared bykern.proc.pidand the new node, anddocs/dev/debt/libkernel.mdgains the entry that records how many processes a console lists and whether its record is 1,088 or 1,096 bytes as unverified.MihawkOS (PPSA99170) reads
{1, 14, 8, 0}while it starts; the runtime threwsysctl_nid_postfix: unsupported MIB 1.14.8.0, which aborted the title. The title still needs #12826 and #11939 before it can boot, so there is no end-to-end title run to report here; the title's thread is #13543.Tested
Windows 11, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON:ctest -R system_configurationrunsguest_system_configuration, which passed, including the new checks: the size query returns 1,088 bytes; the record'sstructSize,pidandcomm(eboot.bin); nothing is written past the record; a four-element MIB is accepted; five elements returnEINVAL; a short bufferENOMEM; a writeEPERM.Not tested on a console.
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)The overlap comment lists open pull requests that also append to
docs/dev/debt/libkernel.md; none of them changesSystemConfiguration.cpp.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T18:08:19Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The new test pins an exact
KERN_PROC_PROCsize-query result that is not supported by the cited FreeBSD behavior and has not been measured on console.What I ran
Reviewed head
db910209afd4d78a8dd6cd4084ef69f080347518; PR base223b19ba0adb11b66893a57fa656ecf6bc4a45cf. The stack check previewed the head against currentmain4bc9e779aa7abb2109c65ee3bca19e1b85df3be8and merged cleanly. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0.Results
mainguest_system_configurationis registered incore/libs/prx/libkernel/CMakeLists.txtThe precheck wrapper itself reported failure because its temporary PR checkout did not contain the locally available audit scripts; its test-quality heuristic also produced the registration false positive above. I reran the ABI audit directly from the workspace. No C++ build or test was run locally.
Raw local output
ABI audit:
Test-quality heuristic:
Findings
Blocking
The test expects a null-buffer
KERN_PROC_PROCquery to return exactly 1,088 bytes (test lines 356–360); the implementation reports exactly one record throughCopyOut(implementation lines 466–476). The PR says console behavior is untested. The pinned FreeBSD 11.4 reference used for the record size instead reserves fivekinfo_procslots for a null-buffer query and then enumerates processes, so that reference does not support an exact one-record size result. Please remove the exact-size assertion until it is measured on console, or implement and test the intended size-query contract with evidence for any deliberate divergence.Non-blocking
None.
Sources
kern_proc.cat commit8c639945a44588f6cfdddfb057bb5aad88735da0— validates accepted MIB length and the five-record null-buffer overestimate.kern_sysctl.cat the same commit — shows a null output pointer still advances the reported output length.Not verified
system_configurationpassed; that result was not independently reproduced.To get this to a good state
Remove or replace the unmeasured exact size-query assertion, or provide console evidence supporting the intentional one-record behavior. I will rerun the same relevant checks on the new head.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T23:31:40Z.
Review: COMMENTED
Linux run (the thread so far has Windows only).
Machine: i7-8700, Ubuntu 26.04, GCC 15.2, Release,
BUILD_TESTING=ON, Ninja. Head3b379b4435merged (--no-commit) ontomain2a1ae91175.guest_system_configuration^guest_(system_configuration|kernel_sys_sdk|kernel_sys_upd)public_headersSystemConfiguration.cppreverted tomain, test keptsysctl_nid_postfix: unsupported MIB 1.14.8The record checks (
structSize,pid,comm==eboot.bin, nothing past 1,088 bytes) and theEINVAL/ENOMEM/EPERMcases hold on Linux as well.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.