fix(libc): run guest finalizers before driver shutdown #5978

Merged
MarcZX10 merged 3 commits from upstream-pr/5978 into main 2026-10-16 23:07:48 +00:00
MarcZX10 commented 2026-10-14 17:59:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T17:59:39Z.


What

For an explicit guest exit() or return from main, run the guest's C++ finalizers before the AGC/VideoOut shutdown callbacks. This keeps those drivers available to finalizers that use them. The shutdown callbacks still run once, after the finalizers, including when a finalizer calls nested exit().

This is the explicit guest-exit path from #5931. Host window-close requests continue through #5843's no-handler path. Depends on #5843 (which depends on #5236).

Tested

  • Rebased onto current main 8cd937e29; git diff --check and the template-aware conventions check pass.
  • Debian 12 / GCC 12.2 / Ninja Release with testing enabled: configured a fresh build and built tests/guest_system_exit_tests successfully (712 build steps, including libc.prx, libSceSystemService.prx, and the test executable).
  • Ran guest_exit_finalizers_before_shutdown, guest_system_exit, guest_return_from_main, guest_system_relaunch, and guest_nested_exit. All five processes aborted before test logic at the emulator host-CPU guard: this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2, and FMA. No CTest case is reported as passing on this host.
  • A focused Process.cpp probe passed on the pre-rebase head; it has not been rerun on this rebased head. No Windows or title runtime was tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #5843, #6583
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4862203385 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T17:59:39Z. --- ### What For an explicit guest `exit()` or return from main, run the guest's C++ finalizers before the AGC/VideoOut shutdown callbacks. This keeps those drivers available to finalizers that use them. The shutdown callbacks still run once, after the finalizers, including when a finalizer calls nested `exit()`. This is the explicit guest-exit path from #5931. Host window-close requests continue through #5843's no-handler path. Depends on #5843 (which depends on #5236). ### Tested - Rebased onto current `main` `8cd937e29`; `git diff --check` and the template-aware conventions check pass. - Debian 12 / GCC 12.2 / Ninja Release with testing enabled: configured a fresh build and built `tests/guest_system_exit_tests` successfully (712 build steps, including `libc.prx`, `libSceSystemService.prx`, and the test executable). - Ran `guest_exit_finalizers_before_shutdown`, `guest_system_exit`, `guest_return_from_main`, `guest_system_relaunch`, and `guest_nested_exit`. All five processes aborted before test logic at the emulator host-CPU guard: this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2, and FMA. No CTest case is reported as passing on this host. - A focused `Process.cpp` probe passed on the pre-rebase head; it has not been rerun on this rebased head. No Windows or title runtime was tested. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #5843, #6583 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
ahmad3a4 commented 2026-10-14 18:19:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmad3a4 on 2026-10-14T18:19:56Z.


Windows validation of #5843 + this PR, from the #5931 report:

Setup: Windows 11 Pro (26200), Core i5-13400 (passes the CPU guard), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. main ed835aa7, then #5843 (e0748f37, carrying #5236 as 9655d0c8), then this PR (c6b42bf8) merged on top.

Conflicts when this PR goes on top of #5843:

  • Process.cpp: #5843 has StartExit() running LibcRunShutdown_nid_postfix(), and this PR has BeginExit() without it. I kept the name StartExit, took the shutdown out of it, and called LibcRunShutdown_nid_postfix() in LibcExitWithoutHandlers_nid_no_patch before the flush. Without that call, a resolution that just takes this PR's version would leave the window-close path terminating without running the AGC/VideoOut shutdown callbacks.
  • libSceSystemService/CMakeLists.txt: I kept #5843's guest_system_exit/guest_requested_exit expectations ("Guest shutdown completed", plus the FAIL expression), added guest_exit_finalizers_before_shutdown, and put it in the Windows PATH list as well.

