feat(libSceLibreSsl): implement numeric ERR formatting and newest peeking #9535
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9535"
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 Felipebmaitan on 2026-10-22T00:42:07Z.
What
Numeric ERR formatting, queue peeking and test-only names fixture. Refreshed onto fetched main
4ac683fe026c3368e508ace9745d3017e12a1207without rewriting published history. Pending exports independently recounted after integration: 287 inlibSceLibreSsl/Export.cpp(literal calls and direct exported stub bodies agree). Published ERR numeric-before/after-load/free behavior, test-only generation/Python/submodule scope, shared queue and registrations are preserved. All main implementation sources and the old/main public-definition/NID union are retained.Tested
Exact head
b8dc89c0f887e725b97ad2ea112fb6eded347e27, main integration base4ac683fe026c3368e508ace9745d3017e12a1207. Ubuntu 24.04.5 amd64 Docker container on Apple Silicon, GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, Python 3.12.3, Release.44af6828fdc064ca16f94aeb07ac913651d2bfce0f5ecbeee6b9b476e6be24e3); all three lifecycle cases pass again. Runtime Ninja graphs exclude the generator and compilesrc/Error.cpponce.python3 tools/check_conventions.py --base origin/mainand whitespace pass in an isolated Git context pinningorigin/mainto the integration base above, without changing shared tracking refs.The harness imports actual repository library/test fragments, source-building pinned dependencies; it is not the full root/product suite. Docker denies userfaultfd, invoking libc's existing comparison fallback. No new local Windows/macOS runtime, sanitizer, title or physical-console run was performed; no skipped/pending hosted job is counted as passed. Firmware-module evidence remains PC execution with stand-in imports. Earlier no-Python fragment and bounded BIO negative-control evidence is historical; those settled checks were not rerun, and neither production BIO nor the wipe assertions changed. Hosted CI for
b8dc89c0f887e725b97ad2ea112fb6eded347e27:windows,conventions,library-portability,eligibility,labelsandreportsucceeded.linux,relinker,relinker-asan,register-contextandwrite-watchwere skipped; an earlier conventions run was cancelled. GitHub reports CLEAN / MERGEABLE. Skipped jobs are not counted as executed. Current-head maintainer re-review remains pending. Exact logs, harness, audits and overlap limitations are in the latest validation reply.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 MarcZX10 on 2026-10-22T00:51:33Z.
Review: CHANGES_REQUESTED
There is a concrete error-string lifecycle regression in
ErrorQueue.cpp:ERR_free_stringsstoresStringState::Freed, butLibreSslLoadErrorStrings_nid_no_patchonly transitionsUninitializedtoLoaded. Therefore, after the supported sequenceERR_free_strings(); ERR_load_crypto_strings();, string loading is still disabled and later format calls continue to return numericlib()/func()/reason()fallbacks for known errors. Thefree-firsttest currently asserts that fallback, so it hides the failed reload.Please make the explicit load operation restore the loaded state after freeing (with a thread-safe transition), or make free a no-op for the compiled-in static tables, and add a regression assertion that a known error string is available after free then load. This behavior is separate from whether applications need to call these legacy APIs during normal operation; both exports are implemented here and the upstream API documents loading after removal as registration.
The ancestry and declared
Depends on: #9529are consistent. Hosted eligibility, conventions, intake, labels and report checks pass. All product/relinker platform jobs are skipped; the PR reports Windows builds/tests and a full-suite run with disclosed baseline failures, which I did not rerun locally. I’m requesting changes for the lifecycle issue only.Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-22T00:58:47Z.
I checked the requested reload against the exact historical contract pinned here. LibreSSL 3.4.1 does not restore strings after this sequence:
ERR_load_crypto_stringsuses a function-localpthread_onceguard.ERR_free_stringsdeletes the registered table without resetting that guard. Its initialOPENSSL_init_cryptoalso makes free-first follow this lifecycle.I also built the official LibreSSL 3.4.1 release's static libcrypto outside the repository using WinLibs GCC 15.2. The relevant three source files (
err.c,err_all.c,crypto_init.c) match this pin after line-ending normalization. This reproduction exits successfully:Running without arguments prints the named BIO error followed by the numeric fallback. Running with
free-firstprints the numeric fallback. Repeated free/load calls give the same result.Pushed
3f66ff0deato make the deliberate contract clearer: both lifecycle tests now check formatting immediately after free, after one explicit load, and after a repeated free/load cycle, with queue preservation checked too. The debt file and PR description now state the one-time loading behavior. All five focused LibreSSL/patched-library tests passed (0.23 s), as did strict compiler and convention checks.The runtime implementation continues to match the pinned upstream behavior; PS5 equivalence remains unverified. Could you reconsider the lifecycle change request against this historical source and reproduction?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:01:28Z.
Review: COMMENTED
Correction to my earlier review: I rechecked the pinned LibreSSL 3.4.1 source and the updated release-source reproduction. The one-time loader uses pthread_once, and ERR_free_strings deletes the table without resetting that guard, so retaining numeric fallbacks after free followed by explicit load is consistent with this compatibility target. The new head documents and tests this historical behavior. I withdraw my earlier request for a lifecycle change; sorry for the incorrect finding. The PR remains dependent on #9529 as declared.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:01:44Z.
Review: COMMENTED
Correction: the newly pushed LibreSSL-based test and documentation confirm the one-time loading behavior against the pinned source; the earlier concern is resolved. The dependent #9536 now also has a complete parent implementation and its declared Depends on chain is consistent. I have no additional code finding on the updated ERR change.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:01:51Z.
Review: APPROVED
The updated head and pinned LibreSSL 3.4.1 source/reproduction resolve my earlier concern: the historical one-time loader is not reset by ERR_free_strings, and the new lifecycle assertions and debt note accurately document that behavior. I found no remaining blocking issue in the reviewed diff. The PR declares Depends on #9529; hosted eligibility, conventions, labels and report checks pass, while product builds are skipped. The author reports focused Windows tests and compiler/convention checks, but no PS5/title, Linux or macOS run.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:04:59Z.
Review: COMMENTED
One review-state note: GitHub still records my original CHANGES_REQUESTED review because the repository endpoint did not permit dismissing it, although my later review comments and approval explicitly withdraw that finding. The latest review is APPROVED after source verification; no further action is requested on the lifecycle point.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:08:36Z.
Review: APPROVED
The pinned LibreSSL 3.4.1 source and the updated release-source reproduction resolve my earlier concern. The one-time loader is not reset by ERR_free_strings, and the new lifecycle tests/documentation match that contract. I found no remaining blocking issue. Depends on #9529 is declared. Current eligibility, conventions, labels and report checks pass; product checks are skipped, and the author reports focused Windows tests and compiler/convention checks.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:00:20Z.
Review: APPROVED
Rechecked the current ERR string lifecycle change against the pinned LibreSSL 3.4.1 source. The added loaded-first/free-first process tests correctly cover the pthread_once behavior and preserve numeric fallbacks after free/reload; the prior concern is resolved. #9529 remains open as the declared predecessor. Eligibility, conventions, intake, labels and report checks pass; product/relinker builds were skipped. I did not run local tests.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T07:44:19Z.
Review: COMMENTED
Linux run, since the description says only Windows was used. The full build and the ERR tests pass, and they run clean under ASan and UBSan.
Machine: Linux, Ubuntu 26.04, GCC 15.2.0, Python 3.14, x86-64. Head
3f66ff0demerged withgit merge --no-commitonto currentmaind6eafa54d(clean),3rdparty/libressl-openbsdinitialized at078b3d1df.BUILD_TESTING=ON,ANYPS5_RELINKER_ONLY=OFF): the full build passes, includingGenerateErrorStrings.pyproducingErrorStrings.incwith Python 3.14.guest_libressl_error,guest_libressl_errors,guest_libressl_free_strings,guest_libressl_free_strings_firstandpatched_librariespass (5/5).-fsanitize=address,undefined -fno-sanitize-recover=undefined -O1 -g,ANYPS5_ENABLE_ASAN=ON, leak detection off):guest_libressl_error_string_testswith no argument,freeandfree-first, andguest_libressl_error_tests, all exit 0 with no reports.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:36:17Z.
I rechecked the current head against today’s upstream
main: the merge is clean, diff-check passes, and conventions reports 0 errors (one inherited 1,038-character debt-entry warning). The reported Windows and independent Linux focused tests cover the error-string lifecycle and ASan/UBSan; those were run on older based6eafa54d. This head is now 4 ahead / 119 behind currentmain(merge basea6dcea927), so please refresh it and rerun the focused ERR tests and checks before merge. Keep the declared #9529 dependency; #9536 depends on this ERR layer.