fix(libkernel): raise the open file soft limit on Linux #1645
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1645"
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 XairRrR on 2026-10-08T15:31:11Z.
What
Each direct memory backing keeps a memfd open, so a title such as Dreaming Sarah (PPSA02929) holds about 1100 descriptors at startup and about 1180 once in game. With the systemd default soft
RLIMIT_NOFILEof 1024, later opens fail withEMFILE:memfd_createthrows "create direct memory backing: Too many open files", or the title'sfopenreturns NULL and it faults infread.libkernel now raises the soft limit to the hard limit when it is loaded, before the title creates any descriptor, and throws if the limit cannot be read or raised. If the hard limit itself is 1024 the title still runs out of descriptors, as before. Nothing in
coreuses POSIXselect(), so descriptors above 1023 are safe.Environments that already raise the soft limit (some IDE terminals, CI runners) do not show it; it reproduces from a default desktop terminal or with
ulimit -Sn 1024.Tested
Arch Linux (kernel 7.2, RTX 4070 Ti SUPER), Dreaming Sarah (PPSA02929), soft limit 1024 unless stated:
main(4b005b22): crashes at startup on 3/3 runs; the process reaches exactly 1024 open descriptors before it diesmainwith soft limit 4096: runs, peaking at about 1180 open descriptorsctest: 463/463 passed;tools/check_conventions.py --base origin/mainpassedChecklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T19:06:56Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/CMakeLists.txtL9core/libs/prx/libkernel/CMakeLists.txtL9Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:43:38Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
df3aa1a9, merged ontomain8b393b6ein one build with 31 other PRs that had no Windows run.guest_offline_imports, broken by #2359 (reported there).No title was run.
🤖 Addressed by Claude Code