Results:

  • All 10 exit tests pass: guest_system_exit, guest_requested_exit, guest_exit_finalizers_before_shutdown, guest_nested_exit, guest_return_from_main, guest_quick_exit, guest_immediate_exit, guest_system_relaunch, guest_system_exit_parameters and guest_thread_atexit.
  • Syobon Action (PPSA47402, #5932) closed with WM_CLOSE after it presents 300 to 600 frames: 3 of 3 runs end with exit code 0 and no abort. On main e34c4792 it was 4 of 4 exit thread cannot wait for itself aborts with 0xC0000409.
  • That close goes through #5843's no-handler path. This PR's own path is covered here only by guest_exit_finalizers_before_shutdown, since Syobon has no exit of its own.

Linux not run.

AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175265846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6175265846). Originally posted by [ahmad3a4](https://github.com/ahmad3a4) on 2026-10-14T18:19:56Z. --- Windows validation of #5843 + this PR, from the #5931 report: **Setup:** Windows 11 Pro (26200), Core i5-13400 (passes the CPU guard), WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. `main` ed835aa7, then #5843 (e0748f37, carrying #5236 as 9655d0c8), then this PR (c6b42bf8) merged on top. **Conflicts when this PR goes on top of #5843:** - `Process.cpp`: #5843 has `StartExit()` running `LibcRunShutdown_nid_postfix()`, and this PR has `BeginExit()` without it. I kept the name `StartExit`, took the shutdown out of it, and called `LibcRunShutdown_nid_postfix()` in `LibcExitWithoutHandlers_nid_no_patch` before the flush. Without that call, a resolution that just takes this PR's version would leave the window-close path terminating without running the AGC/VideoOut shutdown callbacks. - `libSceSystemService/CMakeLists.txt`: I kept #5843's `guest_system_exit`/`guest_requested_exit` expectations ("Guest shutdown completed", plus the FAIL expression), added `guest_exit_finalizers_before_shutdown`, and put it in the Windows `PATH` list as well. **Results:** - All 10 exit tests pass: `guest_system_exit`, `guest_requested_exit`, `guest_exit_finalizers_before_shutdown`, `guest_nested_exit`, `guest_return_from_main`, `guest_quick_exit`, `guest_immediate_exit`, `guest_system_relaunch`, `guest_system_exit_parameters` and `guest_thread_atexit`. - Syobon Action (PPSA47402, #5932) closed with `WM_CLOSE` after it presents 300 to 600 frames: 3 of 3 runs end with exit code 0 and no abort. On `main` e34c4792 it was 4 of 4 `exit thread cannot wait for itself` aborts with `0xC0000409`. - That close goes through #5843's no-handler path. This PR's own path is covered here only by `guest_exit_finalizers_before_shutdown`, since Syobon has no exit of its own. Linux not run. AI-assisted.
MarcZX10 commented 2026-10-15 00:56:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T00:56:19Z.


Rebased onto current main (8cd937e29) and resolved the exit-path conflicts. The current StartExit() preserves the newer host-window-close flow; explicit LibcExit_nid_no_patch() runs guest C++ finalizers before LibcRunShutdown_nid_postfix(), while LibcExitWithoutHandlers_nid_no_patch() still runs shutdown callbacks before terminating. The new finalizer-order test and existing guest exit/relaunch/nested-exit tests compile. I ran those five CTests, but all abort at the existing host CPU feature guard before their test bodies on this Xeon E5-1620 v2, so I am not claiming a passing runtime test here. Current conventions check passes; hosted checks are running.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181881934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6181881934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T00:56:19Z. --- Rebased onto current `main` (`8cd937e29`) and resolved the exit-path conflicts. The current `StartExit()` preserves the newer host-window-close flow; explicit `LibcExit_nid_no_patch()` runs guest C++ finalizers before `LibcRunShutdown_nid_postfix()`, while `LibcExitWithoutHandlers_nid_no_patch()` still runs shutdown callbacks before terminating. The new finalizer-order test and existing guest exit/relaunch/nested-exit tests compile. I ran those five CTests, but all abort at the existing host CPU feature guard before their test bodies on this Xeon E5-1620 v2, so I am not claiming a passing runtime test here. Current conventions check passes; hosted checks are running.
MarcZX10 commented 2026-10-15 01:10:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T01:10:39Z.


Hosted checks have now finished: Ubuntu, Windows and macOS relinker jobs all pass; register-context and write-watch jobs pass as well. Linux and Windows full-build jobs were skipped by path filters. The five local exit CTests still stop at this host’s CPU-feature guard before their test bodies, so I am not claiming a local runtime pass. The Windows title results earlier in this thread remain @ahmad3a4’s separate validation of the prior stacked head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182055772 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6182055772). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T01:10:39Z. --- Hosted checks have now finished: Ubuntu, Windows and macOS relinker jobs all pass; register-context and write-watch jobs pass as well. Linux and Windows full-build jobs were skipped by path filters. The five local exit CTests still stop at this host’s CPU-feature guard before their test bodies, so I am not claiming a local runtime pass. The Windows title results earlier in this thread remain @ahmad3a4’s separate validation of the prior stacked head.
github-actions[bot] commented 2026-10-15 01:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T01:34:24Z.


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 6044 core/libs/prx/libSceSystemService/CMakeLists.txt
core/libs/tests/GuestSystemExit.cpp
PR 6447 core/libs/prx/libc/src/Process.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182350031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6182350031). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T01:34:24Z. --- <!-- 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 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceSystemService/CMakeLists.txt`<br>`core/libs/tests/GuestSystemExit.cpp` | | [PR 6447](https://www.github.com/boykopovar/AnyPS5/pull/6447) | `core/libs/prx/libc/src/Process.cpp` |
milescoviello commented 2026-10-15 01:58:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T01:58:46Z.


The CTest half, on a host with AVX2 (Ubuntu 24.04, i7-13700K, GCC 13.3, Release), main ab9a47684 with #5843 and this PR merged. The only conflict was the test registrations in libSceSystemService/CMakeLists.txt, where I kept both sides. All nine exit tests pass:

guest_system_exit, guest_requested_exit, guest_system_exit_parameters, guest_quick_exit, guest_immediate_exit, guest_return_from_main, guest_system_relaunch, guest_nested_exit and the new guest_exit_finalizers_before_shutdown.

With Syobon Action (PPSA47402), closing the window 20 s in exits 0 with #5843 alone and with both PRs; main aborts with exit thread cannot wait for itself. I couldn't drive the title's own exit() path from outside, so that part of this PR isn't covered by the title run.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182646356 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6182646356). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-15T01:58:46Z. --- The CTest half, on a host with AVX2 (Ubuntu 24.04, i7-13700K, GCC 13.3, Release), `main` ab9a47684 with #5843 and this PR merged. The only conflict was the test registrations in `libSceSystemService/CMakeLists.txt`, where I kept both sides. All nine exit tests pass: `guest_system_exit`, `guest_requested_exit`, `guest_system_exit_parameters`, `guest_quick_exit`, `guest_immediate_exit`, `guest_return_from_main`, `guest_system_relaunch`, `guest_nested_exit` and the new `guest_exit_finalizers_before_shutdown`. With Syobon Action (PPSA47402), closing the window 20 s in exits 0 with #5843 alone and with both PRs; `main` aborts with `exit thread cannot wait for itself`. I couldn't drive the title's own `exit()` path from outside, so that part of this PR isn't covered by the title run. AI-assisted: yes
dogukanatlihan commented 2026-10-15 18:02:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dogukanatlihan on 2026-10-15T18:02:39Z.


I prepared a small supplemental regression for the nested-exit coverage request. It extends guest_nested_exit to require a live shutdown token in the remaining finalizer, exactly one shutdown marker afterward, and the existing nested exit status 7.

Windows 11 Pro build 26300, i7-14700K, WinLibs GCC 15.2.0 r7, Release:

  • Negative control with pre-fix libc: child exits 8 and records only shutdown; the enhanced CTest fails as expected.
  • With #5843 eb8146b73 + this PR f619f964e: child exits 7 and records exactly remaining handler\nshutdown\n.
  • Full build passes; 19 exit/shutdown/related tests pass with no skips, including guest_requested_exit, guest_system_exit, guest_exit_finalizers_before_shutdown, the enhanced guest_nested_exit, and patched_libraries.
  • The supplemental patch passes the conventions checker and whitespace check. No title or Linux run performed.

The runtime build used main fa9365ca7 plus the existing #6452 build prerequisite. The patch was prepared on 03c4cb5e7; the three relevant source files are unchanged between those bases, and the tested patched copies matched the prepared copies by hash. This is local stack validation, not a GitHub merge-commit CI result.

The production changes remain the work of the existing PR authors. The supplemental test patch below addresses the remaining coverage request.

Supplemental test patch
diff --git a/core/libs/tests/GuestSystemExit.cpp b/core/libs/tests/GuestSystemExit.cpp
index bcfe623a5..35c1882d9 100644
--- a/core/libs/tests/GuestSystemExit.cpp
+++ b/core/libs/tests/GuestSystemExit.cpp
@@ -90,7 +90,10 @@ void AppendMarker(const std::string& line) {
 }
 void MainShutdown() { AppendMarker("shutdown"); }
 void SecondaryShutdown() { AppendMarker("secondary shutdown"); }
-void APS5_VABI RemainingHandler(void*) { AppendMarker("remaining handler"); }
+void APS5_VABI RemainingHandler(void*) {
+    if (LibcShutdownToken_nid_postfix().stop_requested()) std::_Exit(8);
+    AppendMarker("remaining handler");
+}
 void APS5_VABI ExitingHandler(void*) { exit_nid_postfix(7); }
 void GuestExitShutdown() { AppendMarker("shutdown"); }
 void APS5_VABI CheckShutdownStillRunning(void*) {
@@ -135,7 +138,7 @@ int DriveNestedExit() {
     std::error_code ignored;
     std::filesystem::remove(marker, ignored);
     Require(code == 7);
-    Require(text == "remaining handler\n");
+    Require(text == "remaining handler\nshutdown\n");
     std::puts("Guest nested exit completed");
     return 0;
 }
@@ -209,6 +212,7 @@ int main(int argc, char** argv) {
         return DriveNestedExit();
     }
     if (argc > firstArgument && std::strcmp(argv[firstArgument], "--nested-exit") == 0) {
+        LibcRegisterShutdown_nid_postfix(GuestExitShutdown);
         Require(__cxa_atexit_nid_postfix(RemainingHandler, nullptr, nullptr) == 0);
         Require(__cxa_atexit_nid_postfix(ExitingHandler, nullptr, nullptr) == 0);
         exit_nid_postfix(0);
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198836748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6198836748). Originally posted by [dogukanatlihan](https://github.com/dogukanatlihan) on 2026-10-15T18:02:39Z. --- I prepared a small supplemental regression for the [nested-exit coverage request](https://github.com/boykopovar/AnyPS5/pull/5843#issuecomment-6175485218). It extends `guest_nested_exit` to require a live shutdown token in the remaining finalizer, exactly one shutdown marker afterward, and the existing nested exit status 7. Windows 11 Pro build 26300, i7-14700K, WinLibs GCC 15.2.0 r7, Release: - Negative control with pre-fix libc: child exits 8 and records only `shutdown`; the enhanced CTest fails as expected. - With #5843 `eb8146b73` + this PR `f619f964e`: child exits 7 and records exactly `remaining handler\nshutdown\n`. - Full build passes; 19 exit/shutdown/related tests pass with no skips, including `guest_requested_exit`, `guest_system_exit`, `guest_exit_finalizers_before_shutdown`, the enhanced `guest_nested_exit`, and `patched_libraries`. - The supplemental patch passes the conventions checker and whitespace check. No title or Linux run performed. The runtime build used main `fa9365ca7` plus the existing #6452 build prerequisite. The patch was prepared on `03c4cb5e7`; the three relevant source files are unchanged between those bases, and the tested patched copies matched the prepared copies by hash. This is local stack validation, not a GitHub merge-commit CI result. The production changes remain the work of the existing PR authors. The supplemental test patch below addresses the remaining coverage request. <details><summary>Supplemental test patch</summary> ```diff diff --git a/core/libs/tests/GuestSystemExit.cpp b/core/libs/tests/GuestSystemExit.cpp index bcfe623a5..35c1882d9 100644 --- a/core/libs/tests/GuestSystemExit.cpp +++ b/core/libs/tests/GuestSystemExit.cpp @@ -90,7 +90,10 @@ void AppendMarker(const std::string& line) { } void MainShutdown() { AppendMarker("shutdown"); } void SecondaryShutdown() { AppendMarker("secondary shutdown"); } -void APS5_VABI RemainingHandler(void*) { AppendMarker("remaining handler"); } +void APS5_VABI RemainingHandler(void*) { + if (LibcShutdownToken_nid_postfix().stop_requested()) std::_Exit(8); + AppendMarker("remaining handler"); +} void APS5_VABI ExitingHandler(void*) { exit_nid_postfix(7); } void GuestExitShutdown() { AppendMarker("shutdown"); } void APS5_VABI CheckShutdownStillRunning(void*) { @@ -135,7 +138,7 @@ int DriveNestedExit() { std::error_code ignored; std::filesystem::remove(marker, ignored); Require(code == 7); - Require(text == "remaining handler\n"); + Require(text == "remaining handler\nshutdown\n"); std::puts("Guest nested exit completed"); return 0; } @@ -209,6 +212,7 @@ int main(int argc, char** argv) { return DriveNestedExit(); } if (argc > firstArgument && std::strcmp(argv[firstArgument], "--nested-exit") == 0) { + LibcRegisterShutdown_nid_postfix(GuestExitShutdown); Require(__cxa_atexit_nid_postfix(RemainingHandler, nullptr, nullptr) == 0); Require(__cxa_atexit_nid_postfix(ExitingHandler, nullptr, nullptr) == 0); exit_nid_postfix(0); ``` </details>
MarcZX10 commented 2026-10-15 21:15:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:15:32Z.


The latest Windows relinker job built successfully and passed 176/177 CTest cases. Its only failure is build_eligibility: two tests timed out in the nested Node harness at the 20-second subprocess limit; the other relinker tests passed. This test is outside the changed files, and tools.tests.test_build_eligibility passes locally on Linux (7/7). GitHub does not allow rerunning this workflow run (run ... cannot be rerun; its workflow file may be broken), so the Windows result remains a CI failure rather than a confirmed transient.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202439133 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6202439133). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:15:32Z. --- The latest Windows relinker job built successfully and passed 176/177 CTest cases. Its only failure is `build_eligibility`: two tests timed out in the nested Node harness at the 20-second subprocess limit; the other relinker tests passed. This test is outside the changed files, and `tools.tests.test_build_eligibility` passes locally on Linux (7/7). GitHub does not allow rerunning this workflow run (`run ... cannot be rerun; its workflow file may be broken`), so the Windows result remains a CI failure rather than a confirmed transient.
MarcZX10 commented 2026-10-15 21:21:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:21:24Z.


Update: the Windows full-build job on current main (e16b2bc) completed successfully in run 38806909876, so the build_eligibility timeout is intermittent rather than a consistent baseline failure. The harness reuse change is in #6583; I will report its Windows result when that check completes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202541941 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6202541941). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:21:24Z. --- Update: the Windows full-build job on current `main` (`e16b2bc`) completed successfully in run [38806909876](https://github.com/boykopovar/AnyPS5/actions/runs/38806909876), so the `build_eligibility` timeout is intermittent rather than a consistent baseline failure. The harness reuse change is in #6583; I will report its Windows result when that check completes.
MarcZX10 commented 2026-10-15 21:39:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:39:00Z.


Follow-up: PR #6583 now passes the build_eligibility relinker suite on all three hosted platforms: Ubuntu (2m29s), macOS (2m57s), and Windows (6m35s). Eligibility and conventions also pass. This is the amended single-Node harness head; it addresses the nested-process timeout observed on this PR and #5978.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202832402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6202832402). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:39:00Z. --- Follow-up: PR #6583 now passes the `build_eligibility` relinker suite on all three hosted platforms: Ubuntu (2m29s), macOS (2m57s), and Windows (6m35s). Eligibility and conventions also pass. This is the amended single-Node harness head; it addresses the nested-process timeout observed on this PR and #5978.
MarcZX10 commented 2026-10-15 21:53:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:53:21Z.


The current Windows relinker check has the same build_eligibility subprocess timeout as #6184: the nested Node harness hit the 20-second limit (two scenarios in this run), while the other 176/177 CTest cases passed. PR #6583 keeps one Node process alive across the scenarios; its current head passes the eligibility relinker suite on Ubuntu, macOS and Windows. Since #6583 is still open, this remains a proposed follow-up; a rerun after it merges would confirm the fix on this PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203058665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6203058665). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:53:21Z. --- The current Windows relinker check has the same `build_eligibility` subprocess timeout as #6184: the nested Node harness hit the 20-second limit (two scenarios in this run), while the other 176/177 CTest cases passed. PR #6583 keeps one Node process alive across the scenarios; its current head passes the eligibility relinker suite on Ubuntu, macOS and Windows. Since #6583 is still open, this remains a proposed follow-up; a rerun after it merges would confirm the fix on this PR.
MarcZX10 commented 2026-10-16 05:21:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:21:49Z.


The current Windows relinker failure is in the shared build_eligibility CTest, not the AGC changes: the author_with_a_commit_in_main_runs_the_relinker scenario times out after 20 seconds while its Node subprocess runs. All other 176/177 Windows relinker tests passed; Linux, macOS, conventions and eligibility checks pass. This same timeout is present on #5978. I found #6484 already exercises better timeout diagnostics for this test and its Windows relinker check passes. I have not changed your branch or opened a duplicate; the runner may be intermittently overloaded, and the failing run is from Oct 15. Could you rerun the Windows relinker job on the current head to establish whether it reproduces?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208700724 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6208700724). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:21:49Z. --- The current Windows relinker failure is in the shared `build_eligibility` CTest, not the AGC changes: the `author_with_a_commit_in_main_runs_the_relinker` scenario times out after 20 seconds while its Node subprocess runs. All other 176/177 Windows relinker tests passed; Linux, macOS, conventions and eligibility checks pass. This same timeout is present on #5978. I found #6484 already exercises better timeout diagnostics for this test and its Windows relinker check passes. I have not changed your branch or opened a duplicate; the runner may be intermittently overloaded, and the failing run is from Oct 15. Could you rerun the Windows relinker job on the current head to establish whether it reproduces?
MarcZX10 commented 2026-10-16 05:23:17 +00:00 (Migrated from github.com)

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


Update: the current head of #6583 (e192246) has green Ubuntu, macOS and Windows relinker checks. Its single-Node harness directly addresses the nested Node timeout reported here and on #5978. #6583 remains open; after it lands on main, rerunning this PR's Windows relinker check will verify the timeout is resolved. No further action is needed on this branch until then.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208718054 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6208718054). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:23:17Z. --- Update: the current head of #6583 (`e192246`) has green Ubuntu, macOS and Windows relinker checks. Its single-Node harness directly addresses the nested Node timeout reported here and on #5978. #6583 remains open; after it lands on `main`, rerunning this PR's Windows relinker check will verify the timeout is resolved. No further action is needed on this branch until then.
MarcZX10 commented 2026-10-16 08:47:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:47:58Z.


The only failing check in this run is build_eligibility: its Node harness exceeded the 20-second subprocess timeout. This is unrelated to this PR's source changes. #6583 addresses the repeated Node startup that caused these Windows timeouts, and its Windows relinker check passed. I cannot rerun the workflow from this account (push permission is unavailable); once #6583 lands, this PR should be rerun against updated main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211736242 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6211736242). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T08:47:58Z. --- The only failing check in this run is `build_eligibility`: its Node harness exceeded the 20-second subprocess timeout. This is unrelated to this PR's source changes. #6583 addresses the repeated Node startup that caused these Windows timeouts, and its Windows relinker check passed. I cannot rerun the workflow from this account (`push` permission is unavailable); once #6583 lands, this PR should be rerun against updated `main`.
MarcZX10 commented 2026-10-16 15:34:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:34:37Z.


The latest Windows check confirms the same build_eligibility 20-second Node harness timeout as #6184; the other tests pass. #6583 reuses a single Node process and has green Windows relinker checks. Once #6583 lands, please rerun this PR’s check to confirm the timeout is gone.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218952844 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6218952844). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:34:37Z. --- The latest Windows check confirms the same `build_eligibility` 20-second Node harness timeout as #6184; the other tests pass. #6583 reuses a single Node process and has green Windows relinker checks. Once #6583 lands, please rerun this PR’s check to confirm the timeout is gone.
MarcZX10 commented 2026-10-16 16:42:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:42:54Z.


I rechecked the current Windows relinker failure: it is the same build_eligibility 20-second Node harness timeout as #6184, while the other relinker tests pass. Open PR #6583 reuses one Node process and has green Ubuntu/macOS/Windows checks, but it has not merged yet. I cannot dispatch a workflow rerun without repository admin rights. Once #6583 lands, this Windows job needs a fresh run against the current head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220248382 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6220248382). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:42:54Z. --- I rechecked the current Windows relinker failure: it is the same `build_eligibility` 20-second Node harness timeout as #6184, while the other relinker tests pass. Open PR #6583 reuses one Node process and has green Ubuntu/macOS/Windows checks, but it has not merged yet. I cannot dispatch a workflow rerun without repository admin rights. Once #6583 lands, this Windows job needs a fresh run against the current head.
MarcZX10 commented 2026-10-16 17:13:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:13:49Z.


I rebased the two existing commits onto current main in 011e8ef82 and 22f1c9957 so the current build eligibility harness is used. Both commits remain MarcZX100-authored, with no co-author added. The fresh eligibility, conventions and report checks are running; the old Windows timeout run could not be rerun because GitHub reports its workflow file may be broken. I will report the current-head result when it completes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220787629 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6220787629). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:13:49Z. --- I rebased the two existing commits onto current `main` in `011e8ef82` and `22f1c9957` so the current build eligibility harness is used. Both commits remain MarcZX100-authored, with no co-author added. The fresh eligibility, conventions and report checks are running; the old Windows timeout run could not be rerun because GitHub reports its workflow file may be broken. I will report the current-head result when it completes.
adriadam10 commented 2026-10-16 19:58:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T19:58:33Z.


Rebased onto current main (only conflict: the test registrations in libSceSystemService/CMakeLists.txt, kept both sides) and added one commit: the new --exit-order* modes and --relaunch-driver in GuestSystemExit.cpp now parse with firstArgument like the rest of main().

Checked on the rebased head: build and scoped ctest green for all exit tests (guest_exit_finalizers_before_shutdown, guest_nested_exit, guest_requested_exit, guest_return_from_main, guest_system_relaunch, guest_system_exit*). Reverting the Process.cpp change makes guest_nested_exit and guest_exit_finalizers_before_shutdown fail. Windows and title runs by @ahmad3a4, @milescoviello and @dogukanatlihan cover what we can't run here; merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223594744 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6223594744). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T19:58:33Z. --- Rebased onto current `main` (only conflict: the test registrations in `libSceSystemService/CMakeLists.txt`, kept both sides) and added one commit: the new `--exit-order*` modes and `--relaunch-driver` in `GuestSystemExit.cpp` now parse with `firstArgument` like the rest of `main()`. Checked on the rebased head: build and scoped ctest green for all exit tests (`guest_exit_finalizers_before_shutdown`, `guest_nested_exit`, `guest_requested_exit`, `guest_return_from_main`, `guest_system_relaunch`, `guest_system_exit*`). Reverting the `Process.cpp` change makes `guest_nested_exit` and `guest_exit_finalizers_before_shutdown` fail. Windows and title runs by @ahmad3a4, @milescoviello and @dogukanatlihan cover what we can't run here; merging once the full Build is green.
MarcZX10 commented 2026-10-16 20:02:42 +00:00 (Migrated from github.com)

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


Thanks for the rebase and for adding the firstArgument parsing fix to the new exit modes. The scoped exit tests and the negative control make the finalizer regression clear. I have no further changes to request; I’ll wait for the full Build result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223662255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5978#issuecomment-6223662255). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T20:02:42Z. --- Thanks for the rebase and for adding the `firstArgument` parsing fix to the new exit modes. The scoped exit tests and the negative control make the finalizer regression clear. I have no further changes to request; I’ll wait for the full Build result.
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!5978
No description provided.