Skip to content

fix(libkernel): resolve kern.proc.proc by name - #14591

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
ahmadmuj:fix/anyps5-sysctl-proc-name
Nov 2, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
ahmadmuj:fix/anyps5-sysctl-proc-name

Conversation

@ahmadmuj

@ahmadmuj ahmadmuj commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What

#13532 added sysctl {1, 14, 8} (kern.proc.proc), but the name paths were never wired up, so sysctlbyname("kern.proc.proc") and sysctlnametomib("kern.proc.proc") still return -1 with ENOENT. kern.proc.pathname already has both.

This maps the name to {1, 14, 8} in both places, the way FreeBSD 11.4 does it: kern_proc.c registers the node as proc under kern.proc, and sysctlbyname is just the name lookup plus a numeric sysctl. So the name reaches the existing handler with 3 elements, which sysctl_kern_proc accepts for KERN_PROC_PROC.

No new behaviour in the handler. The open gaps in the kern.proc.proc debt entry (one process, record size, size estimate) apply the same way to the name, so the entry stays as is. I don't know of a title that asks for this by name; it just closes the name/number mismatch #13532 left.

Tested

Ubuntu 24.04 on WSL2, GCC 13.3, Release build.

  • guest_system_configuration: fails on main with the new checks (aborts at the named size query, and at the sysctlnametomib table row with only the sysctlbyname change), passes with the fix, 3 runs.
  • The new checks compare the named read byte for byte with the numeric {1, 14, 8} read, and check the size query, ENOMEM on a 100-byte buffer (length kept), EPERM on a write, and the sysctlnametomib MIB {1, 14, 8} with size 3.
  • public_headers: pass. python3 tools/check_conventions.py --base origin/main: pass.
  • No console or dump test; nothing GPU related.

Overlap: tools/pr_overlap.py --branch reports no overlap with the 1,790 open PRs. A paginated pulls/files scan lists both files in 14 old PRs (#9588, #9688, #10113, #10226, #10229, #10247, #10317, #10349, #10351, #10469, #10492, #12053, #12299, #12598), but that's main's history showing through their old base: at each head both files have the same blob as at its merge base with main, so none of them changes sysctlbyname, sysctlnametomib, CheckProcessListSysctl or CheckNameToMib.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

sysctl serves {1, 14, 8} since boykopovar#13532, but sysctlbyname and sysctlnametomib still returned ENOENT for kern.proc.proc. Map the name to the same MIB, as FreeBSD's name lookup does.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The name lookup maps to the existing {1, 14, 8} handler, and the added tests cover named/numeric equivalence plus the relevant size, short-buffer, and write cases.

What I ran

Reviewed exact head 00f69414ba3401fa71c394f733d86715fd7334bf against PR base/current main f2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview completed cleanly. Environment: Debian GNU/Linux 12, Python 3.11.2; no build or compiler run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14591
python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 00f69414ba3401fa71c394f733d86715fd7334bf --title 'fix(libkernel): resolve kern.proc.proc by name' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14591-00f69414ba34/pr-body.md
git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...00f69414ba3401fa71c394f733d86715fd7334bf
git merge-tree --write-tree f2d874c1fdccf781c0fa5d86619bb5dd8894b958 00f69414ba3401fa71c394f733d86715fd7334bf
gh pr checks 14591 -R boykopovar/AnyPS5

Results

Check Result
Diff check Passed; no whitespace errors.
Conventions and PR template Passed.
Merge preview Clean against current main.
Test registration Confirmed: GuestSystemConfiguration.cpp is registered by the libkernel CMake file.
Source behavior FreeBSD 11.4 registers proc under kern.proc as MIB value 8; the existing AnyPS5 handler accepts {1, 14, 8}.
PR precheck Diff, conventions, and dependency/mergeability checks passed. Its ABI and test-quality helper steps could not run because those workspace-local scripts are absent from the PR snapshot.
Hosted CI Still queued when checked.
C++ test run Not run locally. The PR description reports three passing Release runs on Ubuntu 24.04/WSL2; that result is author-reported, not independently reproduced here.
Unedited selected command output

git diff --check:

[no output; exit status 0]

Conventions:

All conventions checks passed.

Merge preview:

6a094365710ea6d3307ce138d2268e08951e719b

Hosted checks:

conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062421/job/124903164690
eligibility	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062493/job/124903163631
intake	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062391/job/124903164580
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062394/job/124903164490
library-portability	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062415/job/124903163420
report	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/41325062503/job/124903163877

The precheck reported these unavailable helper scripts in the detached PR snapshot:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14591-00f69414ba34/head-00f69414ba34-24316de3/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14591-00f69414ba34/head-00f69414ba34-24316de3/tools/pr_test_quality.py': [Errno 2] No such file or directory

Sources

Not verified

I did not build or run CTest locally, and hosted checks were pending. No console or title behavior was tested.

@maskym

maskym commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Windows result for head 00f69414ba, merged alone into main e0caf13600 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

guest_system_configuration, the test this PR extends, passes 3 of 3 runs. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@bunbeans2-arch

Copy link
Copy Markdown
Contributor

A Windows run with GCC 16: Windows 10.0.22631 (Windows 11), i9-9900K, MSYS2 UCRT64 GCC 16.1.0 (Rev5), Release, this PR (00f69414ba) merged into main 5bae1a4bc2.

  • ✅ With this PR: guest_system_configuration passed 5 of 5.
  • ❌ Same tree with only SystemConfiguration.cpp put back to main (this PR's test kept): it aborted (SIGABRT, exit 0xc0000409) in 5 of 5 runs.
  • ✅ main 5bae1a4bc2 alone (its own tests and source): the same test passed 3 of 3.

Looks good on Windows 👍

AI-assisted: yes (Claude Code)

@oneandonlydean oneandonlydean self-assigned this Nov 2, 2026
@oneandonlydean
oneandonlydean merged commit 4c1cecc into boykopovar:main Nov 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants