fix(libkernel): return ELOOP when stat follows a symlink loop #6992

Merged
MarcZX10 merged 3 commits from upstream-pr/6992 into main 2026-10-19 16:00:27 +00:00
MarcZX10 commented 2026-10-17 02:24:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:24:53Z.


What

On Windows, sceKernelStat can identify a self-referencing symlink as not found through std::filesystem::status, then _wstat64 fails while following the link and FillFileStat throws. The exception escapes the syscall and aborts the process. This change adds a non-throwing stat helper for this syscall and maps Windows ERROR_CANT_RESOLVE_FILENAME to guest ELOOP through the existing Windows errno translation. Other stat failures return through the regular errno mapping.

Tested

  • Linux GCC 12.2 Release: guest_filesystem_tests builds successfully.
  • Focused CTest starts but aborts before assertions because this host CPU lacks the emulator-required LZCNT, BMI1/2, MOVBE, AVX2, and FMA features. No runtime pass claimed.
  • Added a Linux helper-level self-loop check and a Windows sceKernelStat self-loop assertion. Windows execution is not available here, so the _doserrno mapping and Windows regression remain unverified.
  • python3 tools/check_conventions.py --base upstream/main passes; git diff --check passes.

Checklist

  • Based on current main; no open PR implements the same stat-loop handling
  • Depends on: none
  • One topic per PR
  • Generic behavior, not specific to one title
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4896512050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:24:53Z. --- ### What On Windows, `sceKernelStat` can identify a self-referencing symlink as not found through `std::filesystem::status`, then `_wstat64` fails while following the link and `FillFileStat` throws. The exception escapes the syscall and aborts the process. This change adds a non-throwing stat helper for this syscall and maps Windows `ERROR_CANT_RESOLVE_FILENAME` to guest `ELOOP` through the existing Windows errno translation. Other stat failures return through the regular errno mapping. ### Tested - Linux GCC 12.2 Release: `guest_filesystem_tests` builds successfully. - Focused CTest starts but aborts before assertions because this host CPU lacks the emulator-required LZCNT, BMI1/2, MOVBE, AVX2, and FMA features. No runtime pass claimed. - Added a Linux helper-level self-loop check and a Windows `sceKernelStat` self-loop assertion. Windows execution is not available here, so the `_doserrno` mapping and Windows regression remain unverified. - `python3 tools/check_conventions.py --base upstream/main` passes; `git diff --check` passes. ### Checklist - [x] Based on current `main`; no open PR implements the same stat-loop handling - [x] Depends on: none - [x] One topic per PR - [x] Generic behavior, not specific to one title - [x] AI-assisted: yes
MarcZX10 commented 2026-10-17 02:27:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:27:54Z.


Additional validation: the changed Windows production translation units (NativeStat.cpp and Open.cpp) and GuestFilesystem.cpp pass MinGW-w64 GCC 12.2 -fsyntax-only cross-compilation with _WIN32 and _WIN32_WINNT=0x0602. This verifies Windows API/type compilation only; no Windows runtime or _doserrno value is verified here. The focused Linux target also builds, while CTest remains blocked before assertions by this host CPU feature guard.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228499687 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6228499687). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:27:54Z. --- Additional validation: the changed Windows production translation units (`NativeStat.cpp` and `Open.cpp`) and `GuestFilesystem.cpp` pass MinGW-w64 GCC 12.2 `-fsyntax-only` cross-compilation with `_WIN32` and `_WIN32_WINNT=0x0602`. This verifies Windows API/type compilation only; no Windows runtime or `_doserrno` value is verified here. The focused Linux target also builds, while CTest remains blocked before assertions by this host CPU feature guard.
oneandonlydean commented 2026-10-17 02:34:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T02:34:55Z.


