macOS: guest paths near PATH_MAX fail with ENAMETOOLONG because the host path adds the emulator root #22270
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 Jazeupoi on 2026-11-17T10:50:57Z.
What happens
On macOS,
guest_kernel_sysandguest_kernel_sys_execvefail on guest paths near the 1024-byte guestPATH_MAX(Kernel sys check failed at line 1323 (guest errno 63)andexecve with a 1023 byte pathname did not reach the lookup), because the host path built from them exceeds macOS's own 1024-bytePATH_MAX.Title, test or build step
guest_kernel_sys,guest_kernel_sys_execveAnyPS5 commit
maine798a424c7with #17425 and #11049 merged (needed for the macOS build).System
macOS 27.0.1, Apple M4 (GPU not used by these tests), Apple clang 21.0.0 (SDK 27.2), x86-64 Release build under Rosetta 2.
Steps to reproduce
Both fail within a few seconds.
Log
What was checked
guest_kernel_sysfails inCheckRawGetcwdPathLimit:mkdiratof the leaf that makes the working directory 1023 bytes long fails withENAMETOOLONG.guest_kernel_sys_execveexpectsENOENTfrom the lookup of a 1023-byte relative path. I haven't traced that one, but it's most likely the same cause.Resolve/state.rootinGeneral.cpp,GetDirectoryDescriptorPath_nid_no_patchinmkdirat). macOS rejects host paths of 1024 bytes or more withENAMETOOLONG(Linux allows 4096), so a guest path longer than about 1024 minus the root's length fails before the lookup. The Linux CI doesn't hit it, and the getcwd limit test is skipped on Windows.guest_kernel_sysbut not this check.PATH_MAX. For example, walk long paths withopenatand a directory descriptor, then use the*atcall on the last component. That touches every path entry point (mkdir,open,stat,chdir,unlink,rename, ...), so I'm reporting it first rather than opening a large PR.AI-assisted: yes (Claude Code)