libc: a guest free during exit waits 60 s for a lease and aborts after the AGC driver shut down (ProsperoEden quitting) #4846

Closed
opened 2026-10-12 23:47:56 +00:00 by David-cmrg · 1 comment
David-cmrg commented 2026-10-12 23:47:56 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by David-cmrg on 2026-10-12T23:47:56Z.


Symptom

ProsperoEden (PPSA99008 v1.000.110, homebrew catalog) quits from its launcher through sceSystemServiceLoadExec("exit"). The process then hangs for APS5_PIN_WAIT_MS (60 s) and aborts with exit code 134 instead of exiting:

guest allocation 0x214c80060+0xa is still pinned by GPU work or an import (waited 60000 ms for the lease (APS5_PIN_WAIT_MS))

The message reaches neither the console nor the title's own logs; I read it with gdb at __cxa_throw.

Order of events (gdb breakpoints)

  1. sceSystemServiceLoadExec("exit") calls LibcRunShutdown_nid_postfix. Driver::stop destroys both VulkanDevices, and each runs ClearImageMirrors and ClearHostImports.
  2. std::exit(0) reaches CxaFinalize_nid_no_patch, where a guest destructor frees a 10-byte heap block: ApplicationHeapFree, GuestHeapFree, then GuestAllocationsRequireUnpinned.
  3. The block's range is still pinned, the wait runs to its deadline, and the throw from PinnedFailure finds no handler and ends in std::terminate.

Ruled out:

  • Nothing calls GuestAllocationsAcquire or GuestAllocationsAcquireAll after LibcRunShutdown, so the lease was taken before the shutdown and outlives it.
  • No guest thread is inside the driver at the failure. The driver threads left are RegistrationPreparePool::Main (3), runJobs and DiskStore::run, all idle in a condition wait.
  • The result is the same with each of APS5_NO_ADDRESS_SPACE_CACHE, APS5_NO_HOST_IMPORT, APS5_NO_LEASE_MIRROR, APS5_NO_RESOURCE_CACHE, APS5_NO_CONTEXT_CACHE and APS5_NO_TEXTURE_CACHE. With APS5_PIN_WAIT_MS=3000, each run aborts after about 24 s.

I haven't found which object holds the lease.