Thanks for this. I dispatched a full Linux + Windows build on 23ea5fdae (https://github.com/boykopovar/AnyPS5/actions/runs/38995470380), so the Windows sceKernelStat(stat-loop) assertion gets its first real run.

Two non-blocking notes from review:

  • SceKernelError(62) could use the existing SCE_KERNEL_ERROR_ELOOP (KernelErrors.hpp).
  • On Linux, sceKernelStat still returns ENOENT for a loop: std::filesystem::status() reports type none with ec == ELOOP, so the earlier exists() check in Open.cpp returns before TryFillFileStat is reached. That's today's behaviour, not a regression, but the PS5 returns ELOOP there. If you want the title to hold on Linux too: after status(), if (error.value() == ELOOP) return SCE_KERNEL_ERROR_ELOOP;, plus a Linux sceKernelStat(loop) == 0x8002003E assertion next to the Windows one.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228568713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6228568713). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T02:34:55Z. --- Thanks for this. I dispatched a full Linux + Windows build on 23ea5fdae (https://github.com/boykopovar/AnyPS5/actions/runs/38995470380), so the Windows `sceKernelStat(stat-loop)` assertion gets its first real run. Two non-blocking notes from review: - `SceKernelError(62)` could use the existing `SCE_KERNEL_ERROR_ELOOP` (`KernelErrors.hpp`). - On Linux, `sceKernelStat` still returns ENOENT for a loop: `std::filesystem::status()` reports type `none` with `ec == ELOOP`, so the earlier `exists()` check in `Open.cpp` returns before `TryFillFileStat` is reached. That's today's behaviour, not a regression, but the PS5 returns ELOOP there. If you want the title to hold on Linux too: after `status()`, `if (error.value() == ELOOP) return SCE_KERNEL_ERROR_ELOOP;`, plus a Linux `sceKernelStat(loop) == 0x8002003E` assertion next to the Windows one.
github-actions[bot] commented 2026-10-17 02:38:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T02:38:10Z.


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/File/src/NativeStat.cpp
core/libs/prx/libkernel/File/src/Open.cpp
PR 6044 core/libs/tests/GuestFilesystem.cpp
PR 6879 core/libs/prx/libkernel/File/src/NativeStat.cpp
PR 6936 core/libs/prx/libkernel/File/src/Open.cpp
PR 6942 core/libs/prx/libkernel/File/src/Open.cpp
PR 7201 core/libs/prx/libkernel/File/src/NativeStat.cpp
core/libs/prx/libkernel/File/src/Open.cpp
PR 7332 core/libs/prx/libkernel/File/src/NativeStat.cpp
core/libs/prx/libkernel/File/src/Open.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228595419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6228595419). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T02:38:10Z. --- <!-- 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/File/src/NativeStat.cpp`<br>`core/libs/prx/libkernel/File/src/Open.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestFilesystem.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libkernel/File/src/NativeStat.cpp` | | [PR 6936](https://www.github.com/boykopovar/AnyPS5/pull/6936) | `core/libs/prx/libkernel/File/src/Open.cpp` | | [PR 6942](https://www.github.com/boykopovar/AnyPS5/pull/6942) | `core/libs/prx/libkernel/File/src/Open.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libkernel/File/src/NativeStat.cpp`<br>`core/libs/prx/libkernel/File/src/Open.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libkernel/File/src/NativeStat.cpp`<br>`core/libs/prx/libkernel/File/src/Open.cpp` |
MarcZX10 commented 2026-10-17 02:40:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:40:34Z.


Addressed in b2d9b59e7: sceKernelStat now maps the std::filesystem::status loop error through SCE_KERNEL_ERROR_ELOOP, the native stat error path uses the same named constant, and the Linux filesystem test asserts the syscall result on a self-referencing symlink. I also filled the PR template after the initial conventions check flagged the missing required fields. The added test and conventions check pass locally; I could not run this fresh worktree’s Linux test because SDL2’s CMake package is unavailable, and Windows execution remains pending hosted CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228618024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6228618024). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:40:34Z. --- Addressed in `b2d9b59e7`: `sceKernelStat` now maps the `std::filesystem::status` loop error through `SCE_KERNEL_ERROR_ELOOP`, the native stat error path uses the same named constant, and the Linux filesystem test asserts the syscall result on a self-referencing symlink. I also filled the PR template after the initial conventions check flagged the missing required fields. The added test and conventions check pass locally; I could not run this fresh worktree’s Linux test because SDL2’s CMake package is unavailable, and Windows execution remains pending hosted CI.
oneandonlydean commented 2026-10-17 03:18:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T03:18:29Z.


Thanks for the Linux mapping. Two things break CI: (1) GuestFilesystem.cpp:672 uses SCE_KERNEL_ERROR_ELOOP, but the test doesn't include prx/libkernel/KernelErrors.hpp, so it doesn't compile (run 38997986325). (2) The new stat-loop symlink is never removed, so the test's final remove_nid_postfix(root) fails with ENOTEMPTY (Windows: Filesystem check failed at line 996 (guest errno 66, Win32 error 145), run 38995470380). Could you unlink it with the other links (Linux: next to unlink_nid_postfix(link...) around line 691; Windows: DeleteFileW(statLoop.c_str()) with the other links around line 742)?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228954756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6228954756). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T03:18:29Z. --- Thanks for the Linux mapping. Two things break CI: (1) `GuestFilesystem.cpp:672` uses `SCE_KERNEL_ERROR_ELOOP`, but the test doesn't include `prx/libkernel/KernelErrors.hpp`, so it doesn't compile (run 38997986325). (2) The new `stat-loop` symlink is never removed, so the test's final `remove_nid_postfix(root)` fails with ENOTEMPTY (Windows: `Filesystem check failed at line 996 (guest errno 66, Win32 error 145)`, run 38995470380). Could you unlink it with the other links (Linux: next to `unlink_nid_postfix(link...)` around line 691; Windows: `DeleteFileW(statLoop.c_str())` with the other links around line 742)?
MarcZX10 commented 2026-10-17 03:25:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T03:25:33Z.


Fixed in 03418d7c3: included KernelErrors.hpp for the named error constant and remove the self-referencing symlink in both the Linux and Windows fixture cleanup paths.

Validation: guest_filesystem_tests builds successfully; check_conventions.py --base upstream/main and git diff --check pass. CTest still stops before the assertions on this Xeon E5-1620 v2 because it lacks the project-required LZCNT/BMI1/BMI2/MOVBE/AVX2/FMA features. The fix is pushed; Windows execution remains for hosted CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229016240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6229016240). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T03:25:33Z. --- Fixed in `03418d7c3`: included `KernelErrors.hpp` for the named error constant and remove the self-referencing symlink in both the Linux and Windows fixture cleanup paths. Validation: `guest_filesystem_tests` builds successfully; `check_conventions.py --base upstream/main` and `git diff --check` pass. CTest still stops before the assertions on this Xeon E5-1620 v2 because it lacks the project-required LZCNT/BMI1/BMI2/MOVBE/AVX2/FMA features. The fix is pushed; Windows execution remains for hosted CI.
MarcZX10 commented 2026-10-17 04:16:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T04:16:02Z.


Thanks for catching the Linux path. The current PR head now checks for too_many_symbolic_link_levels immediately after std::filesystem::status, maps it to SCE_KERNEL_ERROR_ELOOP, and adds a Linux sceKernelStat self-loop assertion. I have not run that assertion on this Xeon host because the test binary stops at the required CPU-feature guard; the Linux/Windows full-build dispatch is still the needed runtime check.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229527457 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6229527457). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T04:16:02Z. --- Thanks for catching the Linux path. The current PR head now checks for too_many_symbolic_link_levels immediately after std::filesystem::status, maps it to SCE_KERNEL_ERROR_ELOOP, and adds a Linux sceKernelStat self-loop assertion. I have not run that assertion on this Xeon host because the test binary stops at the required CPU-feature guard; the Linux/Windows full-build dispatch is still the needed runtime check.
MarcZX10 commented 2026-10-17 04:27:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T04:27:40Z.


The latest head is 03418d7c3. The current Build workflow did not exercise either platform (both Linux and Windows jobs were skipped), so the two fixture cleanup changes in this head still need CI coverage. The full Linux + Windows run dispatched on the earlier head 23ea5fdae did start both jobs, but both test steps concluded with failure; it predates the Linux mapping and fixture-cleanup follow-ups. Could you dispatch a full build for the current head so we can see whether the updated regression test passes on both platforms?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229629808 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6229629808). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T04:27:40Z. --- The latest head is `03418d7c3`. The current Build workflow did not exercise either platform (both Linux and Windows jobs were skipped), so the two fixture cleanup changes in this head still need CI coverage. The full Linux + Windows run dispatched on the earlier head `23ea5fdae` did start both jobs, but both test steps concluded with failure; it predates the Linux mapping and fixture-cleanup follow-ups. Could you dispatch a full build for the current head so we can see whether the updated regression test passes on both platforms?
LeandroLP23 commented 2026-10-17 06:22:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-17T06:22:12Z.


Windows runtime check, since the description has none: the self-loop assertion runs, passes with this head, and reproduces #6983 without it.

Windows 11 (26300), Ryzen AI 7 350, WinLibs GCC 15.2.0, Release, Developer Mode on (without it the test prints Windows lstat link checks skipped and never reaches the self-loop). main 6a32550fd with this head 03418d7c3 merged; ctest -R '^guest_filesystem$':

Tree Result
this PR passes 3 of 3, with the stat-loop assertion (sceKernelStat returns 0x8002003E) reached
this PR's GuestFilesystem.cpp over main's NativeStat/Open/WindowsFileTime 0xC0000409: [libc] unhandled exception 'St13runtime_error', what(): FillFileStat: stat failed for ...\stat-loop

So the Windows translation of the self-loop failure to ELOOP works here. I did not capture _doserrno separately.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6230635309 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6230635309). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-17T06:22:12Z. --- Windows runtime check, since the description has none: the self-loop assertion runs, passes with this head, and reproduces #6983 without it. Windows 11 (26300), Ryzen AI 7 350, WinLibs GCC 15.2.0, Release, Developer Mode on (without it the test prints `Windows lstat link checks skipped` and never reaches the self-loop). `main` `6a32550fd` with this head `03418d7c3` merged; `ctest -R '^guest_filesystem$'`: | Tree | Result | |---|---| | this PR | passes 3 of 3, with the `stat-loop` assertion (`sceKernelStat` returns `0x8002003E`) reached | | this PR's `GuestFilesystem.cpp` over `main`'s `NativeStat`/`Open`/`WindowsFileTime` | `0xC0000409`: `[libc] unhandled exception 'St13runtime_error'`, `what(): FillFileStat: stat failed for ...\stat-loop` | So the Windows translation of the self-loop failure to ELOOP works here. I did not capture `_doserrno` separately. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-17 13:18:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:18:05Z.


Thanks for the Windows runtime check. It reaches the self-loop assertion, returns guest ELOOP, and the control reproduces the original abort, which verifies the Windows path on the current head. Linux execution is still pending because this host stops at its CPU-feature guard and hosted platform jobs were skipped; I’ll keep that limitation visible while awaiting a Linux-capable run.

AI-assisted: yes (Codex); report reviewed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234347500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6234347500). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T13:18:05Z. --- Thanks for the Windows runtime check. It reaches the self-loop assertion, returns guest ELOOP, and the control reproduces the original abort, which verifies the Windows path on the current head. Linux execution is still pending because this host stops at its CPU-feature guard and hosted platform jobs were skipped; I’ll keep that limitation visible while awaiting a Linux-capable run. AI-assisted: yes (Codex); report reviewed.
MarcZX10 commented 2026-10-17 14:03:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T14:03:39Z.


Thanks for the Windows run with Developer Mode enabled and for the parent-source negative control. It confirms the self-loop assertion is reached and translated to ELOOP on this Windows setup; I have noted that _doserrno was not captured separately.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234831444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6234831444). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T14:03:39Z. --- Thanks for the Windows run with Developer Mode enabled and for the parent-source negative control. It confirms the self-loop assertion is reached and translated to ELOOP on this Windows setup; I have noted that `_doserrno` was not captured separately.
jotitadev commented 2026-10-17 15:16:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-17T15:16:28Z.

Review: COMMENTED


Linux runtime result for the new self-loop assertions, since the thread notes Linux execution is still pending (the author's Xeon stops at the host CPU guard).

Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head 03418d7c3 merged onto main 40315fcf8 (clean merge).

  • guest_filesystem passes with the PR, 5 of 5 runs, so on Linux both TryFillFileStat on the loop (errno == ELOOP) and sceKernelStat (SCE_KERNEL_ERROR_ELOOP) hold. The other stat, open and filesystem tests (ctest -R "filesystem|stat|open|symlink|kernel_sys|posix_scalar", 36 tests) also pass.
  • PR with only Open.cpp as on main (keeping the new TryFillFileStat, so the test still builds): guest_filesystem aborts. The test file alone does not build on main, since it calls File::TryFillFileStat.
  • Non-GPU suite (ctest -E "^agc|gpu|vulkan|video_out"): 682/682, same as main on this machine. In a first suite run guest_dynamic_loader_fixed_base aborted once; it then passed 10 of 10 on its own both with the PR and on main, and the full suite rerun passed, so I count it as unrelated.

Not checked: Windows (covered above), macOS.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5558427780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#pullrequestreview-5558427780). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-17T15:16:28Z. **Review:** COMMENTED --- Linux runtime result for the new self-loop assertions, since the thread notes Linux execution is still pending (the author's Xeon stops at the host CPU guard). Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`, full build. Head `03418d7c3` merged onto `main` `40315fcf8` (clean merge). - `guest_filesystem` passes with the PR, 5 of 5 runs, so on Linux both `TryFillFileStat` on the loop (`errno == ELOOP`) and `sceKernelStat` (`SCE_KERNEL_ERROR_ELOOP`) hold. The other stat, open and filesystem tests (`ctest -R "filesystem|stat|open|symlink|kernel_sys|posix_scalar"`, 36 tests) also pass. - PR with only `Open.cpp` as on `main` (keeping the new `TryFillFileStat`, so the test still builds): `guest_filesystem` aborts. The test file alone does not build on `main`, since it calls `File::TryFillFileStat`. - Non-GPU suite (`ctest -E "^agc|gpu|vulkan|video_out"`): 682/682, same as `main` on this machine. In a first suite run `guest_dynamic_loader_fixed_base` aborted once; it then passed 10 of 10 on its own both with the PR and on `main`, and the full suite rerun passed, so I count it as unrelated. Not checked: Windows (covered above), macOS. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-17 15:25:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T15:25:03Z.


