feat(libSceLibreSsl3): report queued errors through guest callbacks #15737

Merged
santhoshkumar-dev merged 5 commits from upstream-pr/15737 into main 2026-11-15 19:49:59 +00:00
santhoshkumar-dev commented 2026-11-04 10:41:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-11-04T10:41:52Z.


What

ERR_print_errors_cb (gtRD8r2e+uk) currently throws. Its guest callback now receives one diagnostic line at a time from the existing LibreSSL error queue. Each call consumes the oldest record before invoking the callback. A zero or negative callback result stops the report and leaves later records queued.

The report uses the existing numeric formatter, the decimal guest pthread handle, and the stored filename and line. Missing filenames produce NA:0, and the callback length excludes the terminating null. The implementation follows the public LibreSSL callback and line format. The queue does not store optional diagnostic text. Console callback ABI and diagnostic metadata remain unverified. Pinned LibreSSL formatter · OpenBSD manual

The dependency line records integration order for the older branches that touch the same build, declaration, or debt lines. The callback uses the error queue and pthread APIs already on main.

Tested

Submitted head b8266feacf432d3fed8e051e22049dd69e53d5b9 on upstream main b11c7bf84f5d2f636ff60166cc3371bd071e24d5.

  • Windows 11 Pro x86-64, WinLibs GCC 15.2.0 r7, Ninja Release with bundled dependencies and BUILD_TESTING=ON. Complete libs build, selected tests and packaged-library loader built. 83/83 selected CTests pass, including the header audit and 64 compile batches.
  • The callback test covers numeric text, filename and line metadata, callback length and user data, FIFO order, positive and nonpositive results, reentrant enqueue, truncation and thread isolation. It also prints two actual errors from a malformed ASN.1 integer input. Null callbacks are tested on empty and populated queues.
  • Current main passes six focused existing tests. The new fixture with the baseline DLL exits 1 with ERR_print_errors_cb_nid_postfix not implemented.
  • Ubuntu 24.04 x86-64 under WSL2, GCC 13.3. The header audit and all 64 compilation batches pass from the exact source archive on ext4. A separate ASan/UBSan source probe passes the production queue, formatter, callback and ASN.1 decoder with pthread, heap and exception shims. The combined source probe also passes with the actual key mismatch from #15601 and numeric lookup code from #15628. Both branches merge cleanly with this topic.
  • Linux product build was still in progress at publication.

Conventions and whitespace pass. tools/pr_overlap.py --branch scanned 1,822 open PRs and found seven shared-file conflicts and no same-export collision. It exited 2 on 33 branches with pre-existing base conflicts. I compared their shared files against the baseline and searched each full source diff for the callback, its NID and the new queue helper. This found only neighboring declaration edits from #12928 and #15163 beyond the conflicts already present on main. The earlier inventory addition supplies the throwing declaration.

Validation covers the selected runtime tests. macOS, console, title execution and the complete CTest suite remain untested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #10631, #10878, #12928, #12945, #14890, #15031, #15163, #15514, #15627
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5152896059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15737). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-11-04T10:41:52Z. --- ### What `ERR_print_errors_cb` (`gtRD8r2e+uk`) currently throws. Its guest callback now receives one diagnostic line at a time from the existing LibreSSL error queue. Each call consumes the oldest record before invoking the callback. A zero or negative callback result stops the report and leaves later records queued. The report uses the existing numeric formatter, the decimal guest pthread handle, and the stored filename and line. Missing filenames produce `NA:0`, and the callback length excludes the terminating null. The implementation follows the public LibreSSL callback and line format. The queue does not store optional diagnostic text. Console callback ABI and diagnostic metadata remain unverified. [Pinned LibreSSL formatter](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/err/err_prn.c) · [OpenBSD manual](https://man.openbsd.org/ERR_print_errors.3) The dependency line records integration order for the older branches that touch the same build, declaration, or debt lines. The callback uses the error queue and pthread APIs already on main. ### Tested Submitted head `b8266feacf432d3fed8e051e22049dd69e53d5b9` on upstream main `b11c7bf84f5d2f636ff60166cc3371bd071e24d5`. - Windows 11 Pro x86-64, WinLibs GCC 15.2.0 r7, Ninja Release with bundled dependencies and `BUILD_TESTING=ON`. Complete `libs` build, selected tests and packaged-library loader built. **83/83 selected CTests pass**, including the header audit and 64 compile batches. - The callback test covers numeric text, filename and line metadata, callback length and user data, FIFO order, positive and nonpositive results, reentrant enqueue, truncation and thread isolation. It also prints two actual errors from a malformed ASN.1 integer input. Null callbacks are tested on empty and populated queues. - Current main passes six focused existing tests. The new fixture with the baseline DLL exits 1 with `ERR_print_errors_cb_nid_postfix not implemented`. - Ubuntu 24.04 x86-64 under WSL2, GCC 13.3. The header audit and all 64 compilation batches pass from the exact source archive on ext4. A separate ASan/UBSan source probe passes the production queue, formatter, callback and ASN.1 decoder with pthread, heap and exception shims. The combined source probe also passes with the actual key mismatch from #15601 and numeric lookup code from #15628. Both branches merge cleanly with this topic. - Linux product build was still in progress at publication. Conventions and whitespace pass. `tools/pr_overlap.py --branch` scanned 1,822 open PRs and found seven shared-file conflicts and no same-export collision. It exited 2 on 33 branches with pre-existing base conflicts. I compared their shared files against the baseline and searched each full source diff for the callback, its NID and the new queue helper. This found only neighboring declaration edits from #12928 and #15163 beyond the conflicts already present on main. The earlier [inventory addition](https://github.com/boykopovar/AnyPS5/pull/8827) supplies the throwing declaration. Validation covers the selected runtime tests. macOS, console, title execution and the complete CTest suite remain untested. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #10631, #10878, #12928, #12945, #14890, #15031, #15163, #15514, #15627 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
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!15737
No description provided.