Repository navigation
Conversation
sceNpTrophy2GetGameIcon, sceNpTrophy2GetGroupIcon and sceNpTrophy2GetTrophyIcon throw std::runtime_error when no icon is read. A throw escapes the C ABI and stops the title, while the sibling sceNpTrophy2GetRewardIcon zeroes the size and returns SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND, which the technical debt entry for libSceNpTrophy2 cites as the expected result of these calls. The three functions now zero the size and return the same error code.
The guest test checks that the three icon queries that have no icon file return SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND with a zero size, which the throwing versions did not satisfy.
|
Hi MarcZX10, Thanks for turning the three icon throws into the error answer. Returning Two changes before it can go in:
|
✅ AMD GPU test: passedPR head
Failing on main too (3, not counted against this PR)Passed on retry (3, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (58, not in the main baseline's validation pass)Validation IDs already present on main (3 IDs in 329 tests)Skipped (59)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
A Windows run with GCC 16: Windows 11 Pro 10.0.22631, i9-9900K, MSYS2 UCRT64 GCC 16.1.0, Release, this PR (
Looks good on Windows 👍 AI-assisted: yes (Claude Code) |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
#19532 builds on this PR and reads the icons from
#19532 merges this branch at
AI-assisted: yes (Claude Code) |
…GuestCopyOut sceNpTrophy2CreateContext, sceNpTrophy2CreateHandle and the game/group/trophy info queries (single and array variants) wrote directly into guest output pointers, so an unwritable context, handle, details, data, array element or count faulted inside the library. CreateContext and CreateHandle now copy the produced id out with GuestCopyOut_nid_no_patch and return SCE_NP_TROPHY2_INVALID_ARGUMENT -equivalent (APS5_INVALID_ARG_EX) when it is not writable. The info queries now fill a local struct and copy it out with GuestCopyOut_nid_no_patch; the array variants copy each element and the final count the same way, stopping (and leaving count untouched) at the first unwritable element. python3 tools/guest_pointer_audit.py libSceNpTrophy2 goes from 16 direct guest pointer accesses to 4, all of them the size parameter of the four icon queries (out of scope; sceNpTrophy2GetRewardIcon's is already covered by #15314). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Request 2 (debt entry): done. Pushed Request 1 (unconditional answer, silent stub): decision needed, not changed yet. The three functions still return the error unconditionally. The options are:
@MarcZX10 please choose one. The description rewording (the request to say that the answer is unconditional) follows that choice; I have not changed the description. Verification: |
|
Request 1 (unconditional answer, silent stub): decided, no code change. The three functions keep their current behaviour: they return Facts behind it, checked in the worktree at
On the title and UI effect: I did not find one in this PR, so none is claimed. The PR description now says Request 2 (debt entry) is already in Note: #19532 (by @Superseabas) builds on Not verified here:
|
…ykopovar#15314 The game, group and trophy icons are read from trophyNN.ucp, so the Silent stubs entry boykopovar#15314 adds for them no longer holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#19532 now merges AI-assisted: yes (Claude Code) |
ligmaSec
left a comment
There was a problem hiding this comment.
I ran guest_nptrophy2 with the patch applied on Linux. It passed the missing-icon cases for the game, group, and trophy APIs, including the zero size outputs and the optional-size case.
AI-assisted: yes.
What
sceNpTrophy2GetGameIcon,sceNpTrophy2GetGroupIconandsceNpTrophy2GetTrophyIconthrew a C++ exception when no icon file existed. They now returnSCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUNDwith the size zeroed. That error is the not-found answer by design, matching the siblingsceNpTrophy2GetRewardIconand the debt entry that describes these functions. Its effect on a title is not measured here.Commits:
Tested
main.ctest -R '^guest_nptrophy2$': 1 of 1 passed (guest_nptrophy2).tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main: clean.Not verified
TrophyStore.cppand its tests, not these icon files.Checklist
main; no other open PR changes these icon functions