Thanks for running the Linux regression and negative control. This closes the Linux runtime gap: guest_filesystem passes 5/5 with the self-loop mapping, and the control aborts when Open.cpp is reverted. The broader non-GPU suite also matches main at 682/682. The Windows runtime result from Leandro covers the other platform; macOS remains untested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235716958 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6235716958). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T15:25:03Z. --- Thanks for running the Linux regression and negative control. This closes the Linux runtime gap: `guest_filesystem` passes 5/5 with the self-loop mapping, and the control aborts when `Open.cpp` is reverted. The broader non-GPU suite also matches main at 682/682. The Windows runtime result from Leandro covers the other platform; macOS remains untested.
MarcZX10 commented 2026-10-17 23:51:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T23:51:03Z.


Rebased onto current main bd5856170 and resolved the Open.cpp conflict while preserving NativeMetadataPath extended-path handling and the non-throwing stat error path. The guest_filesystem_tests target builds on Linux; guest_filesystem aborts before assertions because this Xeon E5-1620 v2 host lacks required AVX2/LZCNT/BMI/FMA features. check_conventions.py --base upstream/main and git diff --check pass. Current hosted conventions/eligibility/report checks pass; platform build/test jobs are skipped by path selection. The branch is mergeable.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243362447 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6243362447). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T23:51:03Z. --- Rebased onto current main `bd5856170` and resolved the `Open.cpp` conflict while preserving `NativeMetadataPath` extended-path handling and the non-throwing stat error path. The `guest_filesystem_tests` target builds on Linux; `guest_filesystem` aborts before assertions because this Xeon E5-1620 v2 host lacks required AVX2/LZCNT/BMI/FMA features. `check_conventions.py --base upstream/main` and `git diff --check` pass. Current hosted conventions/eligibility/report checks pass; platform build/test jobs are skipped by path selection. The branch is mergeable.
jotitadev commented 2026-10-18 10:09:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T10:09:50Z.

