libSceNpWebApi2: sceNpWebApi2PushEventAbortHandle throws (Planet Coaster); fix branch ready #4174

Closed
opened 2026-10-12 00:35:53 +00:00 by screamm · 3 comments
screamm commented 2026-10-12 00:35:53 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-12T00:35:53Z.


libSceNpWebApi2's sceNpWebApi2PushEventAbortHandle (NID 1OLgvahaSco) throws; Planet Coaster (PPSA01736) imports it (import evidence from merged #3399; the call has not been observed executing).

Fix branch ready: screamm:feat/npwebapi2-push-event-abort (2d9c2e45, one commit on main bab7b328). I cannot open it as a PR under the intake rule; anyone eligible is welcome to carry it, keeping the commit as is. sceNpWebApi2SetRequestTimeout, the library's other pending export, is left to the open #2853 and #4064.

  • Push-event handles are now registered per library context on the existing context map and mutex, following shadPS4 np_web_api2_internal.cpp (abortPushEventHandle), np_web_api2_context.cpp and np_web_api2_push_event.cpp at e0a46675: CreateHandle returns LIB_CONTEXT_NOT_FOUND (0x80553404) for an unknown context and registers the handle; AbortHandle returns LIB_CONTEXT_NOT_FOUND / HANDLE_NOT_FOUND (0x8055340D) for an unknown context or handle and otherwise marks the handle aborted (idempotent, 0); CreateFilter on an aborted handle returns ABORTED (0x80553409); DeleteHandle validates the same way and removes the handle; Terminate drops the context's handles. In shadPS4 the only effect of abort is that ABORTED result, so registered callbacks are left alone; handle timeouts are not modelled. The codes are PS4 numbering, unverified on PS5 (TechnicalDebt). Note for reviewers: CreateHandle, DeleteHandle and CreateFilter previously accepted any id and now return these errors; the sibling GetMemoryPoolStats still throws for an unknown context, and the existing SCE_NP_WEBAPI2_ERROR_UNAVAILABLE (0x80553406) is shadPS4's REQUEST_NOT_FOUND, left unchanged.
  • guest_np_web_api2 covers two handles (abort one twice, filter creation ABORTED on it and unaffected on the other), the wrong-context, unknown-handle and unknown-context codes, delete then abort/delete again, and abort after Terminate.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs (with open #4021's Socket.cpp guard applied locally): guest_np_web_api2 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" under heavy host load: beyond the known Windows failures on current main (agc_write_tracking #4087, guest_kernel_stack_protect #4088) the timeouts (conventions_function_bodies, guest_pthread_rwlock, guest_raise_exception, tls_function_coverage_register_address_loads, guest_pthread_start, host_thread_local) and audio_out2_timing pass when rerun serially; with main's Export.cpp the extended test fails; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5806686627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4174). Originally posted by [screamm](https://github.com/screamm) on 2026-10-12T00:35:53Z. --- libSceNpWebApi2's `sceNpWebApi2PushEventAbortHandle` (NID `1OLgvahaSco`) throws; Planet Coaster (PPSA01736) imports it (import evidence from merged #3399; the call has not been observed executing). **Fix branch ready:** [`screamm:feat/npwebapi2-push-event-abort`](https://github.com/screamm/AnyPS5/tree/feat/npwebapi2-push-event-abort) (`2d9c2e45`, one commit on `main` `bab7b328`). I cannot open it as a PR under the intake rule; anyone eligible is welcome to carry it, keeping the commit as is. `sceNpWebApi2SetRequestTimeout`, the library's other pending export, is left to the open #2853 and #4064. - Push-event handles are now registered per library context on the existing context map and mutex, following shadPS4 `np_web_api2_internal.cpp` (`abortPushEventHandle`), `np_web_api2_context.cpp` and `np_web_api2_push_event.cpp` at `e0a46675`: `CreateHandle` returns `LIB_CONTEXT_NOT_FOUND` (0x80553404) for an unknown context and registers the handle; `AbortHandle` returns `LIB_CONTEXT_NOT_FOUND` / `HANDLE_NOT_FOUND` (0x8055340D) for an unknown context or handle and otherwise marks the handle aborted (idempotent, 0); `CreateFilter` on an aborted handle returns `ABORTED` (0x80553409); `DeleteHandle` validates the same way and removes the handle; `Terminate` drops the context's handles. In shadPS4 the only effect of abort is that `ABORTED` result, so registered callbacks are left alone; handle timeouts are not modelled. The codes are PS4 numbering, unverified on PS5 (TechnicalDebt). Note for reviewers: `CreateHandle`, `DeleteHandle` and `CreateFilter` previously accepted any id and now return these errors; the sibling `GetMemoryPoolStats` still throws for an unknown context, and the existing `SCE_NP_WEBAPI2_ERROR_UNAVAILABLE` (0x80553406) is shadPS4's `REQUEST_NOT_FOUND`, left unchanged. - `guest_np_web_api2` covers two handles (abort one twice, filter creation `ABORTED` on it and unaffected on the other), the wrong-context, unknown-handle and unknown-context codes, delete then abort/delete again, and abort after `Terminate`. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs` (with open #4021's `Socket.cpp` guard applied locally): `guest_np_web_api2` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` under heavy host load: beyond the known Windows failures on current `main` (`agc_write_tracking` #4087, `guest_kernel_stack_protect` #4088) the timeouts (`conventions_function_bodies`, `guest_pthread_rwlock`, `guest_raise_exception`, `tls_function_coverage_register_address_loads`, `guest_pthread_start`, `host_thread_local`) and `audio_out2_timing` pass when rerun serially; with `main`'s `Export.cpp` the extended test fails; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
milescoviello commented 2026-10-12 08:13:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-12T08:13:08Z.


Carried as #4375 with your commit as is (cherry-picked onto current main, author unchanged). I added a Linux run there: on Ubuntu 24.04 with GCC 13.3, guest_np_web_api2 passes 3/3 and fails with main's Export.cpp. Thanks for the fix!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120353356 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4174#issuecomment-6120353356). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-12T08:13:08Z. --- Carried as #4375 with your commit as is (cherry-picked onto current `main`, author unchanged). I added a Linux run there: on Ubuntu 24.04 with GCC 13.3, `guest_np_web_api2` passes 3/3 and fails with `main`'s `Export.cpp`. Thanks for the fix!
MarcZX10 commented 2026-10-13 16:38:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T16:38:22Z.


Carried the implementation into PR #5292: https://github.com/boykopovar/AnyPS5/pull/5292. The Linux guest_np_web_api2 regression test passes (1/1), and conventions pass. PS5 behavior for the PS4-derived codes remains unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6150410148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4174#issuecomment-6150410148). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T16:38:22Z. --- Carried the implementation into PR #5292: https://github.com/boykopovar/AnyPS5/pull/5292. The Linux `guest_np_web_api2` regression test passes (1/1), and conventions pass. PS5 behavior for the PS4-derived codes remains unverified.
oneandonlydean commented 2026-10-13 23:53:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T23:53:15Z.


Closing: no title is seen calling sceNpWebApi2PushEventAbortHandle (same reason as #4375 and #5085). Comment here with the log line if a title stops at it on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157679845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4174#issuecomment-6157679845). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T23:53:15Z. --- Closing: no title is seen calling `sceNpWebApi2PushEventAbortHandle` (same reason as #4375 and #5085). Comment here with the log line if a title stops at it on current main.
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#4174
No description provided.