Reproduce

  • Fedora 44, GCC 16.2.1, Release, main d53960612, Mesa 26.2.4 llvmpipe (ANYPS5_GPU=llvmpipe).
  • ProsperoEden zip sha256 cabe26af81dbccfc6fc2d3c7e42e7a1295c85c6a2f631bee8043debdd9f7f8f6. eboot.bin and sce_module/libc.prx are unwrapped and relinked with --to-intel --trap-sdk-syscall-stubs.
  • Create data in the run folder by hand (#4643).
  • The converted executable is named app.elf, so the title finds no eboot.bin in /app0 and falls back to /data/homebrew/PPSA99008. It can't read its launcher font there and quits after about 19 s (launcher closed: no game (quit) in data/prosperoeden/logs/boot-trace.txt).
  • On main this run exits with code 134 after 82 s. All my other runs with unmodified libraries (#4690 creating data) reached the same failure, including the toggle runs above.

On an Intel HD 520 (ANV) the title stops earlier, at the viewport depth range #4650 handles, so I only reached the exit path on llvmpipe.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5822052081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4846). Originally posted by [David-cmrg](https://github.com/David-cmrg) on 2026-10-12T23:47:56Z. --- ### Symptom ProsperoEden (PPSA99008 v1.000.110, homebrew catalog) quits from its launcher through `sceSystemServiceLoadExec("exit")`. The process then hangs for `APS5_PIN_WAIT_MS` (60 s) and aborts with exit code 134 instead of exiting: ``` guest allocation 0x214c80060+0xa is still pinned by GPU work or an import (waited 60000 ms for the lease (APS5_PIN_WAIT_MS)) ``` The message reaches neither the console nor the title's own logs; I read it with gdb at `__cxa_throw`. ### Order of events (gdb breakpoints) 1. `sceSystemServiceLoadExec("exit")` calls `LibcRunShutdown_nid_postfix`. `Driver::stop` destroys both `VulkanDevice`s, and each runs `ClearImageMirrors` and `ClearHostImports`. 2. `std::exit(0)` reaches `CxaFinalize_nid_no_patch`, where a guest destructor frees a 10-byte heap block: `ApplicationHeapFree`, `GuestHeapFree`, then `GuestAllocationsRequireUnpinned`. 3. The block's range is still pinned, the wait runs to its deadline, and the throw from `PinnedFailure` finds no handler and ends in `std::terminate`. Ruled out: - Nothing calls `GuestAllocationsAcquire` or `GuestAllocationsAcquireAll` after `LibcRunShutdown`, so the lease was taken before the shutdown and outlives it. - No guest thread is inside the driver at the failure. The driver threads left are `RegistrationPreparePool::Main` (3), `runJobs` and `DiskStore::run`, all idle in a condition wait. - The result is the same with each of `APS5_NO_ADDRESS_SPACE_CACHE`, `APS5_NO_HOST_IMPORT`, `APS5_NO_LEASE_MIRROR`, `APS5_NO_RESOURCE_CACHE`, `APS5_NO_CONTEXT_CACHE` and `APS5_NO_TEXTURE_CACHE`. With `APS5_PIN_WAIT_MS=3000`, each run aborts after about 24 s. I haven't found which object holds the lease. ### Reproduce - Fedora 44, GCC 16.2.1, Release, `main` `d53960612`, Mesa 26.2.4 llvmpipe (`ANYPS5_GPU=llvmpipe`). - ProsperoEden zip sha256 `cabe26af81dbccfc6fc2d3c7e42e7a1295c85c6a2f631bee8043debdd9f7f8f6`. `eboot.bin` and `sce_module/libc.prx` are unwrapped and relinked with `--to-intel --trap-sdk-syscall-stubs`. - Create `data` in the run folder by hand (#4643). - The converted executable is named `app.elf`, so the title finds no `eboot.bin` in `/app0` and falls back to `/data/homebrew/PPSA99008`. It can't read its launcher font there and quits after about 19 s (`launcher closed: no game (quit)` in `data/prosperoeden/logs/boot-trace.txt`). - On `main` this run exits with code 134 after 82 s. All my other runs with unmodified libraries (#4690 creating `data`) reached the same failure, including the toggle runs above. On an Intel HD 520 (ANV) the title stops earlier, at the viewport depth range #4650 handles, so I only reached the exit path on llvmpipe.
simonbbby commented 2026-10-13 03:11:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-13T03:11:36Z.


Confirmed on another Linux GPU/driver, and on an older main: 2a5eca11cd1bf583db39ce67034e8453842ac244, RADV Mesa 25.2.8 on gfx1036 (Ryzen 9 9950X iGPU, PCI 1002:13c0), Ubuntu 24.04 / Linux 7.0, GCC 13.3 Release with SPIRV-Tools ON.

Used ProsperoEden 1.000.110 from the catalog, with the exact SHA-256 in this issue. Unwrapped the executable and its bundled libc, relinked with --registry --to-intel --trap-sdk-syscall-stubs, created the local data directory, and kept the source eboot outside /app0 so the title selects /data/homebrew/PPSA99008. The launcher reports its missing font, launcher closed: no game (quit), and exit: Launcher closed, then exits 134 with APS5_PIN_WAIT_MS=3000.

A second run under gdb, breaking on GuestAllocations::PinnedFailure, reaches this stack on the main thread:

GuestAllocations::PinnedFailure
GuestAllocationsRequireUnpinned_nid_postfix
GuestHeapFree_nid_postfix
ApplicationHeapFree_nid_no_patch
[guest destructor]
CxaFinalize_nid_no_patch
__run_exit_handlers
exit
sceSystemServiceLoadExec

The setup pins RADV with VK_DRIVER_FILES=radeon_icd.json and ANYPS5_GPU=RADV; the direct run disables the AnyPS5 shader cache. The original lavapipe attempt on this older baseline stops earlier with subgroup capability 61 is unsupported for shader stage 1, so it is not shutdown evidence.

This confirms the pinned-allocation exit path on RADV and shows the symptom already exists at the stated earlier revision. I have not identified the object retaining the lease, independently traced all shutdown cleanup, or tested a fix; this is not a current-main retest.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137354357 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4846#issuecomment-6137354357). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-13T03:11:36Z. --- Confirmed on another Linux GPU/driver, and on an older main: `2a5eca11cd1bf583db39ce67034e8453842ac244`, RADV Mesa 25.2.8 on gfx1036 (Ryzen 9 9950X iGPU, PCI 1002:13c0), Ubuntu 24.04 / Linux 7.0, GCC 13.3 Release with SPIRV-Tools ON. Used ProsperoEden 1.000.110 from the catalog, with the exact SHA-256 in this issue. Unwrapped the executable and its bundled libc, relinked with `--registry --to-intel --trap-sdk-syscall-stubs`, created the local `data` directory, and kept the source eboot outside `/app0` so the title selects `/data/homebrew/PPSA99008`. The launcher reports its missing font, `launcher closed: no game (quit)`, and `exit: Launcher closed`, then exits 134 with `APS5_PIN_WAIT_MS=3000`. A second run under gdb, breaking on `GuestAllocations::PinnedFailure`, reaches this stack on the main thread: ```text GuestAllocations::PinnedFailure GuestAllocationsRequireUnpinned_nid_postfix GuestHeapFree_nid_postfix ApplicationHeapFree_nid_no_patch [guest destructor] CxaFinalize_nid_no_patch __run_exit_handlers exit sceSystemServiceLoadExec ``` The setup pins RADV with `VK_DRIVER_FILES=radeon_icd.json` and `ANYPS5_GPU=RADV`; the direct run disables the AnyPS5 shader cache. The original lavapipe attempt on this older baseline stops earlier with `subgroup capability 61 is unsupported for shader stage 1`, so it is not shutdown evidence. This confirms the pinned-allocation exit path on RADV and shows the symptom already exists at the stated earlier revision. I have not identified the object retaining the lease, independently traced all shutdown cleanup, or tested a fix; this is not a current-main retest.
Sign in to join this conversation.
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#4846
No description provided.