Linux: sceKernelClose(0) closes the host's stdin, the next opened file gets descriptor 0, and a later close(0) closes it mid-read (PPSA13579); fixed by #3295 #4223
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 eliyarson on 2026-10-12T01:45:23Z.
Symptom
Blasphemous 2 (PPSA13579) on Linux crashes during asset loading at a different point in each run. With a local fix for its
PSNCorestart (#4225), 7 runs under gdb ended like this:reserve/assign.Cause
sceKernelClose(0)102 times: after closing a real file it closes 0 as well (CLOSE fd=7; CLOSE fd=0).sceKernelOpenreturns descriptor 0 for real files (ScriptingAssemblies.json,unity_builtin_extra,Script_monoscripts.bundle).sceKernelClose(0)on one thread closes the file another thread is reading. That thread'spreadthen returns 0 bytes or fails with EBADF:Fix
#3295 (by @SynnZer0, closed automatically by the intake pause, not reviewed) makes
closeandsceKernelClosefail with EBADF for descriptors 0–2 that were open when libkernel loaded, and leaves them open. I cherry-picked it unchanged ontoa11c8f7f7(no conflicts; the diff is identical to the PR head).a11c8f7f7+ PSNCore fixBuilt on Linux (CachyOS, GCC, RTX 3080 Ti). The File test subset passes, including #3295's own
guest_host_streams, and so docheck_conventionsandcheck_test_registration.Could #3295 be reopened when intake resumes? The PR's own description names PPSA21703 for the same pattern.
Related
sceKernelClosereturns EBADF for a descriptor that is not open. #3295 extends that to the host's open standard streams.Open.cppandStdio.cpp(fcntl/ioctl), the same files #3295 changes, so one of them will need rebasing.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T02:47:41Z.
Reopened #3295; it still merges cleanly onto main. Your table (5 of 7 runs crash without it, 0 of 16 with it) is the evidence it was missing.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T18:45:42Z.
Fixed by #3295 (merged):
closeandsceKernelCloseno longer close the host's descriptors 0 to 2. Closing; please reopen if PPSA13579 still loses a descriptor on current main.