fix(libkernel): report the getrlimit values measured on a PS5 for RLIMIT_STACK, RSS, MEMLOCK and NPROC #7543

Merged
ionut27001 merged 1 commit from upstream-pr/7543 into main 2026-10-20 00:07:40 +00:00
ionut27001 commented 2026-10-18 13:00:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-18T13:00:34Z.


What

getrlimit now answers RLIMIT_STACK, RLIMIT_RSS, RLIMIT_MEMLOCK and RLIMIT_NPROC with the limits a payload process reads on a PS5 (firmware 12.70). Before this PR, all four threw unsupported resource.

Resource Payload process, firmware 12.70 (soft and hard) main before this PR
RLIMIT_STACK (3) 0x200000 throws
RLIMIT_RSS (5) infinity throws
RLIMIT_MEMLOCK (6) infinity throws
RLIMIT_NPROC (7) 1604 throws
null output, any resource 0 to 14 -1 with EFAULT same (unchanged)

setrlimit side effect: setrlimit reads getrlimit first, so it now accepts RLIMIT_STACK, RLIMIT_RSS and RLIMIT_MEMLOCK when the values do not change, as the payload process does. RLIMIT_NPROC throws even for its current value, because the limit is not stored here: in the payload process that call succeeds, but getrlimit then reads 1443. That fits FreeBSD 11's setrlimit clamp to maxprocperuid, nine tenths of maxproc (cited in the debt entry), if the console's maxproc is 1604; kern.maxproc fails with ENOENT in the payload process (p10), so maxproc is not measured. Any other change still throws, as for the other resources whose limit is not stored.

Main thread stack: in the payload process the main thread's stack is 0x200000 as well (p17, pthread_attr_get_np), the same as RLIMIT_STACK. Here the main thread runs on the host thread's stack. The debt entry says so; this PR does not change it.

Not established: these values come from a payload process started through a payload manager. Whether a title process reads the same limits is not measured, and the debt entry says so.

docs/dev/debt/libkernel.md:

  • getrlimit: the entry now records the console's RLIMIT_DATA (0x800000000) and RLIMIT_NOFILE (13952) readings, and the 12555 descriptor ceiling, measured with the soft limit untouched. This PR does not adopt them, because those two limits follow the host here. It also says that guest locking still follows the host: mlock and sceKernelMlock fail at the host's hard RLIMIT_MEMLOCK on Linux, and on Windows when the working set cannot grow, although RLIMIT_MEMLOCK now reports infinity.
  • setrlimit: the entry now records three behaviours of the payload process on the console:
    • it lowers a requested RLIMIT_NOFILE limit of 13952 to 12555, for the hard limit and for the soft limit;
    • setting STACK, RSS or MEMLOCK to its current value changes nothing;
    • setting RLIMIT_NPROC to its current 1604 succeeds, but getrlimit then reads 1443.

How the console was measured

  • Setup:
    • The console runs firmware 12.70 and is jailbroken.
    • The probes are ELF payloads built with ps5-payload-dev/sdk v0.44 and clang 18.1.8, started through a payload manager.
  • Provenance: the resolve lines of p10 and p13 show that their getrlimit and setrlimit are the ones libkernel_sys.sprx exports; p24 prints no resolve lines and links them the same way.
  • Method:
    • p10 and p13 prefilled their outputs with 0xAA and logged each getrlimit return value. p24's same-value and descriptor cases did neither, so the 1443 that RLIMIT_NPROC read after the same-value set comes from a getrlimit call whose return value was not logged.
    • The probes changed only their own limits. p13 lowered the RLIMIT_NOFILE soft limit to 1000; setting the original {13952, 13952} back then read 12555 for both. p24 set STACK, RSS, MEMLOCK and NPROC to their current values; NPROC then read 1443.
  • Attachment: sources and the full logs are in the attached getrlimit-probes.zip.
Console output (excerpt, lines copied unchanged)
p10: meta fw=0x12700001 pid=121 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 01:17:42
p13: meta fw=0x12700001 pid=125 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 01:52:02
p17: meta fw=0x12700001 pid=131 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 02:39:47
p24: meta fw=0x12700001 pid=136 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 02:48:52

p10: resolve sym=getrlimit module=libkernel_sys.sprx same_as_called=yes
p13: resolve sym=setrlimit module=libkernel_sys.sprx same_as_called=yes

