feat(libkernel): report vm.overcommit through sysctlbyname #5184
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5184"
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 p3n1cillin on 2026-10-13T14:09:51Z.
What
PS5MC (PPSA99420, Kodi 22, catalog release) stops right after its
heap: 2048 MiB of direct memoryline on Windows:All three of its
sysctlbyname("vm.overcommit")call sites (guest 0x3A4C351, 0x3A4CFA9, 0x3A4E43E) are mimalloc'sunix_detect_overcommit. Each reads the page size throughsysconf(47), thenvm.overcommitinto a zeroed 4-byteint, and sets mimalloc's overcommit flag from(result | value) != 0; mimalloc's start-up messages "secure level: %d" and "mem tracking: %s" follow the first site.sysctlbyname("vm.overcommit")now reports 0, the default FreeBSD gives itsintvm.overcommit. It goes through the existingCopyOut: a null buffer gets the length 4, and a short buffer gets a partial copy andENOMEM. A write, which FreeBSD takes as a new policy, throws. The console's value is unknown; this is recorded under Unknown function info indocs/dev/debt/libkernel.md.Tested
main3faa9cb40. Before this change it stops as above within 3 s. After, mimalloc starts and Python's start-up is next (#5185, #5186); with those too, Kodi creates its GUI and runs for the whole 90 s run.guest_system_configurationcovers the length query, the value, a 2-byte buffer (ENOMEM, the rest untouched,errnootherwise unchanged) and a throwing write. All 125 libkernel tests pass on Windows; Linux was not built locally.python tools/check_conventions.py --base origin/mainpasses. #5078 and #5098 add other names in the same part ofSystemConfiguration.cppand the same debt list; whichever merges later needs a trivial rebase.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:34:45Z.
Linux run: Ubuntu in WSL2, GCC 15.2.0, Ninja Release,
BUILD_TESTING=ON, full build of a local test head838d4fd85. That head ismain3faa9cb40with this PR, my other open libkernel PRs (#5013, #5061, #5078, #5098, #5183–#5187, #5191) and the open PRs the catalog titles need (#4377, #4379, #4374, #4383, #3798, #4467, #4863, #4105). All 123 libkernel and 69 libc tests pass, includingguest_system_configuration,guest_getrlimit,guest_kernel_fcntl,guest_freebsd_clocks,guest_kernel_sysandguest_filesystem. Not built alone on Linux; no title run on Linux.Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:48:47Z.
Tested on Linux x86-64 (Release build), with this PR alone (341fbb228) merged into main
9d0a41d5a:guest_system_configurationpasses.guest_system_configurationaborts.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T22:34:27Z.
A title that stops here on
main: PS5MC / kodi-ps5 (PPSA99420, catalog release). Since #4379 (chflags) merged,mainbf8dc610stops it atsysctlbyname_nid_postfix: unsupported name vm.overcommit, just after it maps its heap and opens/dev/crypto(Linux, Ubuntu 24.04, GCC 13, Release, headless). With this PR (341fbb22, clean merge)guest_system_configurationpasses. Kodi then starts properly: it loads its settings and initializes its services, and exits on its own at a later step,XBPython: Python initialization failed in _PyImport_InitExternal: external importer setup failed(a bareRuntimeError), thenCServiceManager::InitStageTwo: Unable to initialize the python binding modules,XBMC_Run returned -1.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:45:17Z.
Rebased onto main to resolve the conflict in
docs/dev/debt/libkernel.mdafter #5098; no other change.