Review: COMMENTED


Re-run on the rebased head b34bf86d9, since the Open.cpp conflict resolution has no runtime result yet (the author's host stops at the CPU guard and the platform jobs were skipped). My earlier run was on 03418d7c3.

Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head b34bf86d9 merged onto main 9caecfd2d (clean merge).

  • guest_filesystem passes, including both self-loop checks (TryFillFileStat with errno 40 and sceKernelStat returning SCE_KERNEL_ERROR_ELOOP). The other filesystem/stat tests also pass (ctest -R "filesystem|stat|symlink|open", 36 tests, the VideoOut ones skipped as on main).
  • This PR with only Open.cpp taken from main: guest_filesystem aborts at the sceKernelStat self-loop check, which gets 0x80020002 (ENOENT) instead. So the resolved Open.cpp still carries the fix and the test still covers it.
  • Non-GPU suite (ctest -E "^agc|gpu|vulkan|video_out"): 712/712, same as main.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5562495841 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#pullrequestreview-5562495841). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-18T10:09:50Z. **Review:** COMMENTED --- Re-run on the rebased head `b34bf86d9`, since the `Open.cpp` conflict resolution has no runtime result yet (the author's host stops at the CPU guard and the platform jobs were skipped). My earlier run was on `03418d7c3`. Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`, full build. Head `b34bf86d9` merged onto `main` `9caecfd2d` (clean merge). - `guest_filesystem` passes, including both self-loop checks (`TryFillFileStat` with errno 40 and `sceKernelStat` returning `SCE_KERNEL_ERROR_ELOOP`). The other filesystem/stat tests also pass (`ctest -R "filesystem|stat|symlink|open"`, 36 tests, the VideoOut ones skipped as on `main`). - This PR with only `Open.cpp` taken from `main`: `guest_filesystem` aborts at the `sceKernelStat` self-loop check, which gets `0x80020002` (ENOENT) instead. So the resolved `Open.cpp` still carries the fix and the test still covers it. - Non-GPU suite (`ctest -E "^agc|gpu|vulkan|video_out"`): 712/712, same as `main`. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
cadenasynyster commented 2026-10-18 17:00:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cadenasynyster on 2026-10-18T17:00:48Z.


Windows run on the rebased head b34bf86d9 (the earlier Windows run was on 03418d7c3), merged onto current main (889cee5f9). Windows 11, MinGW GCC 15.2.0, Developer Mode on.

  • guest_filesystem: 3 of 3 runs pass, one at a time.
  • Negative control: with only Open.cpp taken from main and everything else from this PR, the test aborts (exit code 0xc0000409).
  • The merge onto main had no conflicts.

Not run: macOS, other Windows configurations, Developer Mode off.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252627740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6252627740). Originally posted by [cadenasynyster](https://github.com/cadenasynyster) on 2026-10-18T17:00:48Z. --- Windows run on the rebased head b34bf86d9 (the earlier Windows run was on 03418d7c3), merged onto current main (889cee5f9). Windows 11, MinGW GCC 15.2.0, Developer Mode on. - `guest_filesystem`: 3 of 3 runs pass, one at a time. - Negative control: with only `Open.cpp` taken from main and everything else from this PR, the test aborts (exit code 0xc0000409). - The merge onto main had no conflicts. Not run: macOS, other Windows configurations, Developer Mode off. AI-assisted: yes
MarcZX10 commented 2026-10-18 22:07:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T22:07:18Z.


Thanks for rerunning the rebased head b34bf86d9 on Windows. The 3/3 filesystem runs and the negative control that reverts Open.cpp confirm the fix remains effective on this head. This complements the Linux run on the same head, where the self-loop checks pass and the reverted control fails. macOS remains untested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255740050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6255740050). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T22:07:18Z. --- Thanks for rerunning the rebased head `b34bf86d9` on Windows. The 3/3 filesystem runs and the negative control that reverts `Open.cpp` confirm the fix remains effective on this head. This complements the Linux run on the same head, where the self-loop checks pass and the reverted control fails. macOS remains untested.
adriadam10 commented 2026-10-19 16:02:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T16:02:09Z.


Rebased onto current main. The only conflict was in Open.cpp: main now maps too_many_symbolic_link_levels through FilesystemError (guest 62 = SCE_KERNEL_ERROR_ELOOP), so I kept main's line and dropped the duplicate Linux mapping from this PR. The non-throwing TryFillFileStat, the Windows ERROR_CANT_RESOLVE_FILENAME → ELOOP translation and the Linux/Windows self-loop assertions are unchanged. Build and ctest of the affected scope pass; also confirmed by the Windows and Linux runs in the thread. Merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6271528617 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6992#issuecomment-6271528617). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T16:02:09Z. --- Rebased onto current main. The only conflict was in `Open.cpp`: main now maps `too_many_symbolic_link_levels` through `FilesystemError` (guest 62 = `SCE_KERNEL_ERROR_ELOOP`), so I kept main's line and dropped the duplicate Linux mapping from this PR. The non-throwing `TryFillFileStat`, the Windows `ERROR_CANT_RESOLVE_FILENAME` → `ELOOP` translation and the Linux/Windows self-loop assertions are unchanged. Build and ctest of the affected scope pass; also confirmed by the Windows and Linux runs in the thread. 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!6992
No description provided.