Skip to content

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

Merged
oneandonlydean merged 5 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/libressl3-error-report
Nov 15, 2026
Merged

oneandonlydean merged 5 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/libressl3-error-report

Conversation

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor

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 fix(libSceLibreSsl3): report mismatched key types through the error queue #15601 and numeric lookup code from feat(libSceLibreSsl3): implement the ERR library, function and reason string lookups #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

@JJenkx

JJenkx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Windows check of head b8266feacf, which already contains main b11c7bf84f.

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.

  • guest_libressl3_error_report passes in 3 of 3 runs.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 19126 core/libs/prx/libSceLibreSsl3/include/Api.hpp L202 ERR_print_errors_cb

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 11146 docs/dev/debt/libSceLibreSsl.md
PR 11176 docs/dev/debt/libSceLibreSsl.md
PR 11466 docs/dev/debt/libSceLibreSsl.md
PR 12315 core/libs/prx/libSceLibreSsl3/CMakeLists.txt
core/libs/prx/libSceLibreSsl3/Export.cpp
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 12729 docs/dev/debt/libSceLibreSsl.md
PR 12730 docs/dev/debt/libSceLibreSsl.md
PR 15279 docs/dev/debt/libSceLibreSsl.md
PR 15280 docs/dev/debt/libSceLibreSsl.md
PR 16589 core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 16981 core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 17621 core/libs/prx/libSceLibreSsl3/CMakeLists.txt
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 17622 core/libs/prx/libSceLibreSsl3/CMakeLists.txt
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 17626 core/libs/prx/libSceLibreSsl3/CMakeLists.txt
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md
PR 17844 core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl.md
docs/dev/debt/libSceLibreSsl3.md
PR 19779 core/libs/prx/libSceLibreSsl3/CMakeLists.txt
core/libs/prx/libSceLibreSsl3/include/Api.hpp
docs/dev/debt/libSceLibreSsl3.md

Fix-up on santhoshkumar-dev's change: keep both sets of new declarations in Api.hpp, take main's debt notes and re-apply this change on top (the error-queue sentence in libSceLibreSsl.md and the reworded pending-exports entry in libSceLibreSsl3.md, which no longer states a count). The Additional exports total on the merged tree is unchanged at 140 (130 named, 10 known only by NID).
…s the unimplemented throw

Fix-up on santhoshkumar-dev's change: the error report test no longer asserts that a null callback throws. The stop-result, producer and queue checks stay.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @santhoshkumar-dev,

Two fix-ups on your branch (plain commits, no force-push). We merged current main (Api.hpp: kept both sets of declarations; the two libSceLibreSsl debt notes: main wording taken and your change re-applied on top; the Additional exports total is unchanged at 140, 130 named and 10 known only by NID) and removed the null-callback throw check from tests/ErrorReport.cpp, since tests should not assert that an unimplemented path throws. The stop-result, producer and queue checks are unchanged.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 15, 2026
@oneandonlydean
oneandonlydean merged commit f5b24ad into boykopovar:main Nov 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants