libc: fopen aborts on the movie directory scan in PPSA99902 (Windows, conditional integration) #4814
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 Amoenus on 2026-10-12T22:43:40Z.
Observed stop
Sonic Unleashed Recompiled, PPSA99902 / 01.003.000, exits before rendering when its directory scan attempts:
Inspireis an existing directory. A refreshed conditional integration 6cc5beb7f, based on main5f01c8082, reproduces the stop in 9.998 seconds, exit0xC0000409, no timeout or frames. A second replay with verified scalar logging in libc only confirms moderband reproduces the same stop in 9.626 seconds. The failed first observer preparation did not contain the logging marker and is not mode evidence.This is conditional title validation, not a whole-main title launch. Original executable/bundled libc, all baseline runtime files, converted guest module and saved user data were restored and verified after each replay. No proprietary assets/code/captures attached.
Source and contract
The integration makes no change to
core/libs/prx/libc/src/FileAndHeap.cpp. That file is also unchanged between main5f01c8082and later main43e3a70f8. Its WindowsOpenNativecallsCreateFileWwithFILE_ATTRIBUTE_NORMAL; Microsoft's directory-handle documentation requiresFILE_FLAG_BACKUP_SEMANTICSfor directories. The mapped failure reachesfopen_nid_postfix, whose current failure branch returns null only for ENOENT or an exclusive EEXIST, searches sibling filenames, and otherwise throws.FreeBSD 11.4 fopen(3), pinned source specifies a null result plus errno when opening fails. A normal backend open failure therefore must not become an uncaught host exception. Whether Windows should model a successful read-only directory stream, as FreeBSD can, is a separate semantic question; a null return for this host failure does not prove console directory-stream equivalence.
Native regression and proposed fix
On unchanged production main
43e3a70f8143f014f621c48abbdb137fffd7346e, adding a temporary-directory regression to the existingfile_streamsfixture reproduces the uncaught failure: CTest reports exit0xC0000409in 0.44 seconds. The focused candidate removes sibling-name probing and the exception branch, returning null with the native backend errno for failed opens. The initial fixture then passes 20 consecutive executions (0.01–0.12 seconds observed per execution), retaining the existing successful stream, Unicode/delete-sharing, append/exclusive-create, missing-file and invalid-argument checks.Existing upstream solution and next validation
PR #4822, by MarcZX100, now implements the same general failed-open NULL/errno correction, with a directory regression (
rbon Windows,wbon POSIX). I inspected exact head77ede919c460fbe1acbfe2bf4d927fb3db0a6416; the author reports Debian 12 / GCC12.2 Release validation in their comment. Those Linux results are the author's report, not my local execution.Independent Windows validation of #4822's exact head now passes: all five filesystem/stream groups ×20 (100 executions, no skips). Keeping its regression fixture unchanged while rebuilding main
43e3a70f8'sFileAndHeap.cppreproduces the permission-denied abort; restoring the PR implementation passes. Native target builds, conventions and diff checks pass. The complete commands, OS/toolchain, observed durations and scope are in our validation comment. Tracked source is restored/clean. Full Windows build/libraries and NVIDIA suite now pass (1011 passed /0 failed /8 skipped of1019; maximum22.809s). Conditional title comparison now completed: Sonic Unleashed Recompiled, PPSA99902 / 01.003.000, same fixed f609 conversion and frozen 6cc runtime. Fresh control aborts at the existingInspiredirectory /fopenpermission-denied exception after 10.126s. Replacing only libc.prx with the integration build of your exactFileAndHeap.cpp(retaining the game's private prerequisite exports) changes the observed abort topoll: descriptor 3 is not a socket/ descriptor5 on another thread after 9.981s. All other123 runtime-library hashes and executable hash match. Both runs exit0xC0000409 with no frames or timeout; originals, runtime, converted guest and user data are restored/hash-verified. This removes the observed fopen exception from the replay; it does not establish rendering, gameplay or unchanged whole-main startup. The next poll guard is already tracked in #3521, with overlapping open #3644/#3649; the follow-up observer confirms read pipes, and the #3644 kernel-only comparison now renders startup and reaches the existing private MSAA guard after789.240s. Originals/runtime/user data are restored; gameplay and whole-main startup remain unverified.Our independently prepared focused fork candidate
1ed378e959also passes the final strengthened fixture and the same five groups ×20 on Windows. It adds rb/wb/ab/r+b directory error checks and records the unmodeled Windows/FreeBSD directory-stream difference. The experimental adaptation14f4611c69is preserved in the fork with an identicalFileAndHeap.cpp; it is preserved as an intermediate branch; the exact-#4822 adaptation at088e3512bsupplies the libc-only comparison above. #4822 is the upstream solution to validate; our next own PR will use another topic. Original assets, baseline runtime and user data remain preserved. AI-assisted: Codex.The read-only directory-stream difference remains separate technical debt: returning null for Windows EACCES follows the failed-open contract, but does not implement successful FreeBSD-style directory streams or prove console behavior. AI-assisted: Codex.
Environment: Windows 11 Enterprise 26200, WinLibs GCC 15.2.0 r7 / Release, NVIDIA RTX5080. The refreshed integration passes its full native NVIDIA suite (1027 passed / 0 failed / 8 skipped of 1035) and 15 selected groups five times; these existing tests did not catch this title stop. Related #4735 is an fdopen append error, and closed #2329/#2588 concern UTF-8 paths; searches for fopen/directory, Inspire and fopen/EACCES found no report of this stop. No cause bisect against the older integration is claimed.
Shared title progress: #4443. AI-assisted: yes (Codex); author responsible.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T22:57:25Z.
I reproduced the host-independent failure path with an existing directory fixture:
file_streamsaborts on currentmainwith the uncaughtfopen_nid_postfix: open failed ... Is a directoryexception, and passes with the change.The fix is in PR #4822: https://github.com/boykopovar/AnyPS5/pull/4822. On Debian 12 x86-64 / GCC 12.2 Release,
file_streams,guest_fiopen,guest_standard_streams,guest_directoryandguest_filesystempass (5/5), and conventions pass. The regression usesrbon Windows (the reported case) andwbon POSIX, where reading a directory is allowed. Hosted Windows checks are still pending; I have not run the title.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:41:14Z.
Closing: fixed on main by #4822 (fopen returns the native open error instead of aborting). If it still happens on current main, comment here with the title ID and the log line.