docs(debt): cite the bundled libc.prx for _Mtx_trylock, strdup and strndup #9613
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9613"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T04:30:38Z.
What
Two libc debt entries said the console behaviour was unverified. This PR replaces that with what the
libc.prxPPSA13934 ships insce_module/does. I read it from disassembly, not by measuring on a console. Only the debt file changes._Mtx_trylock(k6pGNMwJB08, 0x5cf0, 33 bytes)upoVrzMHFeE#A#B(scePthreadMutexTrylock, through the PLT stub at 0xc43c0) and maps the result:strdup(g7zzzLDYGw0, 0x6b440) andstrndup(XGnuIBmEmyk, 0x6b650)strdupcallsstrlen(j4ViWNHEgww) on it.strndupcallsstrnlen(5jNubw4vlAA).strndup(NULL, 0): itsstrnlenreads nothing, and it returns an empty copy. Here that call returns null withEINVAL. The entry already explains why this libc returnsEINVALinstead of faulting, and now also records that one case.The
qsortreading that was a second commit here moved to #9688, which makesqsortandqsort_sfollow the bundled code and checks them against it.Tested
Refreshed on 2026-10-24 as
38e535f939df1bcb74c1ee1a13fd6d37cf810ab7, one commit directly onmain25c1aa1e79329e0e2957b4fdd731144dad8be724, with no merge commits. The conflict touched the neighbouringnearbyintfdebt entry: main's newer console measurement is preserved, while this PR's two-entry added/removed lines remain byte-identical to its prior head.python3 tools/check_conventions.py --base 25c1aa1e79329e0e2957b4fdd731144dad8be724andgit diff --check 25c1aa1e79329e0e2957b4fdd731144dad8be724pass.docs/dev/debt/libc.mdchanges, with two lines added and two removed. No code, test, build, runtime or new console-measurement claim.668d51adbdb91248f49fdd28acbfd0b85adb98cdand #90877b400cbcfedb3f1235e1870f05ef59f2efea0578find conflicts only indocs/dev/debt/libc.md. The retain-both landing agreements below remain applicable; neither is a functional dependency.Landing order
The author of #6713 agrees that either landing order works. Resolve the additive
_Mtx_trylockdebt hunk by keeping main’s four entries, this PR’s_Mtx_trylockentry, then #6713’s “Application heap without process parameters” entry. If this PR lands first, #6713’s author will rebase accordingly. There is no code dependency between these PRs.The author of #9087 agrees to either landing order: #9087 can land first and this PR will be refreshed afterward. If this PR lands first, #9087’s author will rebase its
libc.mdhunk and keep these two entries unchanged. Preserve both PRs’ overlappingstrdup/strndupdebt edits. There is no code dependency between these PRs.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T09:56:08Z.
Thanks for the review. I have converted this to a draft under the #5239 intake hold; there is no title run demonstrating a need for this documentation-only change.
The #6713 overlap is an insertion beside the
_Mtx_trylockentry; #9087 changes adjacent secure-formatting entries besidestrndup/strdup. Those diffs do not change the two behaviors documented here, but their shared context can still require a rebase. I will leave overlap coordination and a fresh rebase/check outstanding before making this ready again. Bundled PPSA13934 disassembly remains the evidence scope; no console measurement is claimed.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T12:31:44Z.
Rebased onto
main8b3a6ba88d(head 8fcf18acf5). The twolibc.mdentries apply unchanged on top of the current file, andtools/check_conventions.pypasses.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T13:15:13Z.
Review: DISMISSED
I withdraw the earlier #5239 intake-hold objection. The two disassembly-backed debt updates clearly distinguish bundled
libc.prxevidence from PS5 console measurements, and the qsort item has been split into #9688 as described. Exact-head whitespace and conventions pass against current main3ca07d086d5f44fbe3c00370e7f03953ab46ca1b; the current-main merge tree is clean. Hosted conventions, eligibility and labels pass; product jobs are skipped. This documentation-only change needs no runtime test, and I did not claim a console run.I refreshed the overlap check manually: merging #9613 with #9087 is clean, but a merge-tree comparison with #6713 produces a content conflict in
docs/dev/debt/libc.mdon the_Mtx_trylockentry. Please coordinate the landing order with #6713's author and rebase the second PR preserving both entries; updateDepends ononly if one actually must land first. The PR currently descends from8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768, while current main is3ca07d086d5f44fbe3c00370e7f03953ab46ca1b; please update it to current main and refresh the overlap check. This request is for current branch and overlap coordination only, not the obsolete intake hold.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T13:15:34Z.
Correction to my preceding review: I ran the two pairwise merge-tree checks separately. Both #9087 and #6713 produce a content conflict in
docs/dev/debt/libc.mdwith this head. I incorrectly said #9087 merged cleanly. #9087 touches thestrndup and strdupentry, and #6713 touches_Mtx_trylock; please coordinate both landing orders and preserve all three changes when rebasing. The current-main merge tree itself is clean.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T13:17:03Z.
@MarcZX10 thanks for the correction. I merged all three locally on top of this head (8fcf18acf5): first #9087 (orezraey), then #6713 (karimibrahim07). Both conflicts are adjacency only, and neither PR changes the text of the two entries this PR edits:
strndup and strdupfollowed by thesnprintf_s and vsnprintf_sandvsscanf_slines. The resolution keeps this PR'sstrndup and strdupline and then #9087's rewrittensnprintf_s and vsnprintf_sline. #9087 itself deletes the oldvsscanf_sline._Mtx_trylockentry. Main added four entries above it after #6713 was opened (sceLibcBacktraceGetBufferSize,ApplicationGuestHeapApi,fdopen,scriptingGetMem). The resolution keeps those, then this PR's_Mtx_trylockline, then #6713's new "Application heap without process parameters" line.Every added
libc.mdline of the three PRs is present verbatim in the result: 4 of 4 for #9087, 1 of 1 for #6713 and 2 of 2 here.check_conventions.pyreports no errors. Its one warning isdebt-lengthon #9087's own_WStoulentry (2,279 characters), not on this combination.On landing order, this PR has no preference. Whichever of the three merges later only needs the resolution above. If one of #9087 or #6713 lands first, I'll rebase this onto it and keep their text unchanged.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T13:28:46Z.
Marked ready for review. This was a draft only because of the #5239 intake hold, which @MarcZX10 has withdrawn (https://github.com/boykopovar/AnyPS5/pull/9613#issuecomment-6337453028 and on #9596).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T15:18:20Z.
@orezraey @karimibrahim07 could you confirm a landing order for the adjacent
docs/dev/debt/libc.mdchanges in #9087, #6713 and this PR? The reviewer requested agreement from the affected authors; my earlier resolution note did not tag you directly.My proposed order is to let your implementation PRs land first and refresh this documentation-only PR afterward, preserving both of your debt updates. There is no code dependency on this PR, and I can also refresh after whichever one lands first if the other remains open. If this PR lands first, the previously documented adjacency resolution retains all three sets of changes.
Current heads checked for this request: this PR
8fcf18acf5, #9087f8019fdbaf, #6713668d51adbd. The earlier local three-way resolution and its conventions result are described in https://github.com/boykopovar/AnyPS5/pull/9613#issuecomment-6341715588; this request does not claim a fresh test run or agreement yet. Please let me know if either ordering conflicts with your plans.Imported from boykopovar/AnyPS5. Originally posted by karimibrahim07 on 2026-10-22T15:26:01Z.
@JJenkx agreed, any order works for #6713. Your resolution of the
_Mtx_trylockhunk (main's four new entries, then this PR's_Mtx_trylockline, then #6713's "Application heap without process parameters" line) keeps everything #6713 adds. If this PR lands first I'll rebase #6713 onto it the same way. #6713 has no code dependency on it either way.AI-assisted: yes