p10: case getrlimit resource=2 ret=0 errno=0 cur=0x800000000 max=0x800000000
p10: case getrlimit resource=3 ret=0 errno=0 cur=0x200000 max=0x200000
p10: case getrlimit resource=5 ret=0 errno=0 cur=0x7fffffffffffffff max=0x7fffffffffffffff
p10: case getrlimit resource=6 ret=0 errno=0 cur=0x7fffffffffffffff max=0x7fffffffffffffff
p10: case getrlimit resource=7 ret=0 errno=0 cur=0x644 max=0x644
p10: case getrlimit resource=8 ret=0 errno=0 cur=0x3680 max=0x3680
p10: case sysctl name=kern.maxproc size_ret=-1 errno=2
p24: case getrlimit_null resource=3 ret=-1 errno=14
p24: case getrlimit_null resource=7 ret=-1 errno=14

p24: case dup_ceiling_untouched cur=13952 max=13952 dtablesize=12555 opened=12547 errno=24 highest_fd=12554
p13: case nofile_lowered set_ret=0 set_errno=0 get_ret=0 cur=1000 max=12555 dtablesize=1000 sysconf5=1000 sysconf26=1000
p13: case nofile_restored set_ret=0 set_errno=0 get_ret=0 cur=12555 max=12555 dtablesize=12555

p24: case setrlimit_same resource=3 set_ret=0 errno=0 before_cur=0x200000 before_max=0x200000 after_cur=0x200000 after_max=0x200000
p24: case setrlimit_same resource=5 set_ret=0 errno=0 before_cur=0x7fffffffffffffff before_max=0x7fffffffffffffff after_cur=0x7fffffffffffffff after_max=0x7fffffffffffffff
p24: case setrlimit_same resource=6 set_ret=0 errno=0 before_cur=0x7fffffffffffffff before_max=0x7fffffffffffffff after_cur=0x7fffffffffffffff after_max=0x7fffffffffffffff
p24: case setrlimit_same resource=7 set_ret=0 errno=0 before_cur=0x644 before_max=0x644 after_cur=0x5a3 after_max=0x5a3

p17: case stack who=main np_ret=0 stack_ret=0 guard_ret=0 size=0x200000 guard=0x4000 local_from_top=1241
p17: case main_usrstack ret=0 usrstack_from_np_top=0

The pNN: prefix names the probe; the rest of each line is copied unchanged.

nofile_lowered is setrlimit(RLIMIT_NOFILE, {1000, 13952}), and nofile_restored is setrlimit(RLIMIT_NOFILE, {13952, 13952}).

Overlaps:

  • #6836 and #7332 (macOS host) rewrite the same getrlimit debt line to add the macOS open file limit, and that line still says that the four resources throw. #7332 also moves the getrlimit and setrlimit lines below execvp. Whichever lands second keeps the measured values.
  • #6836 and #7332 also change CheckOpenFileLimit in GuestGetrlimit.cpp. Those hunks are apart from this PR's, and git merges them without a conflict; only the debt line conflicts.
  • #7813 has landed; see the rebase note under Tested.
  • #6201 has landed. The rebase onto main 6e27fc8f0 conflicted with it in GuestGetrlimit.cpp, where #6201 replaced the test's check that getdtablesize throws with a check of its value; the resolution keeps that check next to this PR's RLIMIT_STACK and RLIMIT_NPROC checks. #7039, which also implements getdtablesize, now conflicts with main in Process.cpp, GuestGetrlimit.cpp and the debt file, and this branch adds no other file to that.
  • Lines that still call these values unknown: the socket descriptor numbers entry says that the console's getdtablesize is not measured, and the fcntl entry calls the console's RLIMIT_NOFILE unknown. This PR leaves them alone to stay on its topic and to avoid conflicts with #7403 and #7437, which rewrite the fcntl line. Until they are updated, the file contradicts itself there. The getdtablesize entry, which #6201 rewrote and #7039 rewrites, says only that maxfilesperproc is not measured on the console; this PR records no maxfilesperproc reading, so that line does not contradict it.
  • #6044 moves the test files, so it needs only a path change on rebase.
  • #5918 has landed. Its debt entry says that on Windows a host thread the library did not create is reported from one 64 KiB granule above the bottom of its reservation when everything above that is committed read-write, as in a relinked executable's main thread and its default-size host threads (0x200000 committed of 0x210000 reserved), and that any other such thread, and every such thread on Linux, gets its whole host stack. The main thread still runs on the host thread's stack, so the getrlimit entry's "whose size can differ" still holds. #3965 (Windows) and #7532 (Linux) run the guest main thread on a stack in the guest arena; if either lands first, the main-thread sentence in the getrlimit entry needs updating.

Tested

Build: Windows 11 x86-64, full build with WinLibs MinGW-w64 GCC 15.2.0 (posix-seh, ucrt, r7) and -DBUILD_TESTING=ON.

Rebase (not re-tested): after #7813 landed, this branch was rebased onto main bbb45463c. The only conflict was in docs/dev/debt/libkernel.md: #7813 added the Windows stdio stream limit to the getrlimit line this PR rewrites, and the resolution keeps that clause inside this PR's rewritten line. The code and test changes are the same as before the rebase, and the tests above were not run again on the new base.

Tests: with this branch on top of main 9f25d0bf5b, guest_getrlimit, guest_setrlimit and the other guest_* tests pass: 464 of 465 pass and guest_video_out_wqhd_detection_no_vulkan is skipped on this machine. The branch was then rebased onto main 5bf2e139ef without conflicts, since upstream changed none of its code or test files, and guest_getrlimit and guest_setrlimit pass there too.

Old code, new test: with Process.cpp reverted to main and the new tests kept, guest_getrlimit and guest_setrlimit abort.

Rebase onto main 6e27fc8f0: after #6201 landed, the branch was rebased onto main 6e27fc8f0, resolving the GuestGetrlimit.cpp conflict with #6201 described under Overlaps; the other files merged without conflicts. With this branch and #7541's branch built in one tree on that main, the guest_* tests pass: 473 of 474, and guest_video_out_wqhd_detection_no_vulkan is skipped on this machine. That is the second of two full runs; the first, right after the build, timed out in four tests this PR does not touch (guest_message_destructor_unshared-decoy, guest_video_out_cursor, guest_app_info, guest_pthread_rwlock). guest_getrlimit and guest_setrlimit also passed 3 runs in a row. With Process.cpp reverted to that main and the new tests kept, guest_getrlimit aborts with getrlimit: unsupported resource 5 and guest_setrlimit with getrlimit: unsupported resource 3. The branch merges cleanly with main 3259e4c3e.

Console: behaviour measured on a PS5 (firmware 12.70), as described above.

Not tested here: Linux (a reviewer reported a Linux run in the comments), and no title.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4909288595 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7543). Originally posted by [ionut27001](https://github.com/ionut27001) on 2026-10-18T13:00:34Z. --- ### What `getrlimit` now answers `RLIMIT_STACK`, `RLIMIT_RSS`, `RLIMIT_MEMLOCK` and `RLIMIT_NPROC` with the limits a payload process reads on a PS5 (firmware 12.70). Before this PR, all four threw `unsupported resource`. | Resource | Payload process, firmware 12.70 (soft and hard) | `main` before this PR | |---|---|---| | `RLIMIT_STACK` (3) | 0x200000 | throws | | `RLIMIT_RSS` (5) | infinity | throws | | `RLIMIT_MEMLOCK` (6) | infinity | throws | | `RLIMIT_NPROC` (7) | 1604 | throws | | null output, any resource 0 to 14 | -1 with `EFAULT` | same (unchanged) | **`setrlimit` side effect:** `setrlimit` reads `getrlimit` first, so it now accepts `RLIMIT_STACK`, `RLIMIT_RSS` and `RLIMIT_MEMLOCK` when the values do not change, as the payload process does. `RLIMIT_NPROC` throws even for its current value, because the limit is not stored here: in the payload process that call succeeds, but `getrlimit` then reads 1443. That fits FreeBSD 11's `setrlimit` clamp to `maxprocperuid`, nine tenths of `maxproc` (cited in the debt entry), if the console's `maxproc` is 1604; `kern.maxproc` fails with `ENOENT` in the payload process (p10), so `maxproc` is not measured. Any other change still throws, as for the other resources whose limit is not stored. **Main thread stack:** in the payload process the main thread's stack is 0x200000 as well (p17, `pthread_attr_get_np`), the same as `RLIMIT_STACK`. Here the main thread runs on the host thread's stack. The debt entry says so; this PR does not change it. **Not established:** these values come from a payload process started through a payload manager. Whether a title process reads the same limits is not measured, and the debt entry says so. **`docs/dev/debt/libkernel.md`:** - **getrlimit:** the entry now records the console's `RLIMIT_DATA` (0x800000000) and `RLIMIT_NOFILE` (13952) readings, and the 12555 descriptor ceiling, measured with the soft limit untouched. This PR does not adopt them, because those two limits follow the host here. It also says that guest locking still follows the host: `mlock` and `sceKernelMlock` fail at the host's hard `RLIMIT_MEMLOCK` on Linux, and on Windows when the working set cannot grow, although `RLIMIT_MEMLOCK` now reports infinity. - **setrlimit:** the entry now records three behaviours of the payload process on the console: - it lowers a requested `RLIMIT_NOFILE` limit of 13952 to 12555, for the hard limit and for the soft limit; - setting STACK, RSS or MEMLOCK to its current value changes nothing; - setting `RLIMIT_NPROC` to its current 1604 succeeds, but `getrlimit` then reads 1443. #### How the console was measured - **Setup:** - The console runs firmware 12.70 and is jailbroken. - The probes are ELF payloads built with [ps5-payload-dev/sdk](https://github.com/ps5-payload-dev/sdk) v0.44 and clang 18.1.8, started through a payload manager. - **Provenance:** the `resolve` lines of p10 and p13 show that their `getrlimit` and `setrlimit` are the ones `libkernel_sys.sprx` exports; p24 prints no resolve lines and links them the same way. - **Method:** - p10 and p13 prefilled their outputs with `0xAA` and logged each `getrlimit` return value. p24's same-value and descriptor cases did neither, so the 1443 that `RLIMIT_NPROC` read after the same-value set comes from a `getrlimit` call whose return value was not logged. - The probes changed only their own limits. p13 lowered the `RLIMIT_NOFILE` soft limit to 1000; setting the original {13952, 13952} back then read 12555 for both. p24 set STACK, RSS, MEMLOCK and NPROC to their current values; NPROC then read 1443. - **Attachment:** sources and the full logs are in the attached [getrlimit-probes.zip](https://github.com/user-attachments/files/33628291/getrlimit-probes.zip). <details><summary>Console output (excerpt, lines copied unchanged)</summary> ``` p10: meta fw=0x12700001 pid=121 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 01:17:42 p13: meta fw=0x12700001 pid=125 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 01:52:02 p17: meta fw=0x12700001 pid=131 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 02:39:47 p24: meta fw=0x12700001 pid=136 sdk=v0.44 compiler=Clang 18.1.8 built=Oct 18 2026 02:48:52 p10: resolve sym=getrlimit module=libkernel_sys.sprx same_as_called=yes p13: resolve sym=setrlimit module=libkernel_sys.sprx same_as_called=yes p10: case getrlimit resource=2 ret=0 errno=0 cur=0x800000000 max=0x800000000 p10: case getrlimit resource=3 ret=0 errno=0 cur=0x200000 max=0x200000 p10: case getrlimit resource=5 ret=0 errno=0 cur=0x7fffffffffffffff max=0x7fffffffffffffff p10: case getrlimit resource=6 ret=0 errno=0 cur=0x7fffffffffffffff max=0x7fffffffffffffff p10: case getrlimit resource=7 ret=0 errno=0 cur=0x644 max=0x644 p10: case getrlimit resource=8 ret=0 errno=0 cur=0x3680 max=0x3680 p10: case sysctl name=kern.maxproc size_ret=-1 errno=2 p24: case getrlimit_null resource=3 ret=-1 errno=14 p24: case getrlimit_null resource=7 ret=-1 errno=14 p24: case dup_ceiling_untouched cur=13952 max=13952 dtablesize=12555 opened=12547 errno=24 highest_fd=12554 p13: case nofile_lowered set_ret=0 set_errno=0 get_ret=0 cur=1000 max=12555 dtablesize=1000 sysconf5=1000 sysconf26=1000 p13: case nofile_restored set_ret=0 set_errno=0 get_ret=0 cur=12555 max=12555 dtablesize=12555 p24: case setrlimit_same resource=3 set_ret=0 errno=0 before_cur=0x200000 before_max=0x200000 after_cur=0x200000 after_max=0x200000 p24: case setrlimit_same resource=5 set_ret=0 errno=0 before_cur=0x7fffffffffffffff before_max=0x7fffffffffffffff after_cur=0x7fffffffffffffff after_max=0x7fffffffffffffff p24: case setrlimit_same resource=6 set_ret=0 errno=0 before_cur=0x7fffffffffffffff before_max=0x7fffffffffffffff after_cur=0x7fffffffffffffff after_max=0x7fffffffffffffff p24: case setrlimit_same resource=7 set_ret=0 errno=0 before_cur=0x644 before_max=0x644 after_cur=0x5a3 after_max=0x5a3 p17: case stack who=main np_ret=0 stack_ret=0 guard_ret=0 size=0x200000 guard=0x4000 local_from_top=1241 p17: case main_usrstack ret=0 usrstack_from_np_top=0 ``` The `pNN:` prefix names the probe; the rest of each line is copied unchanged. `nofile_lowered` is `setrlimit(RLIMIT_NOFILE, {1000, 13952})`, and `nofile_restored` is `setrlimit(RLIMIT_NOFILE, {13952, 13952})`. </details> **Overlaps:** - **#6836 and #7332** (macOS host) rewrite the same `getrlimit` debt line to add the macOS open file limit, and that line still says that the four resources throw. #7332 also moves the `getrlimit` and `setrlimit` lines below `execvp`. Whichever lands second keeps the measured values. - **#6836 and #7332** also change `CheckOpenFileLimit` in `GuestGetrlimit.cpp`. Those hunks are apart from this PR's, and git merges them without a conflict; only the debt line conflicts. - **#7813** has landed; see the rebase note under Tested. - **#6201** has landed. The rebase onto `main` 6e27fc8f0 conflicted with it in `GuestGetrlimit.cpp`, where #6201 replaced the test's check that `getdtablesize` throws with a check of its value; the resolution keeps that check next to this PR's `RLIMIT_STACK` and `RLIMIT_NPROC` checks. **#7039**, which also implements `getdtablesize`, now conflicts with `main` in `Process.cpp`, `GuestGetrlimit.cpp` and the debt file, and this branch adds no other file to that. - **Lines that still call these values unknown:** the socket descriptor numbers entry says that the console's `getdtablesize` is not measured, and the `fcntl` entry calls the console's `RLIMIT_NOFILE` unknown. This PR leaves them alone to stay on its topic and to avoid conflicts with #7403 and #7437, which rewrite the `fcntl` line. Until they are updated, the file contradicts itself there. The `getdtablesize` entry, which #6201 rewrote and #7039 rewrites, says only that `maxfilesperproc` is not measured on the console; this PR records no `maxfilesperproc` reading, so that line does not contradict it. - **#6044** moves the test files, so it needs only a path change on rebase. - **#5918** has landed. Its debt entry says that on Windows a host thread the library did not create is reported from one 64 KiB granule above the bottom of its reservation when everything above that is committed read-write, as in a relinked executable's main thread and its default-size host threads (0x200000 committed of 0x210000 reserved), and that any other such thread, and every such thread on Linux, gets its whole host stack. The main thread still runs on the host thread's stack, so the `getrlimit` entry's "whose size can differ" still holds. **#3965** (Windows) and **#7532** (Linux) run the guest main thread on a stack in the guest arena; if either lands first, the main-thread sentence in the `getrlimit` entry needs updating. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> **Build:** Windows 11 x86-64, full build with WinLibs MinGW-w64 GCC 15.2.0 (posix-seh, ucrt, r7) and `-DBUILD_TESTING=ON`. **Rebase (not re-tested):** after #7813 landed, this branch was rebased onto `main` bbb45463c. The only conflict was in `docs/dev/debt/libkernel.md`: #7813 added the Windows `stdio` stream limit to the `getrlimit` line this PR rewrites, and the resolution keeps that clause inside this PR's rewritten line. The code and test changes are the same as before the rebase, and the tests above were not run again on the new base. **Tests:** with this branch on top of `main` 9f25d0bf5b, `guest_getrlimit`, `guest_setrlimit` and the other `guest_*` tests pass: 464 of 465 pass and `guest_video_out_wqhd_detection_no_vulkan` is skipped on this machine. The branch was then rebased onto `main` 5bf2e139ef without conflicts, since upstream changed none of its code or test files, and `guest_getrlimit` and `guest_setrlimit` pass there too. **Old code, new test:** with `Process.cpp` reverted to `main` and the new tests kept, `guest_getrlimit` and `guest_setrlimit` abort. **Rebase onto `main` 6e27fc8f0:** after #6201 landed, the branch was rebased onto `main` 6e27fc8f0, resolving the `GuestGetrlimit.cpp` conflict with #6201 described under Overlaps; the other files merged without conflicts. With this branch and #7541's branch built in one tree on that `main`, the `guest_*` tests pass: 473 of 474, and `guest_video_out_wqhd_detection_no_vulkan` is skipped on this machine. That is the second of two full runs; the first, right after the build, timed out in four tests this PR does not touch (`guest_message_destructor_unshared-decoy`, `guest_video_out_cursor`, `guest_app_info`, `guest_pthread_rwlock`). `guest_getrlimit` and `guest_setrlimit` also passed 3 runs in a row. With `Process.cpp` reverted to that `main` and the new tests kept, `guest_getrlimit` aborts with `getrlimit: unsupported resource 5` and `guest_setrlimit` with `getrlimit: unsupported resource 3`. The branch merges cleanly with `main` 3259e4c3e. **Console:** behaviour measured on a PS5 (firmware 12.70), as described above. **Not tested here:** Linux (a reviewer reported a Linux run in the comments), and no title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-18 13:36:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T13:36:51Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 6044 core/libs/tests/GuestGetrlimit.cpp
core/libs/tests/GuestSetrlimit.cpp
PR 6149 docs/dev/debt/libkernel.md
PR 6446 docs/dev/debt/libkernel.md
PR 6469 docs/dev/debt/libkernel.md
PR 6519 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6879 core/libs/prx/libkernel/System/src/Process.cpp
PR 6977 docs/dev/debt/libkernel.md
PR 7049 docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7201 core/libs/prx/libkernel/System/src/Process.cpp
PR 7332 core/libs/prx/libkernel/System/src/Process.cpp
core/libs/tests/GuestGetrlimit.cpp
docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7554 docs/dev/debt/libkernel.md
PR 7556 docs/dev/debt/libkernel.md
PR 7605 docs/dev/debt/libkernel.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250562907 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7543#issuecomment-6250562907). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T13:36:51Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libkernel/System/src/Process.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestGetrlimit.cpp`<br>`core/libs/tests/GuestSetrlimit.cpp` | | [PR 6149](https://www.github.com/boykopovar/AnyPS5/pull/6149) | `docs/dev/debt/libkernel.md` | | [PR 6446](https://www.github.com/boykopovar/AnyPS5/pull/6446) | `docs/dev/debt/libkernel.md` | | [PR 6469](https://www.github.com/boykopovar/AnyPS5/pull/6469) | `docs/dev/debt/libkernel.md` | | [PR 6519](https://www.github.com/boykopovar/AnyPS5/pull/6519) | `docs/dev/debt/libkernel.md` | | [PR 6740](https://www.github.com/boykopovar/AnyPS5/pull/6740) | `docs/dev/debt/libkernel.md` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libkernel/System/src/Process.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libkernel.md` | | [PR 7049](https://www.github.com/boykopovar/AnyPS5/pull/7049) | `docs/dev/debt/libkernel.md` | | [PR 7088](https://www.github.com/boykopovar/AnyPS5/pull/7088) | `docs/dev/debt/libkernel.md` | | [PR 7105](https://www.github.com/boykopovar/AnyPS5/pull/7105) | `docs/dev/debt/libkernel.md` | | [PR 7121](https://www.github.com/boykopovar/AnyPS5/pull/7121) | `docs/dev/debt/libkernel.md` | | [PR 7149](https://www.github.com/boykopovar/AnyPS5/pull/7149) | `docs/dev/debt/libkernel.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libkernel/System/src/Process.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libkernel/System/src/Process.cpp`<br>`core/libs/tests/GuestGetrlimit.cpp`<br>`docs/dev/debt/libkernel.md` | | [PR 7509](https://www.github.com/boykopovar/AnyPS5/pull/7509) | `docs/dev/debt/libkernel.md` | | [PR 7554](https://www.github.com/boykopovar/AnyPS5/pull/7554) | `docs/dev/debt/libkernel.md` | | [PR 7556](https://www.github.com/boykopovar/AnyPS5/pull/7556) | `docs/dev/debt/libkernel.md` | | [PR 7605](https://www.github.com/boykopovar/AnyPS5/pull/7605) | `docs/dev/debt/libkernel.md` |
jotitadev commented 2026-10-19 00:01:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T00:01:11Z.

Review: COMMENTED


Linux run, since the description lists only Windows.

Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head 85226f402 merged onto main 84c1a4d9a (clean merge).

  • guest_getrlimit and guest_setrlimit pass.
  • The two test files only, on main: guest_getrlimit aborts with getrlimit: unsupported resource 5 and guest_setrlimit with getrlimit: unsupported resource 3, so both tests cover the new cases.
  • Non-GPU suite (ctest -E "^agc|gpu|vulkan|video_out"): 739/739, same as main.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5565738507 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7543#pullrequestreview-5565738507). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T00:01:11Z. **Review:** COMMENTED --- Linux run, since the description lists only Windows. Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`, full build. Head `85226f402` merged onto `main` `84c1a4d9a` (clean merge). - `guest_getrlimit` and `guest_setrlimit` pass. - The two test files only, on `main`: `guest_getrlimit` aborts with `getrlimit: unsupported resource 5` and `guest_setrlimit` with `getrlimit: unsupported resource 3`, so both tests cover the new cases. - Non-GPU suite (`ctest -E "^agc|gpu|vulkan|video_out"`): 739/739, same as `main`. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
wachi35676 commented 2026-10-19 01:09:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-19T01:09:52Z.


The 1443 that RLIMIT_NPROC reads after setting it to its current 1604 is FreeBSD 11.4's clamp:

1604 × 9 / 10 = 1443.6, which truncates to 1443. So setrlimit(RLIMIT_NPROC) could be modelled exactly, by clamping to 1443 and storing it, instead of throwing. At the least, the debt line can cite this rather than describe 1443 as unexplained.

Windows 11 with GCC 15.2.0, base a373e85e5: guest_getrlimit and guest_setrlimit pass, and abort with Process.cpp reverted.

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6257514573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7543#issuecomment-6257514573). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-19T01:09:52Z. --- The 1443 that `RLIMIT_NPROC` reads after setting it to its current 1604 is FreeBSD 11.4's clamp: - [`init_main.c#L566-L567`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/kern/init_main.c#L566-L567) starts the limit at `maxproc`; - [`subr_param.c#L266`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/kern/subr_param.c#L266) sets `maxprocperuid = (maxproc * 9) / 10`; - [`kern_resource.c#L714-L718`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/kern/kern_resource.c#L714-L718) lowers both limits to `maxprocperuid` in `setrlimit`. 1604 × 9 / 10 = 1443.6, which truncates to 1443. So `setrlimit(RLIMIT_NPROC)` could be modelled exactly, by clamping to 1443 and storing it, instead of throwing. At the least, the debt line can cite this rather than describe 1443 as unexplained. Windows 11 with GCC 15.2.0, base `a373e85e5`: `guest_getrlimit` and `guest_setrlimit` pass, and abort with `Process.cpp` reverted. AI-assisted: yes (Claude Code); results above were run on this machine.
adriadam10 commented 2026-10-20 00:09:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T00:09:31Z.


Checked the diff, the new guest_getrlimit/guest_setrlimit cases (they fail on main with unsupported resource, as @jotitadev's Linux run also shows) and the FreeBSD clamp behind the 1443 reading. The only conflict was the getrlimit debt line that #6836 rewrote for macOS; rebased it onto main, keeping the macOS clause inside your rewritten line. Merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280156493 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7543#issuecomment-6280156493). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T00:09:31Z. --- Checked the diff, the new `guest_getrlimit`/`guest_setrlimit` cases (they fail on `main` with `unsupported resource`, as @jotitadev's Linux run also shows) and the FreeBSD clamp behind the 1443 reading. The only conflict was the `getrlimit` debt line that #6836 rewrote for macOS; rebased it onto `main`, keeping the macOS clause inside your rewritten line. Merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7543
No description provided.