libkernel: pthread_atfork, mlockall and getdtablesize are absent (XPSemu, VLC); branch ready #3628
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-11T14:26:26Z.
libkernel lacks
pthread_atfork(U9t5kJAWPnA),mlockall(x7g7Ebeo8-U) andgetdtablesize(sZuwaDPATKs). From the relink registry order they are predicted stops of XPSemu (PPSA97358, indices 255, 201, 395) and VLC (PPSA85300,getdtablesizeat 354 after #3556); not yet observed in a run. XPSemu callspthread_atforkfrom a constructor (util/rcu.c:488-495), so that one must return.Branch ready:
screamm:feat/libkernel-xpsemu-process(three commits onmaina11c8f7f:f37bccf6feat(libkernel): implement pthread_atfork,87f4aa33feat(libkernel): add mlockall,774670defeat(libkernel): add getdtablesize). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are.pthread_atfork(newPthread/Posix/Atfork.cpp): appends the three handlers to a locked list and returns 0 (ENOMEMon allocation failure), as FreeBSD 11.4 libthrthr_fork.c(8c639945); null handlers accepted; the handlers never run becauseforkthrows here, which is recorded, and the list is exposed throughPthreadAtforkHandlers_nid_no_patch()for a futurefork. Newguest_pthread_atforkchecks order, null handlers, concurrent registration from four threads, and that nothing runs.mlockall(flags):EINVALfor 0 or bits outsideMCL_CURRENT|MCL_FUTURE(FreeBSDvm_mmap.c); valid flags throw naming the flag, because no mapping path can lock future mappings andmlockpins host pages range by range without a record to build on; XPSemu only calls it with-overcommit mem-lock=on.guest_mlockgains the cases.getdtablesize: FreeBSD's syscall returnsmin(RLIMIT_NOFILE, kern.maxfilesperproc)(kern_descrip.c), and no public source (shadPS4, KytyPS5, OpenOrbis, fpPS4 placeholder, SharpProspero) gives the console's descriptor limit, so it throws likegetrlimit(RLIMIT_NOFILE)still does; the export alone lets VLC and XPSemu load, and both call it only from their ownclosefrom, which XPSemu does not use.guest_getrlimitchecks the throw.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs: the three tests 3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"534/537, the failures being the knownwindows_exceptions(#3411),guest_kernel_sys(#3510) andguest_filesystem(#3518); withmain'sProcess.cppthe extended getrlimit test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T14:44:58Z.
I carried the three commits from David’s ready branch into PR #3650, preserving his authorship. The PR adds
pthread_atfork,mlockall, andgetdtablesizeas separate commits, with their known limits recorded in TechnicalDebt. On Linux/GCC 12.2 Release, all three targeted tests passed; conventions andgit diff --checkpass on currentmain. The PR text distinguishes the issue author’s Windows test report from my local run. The predicted title stops remain unobserved in a title run.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T08:33:52Z.
I carried the
mlockallandgetdtablesizeparts of the offered branch into PR #4386, preserving David’s authorship. Linux Release GCC 12.2 builtguest_mlock_testsandguest_getrlimit_tests; both focused tests passed, along with conventions/diff checks. The PR documents that valid mlock operations and the console descriptor limit remain unsupported.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:09:20Z.
Closing:
pthread_atfork(#4377) andmlockall(#4386) are on main.getdtablesizeisn't; it can go in when a title stops on it, so comment here with the title ID and the log line if VLC or XPSemu does.