Skip to content

crypto: the memory option as built - #19

Merged
pinhopro merged 3 commits into
mainfrom
crypto/memory-option-built
Nov 18, 2026
Merged

pinhopro merged 3 commits into
mainfrom
crypto/memory-option-built

Conversation

@pinhopro

@pinhopro pinhopro commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What the option does

webcpp::crypto's OpenSSL memory option routes every allocation OpenSSL makes in the process through a std::pmr memory resource that the program chooses, by installing three adapter functions with CRYPTO_set_mem_functions (install_memory_functions(), called first in main). It is native only: it is refused on all WebAssembly targets (Emscripten, WASIp2, WASIp3) with a diagnostic naming the target.

This PR carries the proposals text as built: the memory option sections of the crypto spec and its normative requirements, with the owner decisions on targets and the trystero migration marked dropped. It follows the tree: a resource failing during base initialisation is unrecoverable on a threaded OpenSSL, and fail_init_threads is named in the test list.

Verification

From the stream's verify and final-fix reports:

  • Full lint, clean after the final fixes.
  • Five lanes, -a: native 180, gcc-15 168, wasip2 141, wasip3 134, emscripten 92, all green. After the final fix wave, native -a (29 memory tests plus docs) and gcc-15 were rerun; the last commits touch native-only docs, Doc Comments and the example.
  • C suites (x4), docs and site builds, and the tools tests: green.
  • Linux gcc-15 container: 27/27 (29 after the final fixes).
  • Local MSVC lane (Wine): 14.3 and 14.5 green except the 8 known Wine failures. The memory link-fail cases fail on LNK2019/LNK1120 and LNK2038 as required.

Ruling on a failing resource

A resource that fails during OpenSSL's base initialisation is unrecoverable on a threaded OpenSSL (MSVC always, threading=multi elsewhere): OpenSSL re-enters its own initialisation and the call never returns (abort on macOS, deadlock on Linux, spin on Windows). The resource must serve OpenSSL's start-up. On a single-threaded OpenSSL the failure is permanent and every make returns backend_failure. fail_init pins the single-threaded behaviour; fail_init_threads pins the threaded boundary. The guide, the Doc Comments, the guidelines and the proposals say the same.

Related PRs

🤖 Generated with Claude Code

@pinhopro
pinhopro merged commit e917dd5 into main Nov 18, 2026
2 checks passed
@pinhopro
pinhopro deleted the crypto/memory-option-built branch November 18, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant