Skip to content

Stdlib: openssl_csr_export()/openssl_csr_export_to_file() JIT leftover of #6421 — AOT LogicException (ext/openssl/xp.c) #32697

Closed

Description

@PurHur

Category

stdlib · AOT leftover · openssl CSR export · pillar 4 · leftover of #6421 (peer #32692 get_subject / #32557 x509_export)

Problem

VM implements openssl_csr_export() / openssl_csr_export_to_file() via VmOpensslCsrNative::normalizeCsrPem. JIT call() still throws LogicException citing #6421, so phpc build cannot emit those builtins. Thin-standalone AOT has no PHP FFI — bake the PEM in the compiler process like JitOpensslX509::export (#32557).

script/aot-smoke.sh stays 8/8 — this is the feature, not the linker.

Repro Zend 8.2+ / VM AOT (master)
openssl_csr_export($pem, $out) (literal PEM) true + PEM in $out compile LogicException #6421
openssl_csr_export_to_file($pem, $path) true + file compile LogicException #6421

php-src reference

PHP implementation target

  • ext/openssl/JitOpensslX509.php — bake normalizeCsrPem into &$output / file (peer x509 export)
  • ext/openssl/openssl_csr_export.php / openssl_csr_export_to_file.php — JIT call() wiring
  • PHP-in-PHP only; no new runtime/*.c

Repro

./script/aot-smoke.sh
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/csr.bin test/repro/issue_NNNN_openssl_csr_export_aot.php && /tmp/csr.bin'

Done when

  • AOT openssl_csr_export on a compile-time CSR PEM writes PEM and returns true (no LogicException)
  • AOT openssl_csr_export_to_file writes the file
  • ./script/aot-smoke.sh stays 8/8
  • Executing AOT fixture (not compile-only -l)
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 20, 2026
  2. PurHur commented on Aug 20, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler Advanced Stdlib — implementing openssl_csr_export JIT/AOT leftover of #6421.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions