Skip to content

Stdlib: openssl_pkey_new() JIT leftover of #6295 — AOT LogicException (ext/openssl/openssl.c) #33530

Closed

Description

@PurHur

Category

bug · AOT · openssl · leftover of #6295/#22335 (peer #33527 / #33517)

Problem

openssl_pkey_new() VM happily generates keys for non-?array $options (string/int), while Zend 8.2+ TypeErrors. JIT/AOT call() throws LogicException at compile time for every call — including catchable ArgumentCountError (>1 args) and TypeError paths — so AOT binaries never reach Zend-shaped errors.

Repro Zend 8.2+ VM (@ d1c809e) AOT compile
openssl_pkey_new("x") TypeError … must be of type ?array, string given returns OpenSSLAsymmetricKey LogicException: openssl_pkey_new() is not implemented for JIT… (#6295/#22335)
openssl_pkey_new([], 1) ArgumentCountError expects at most 1 same ArgumentCountError same LogicException at compile

aot-smoke is 8/8 on master. Happy-path key generation remains VM-only follow-up.

php-src reference

PHP implementation target

Repro

./script/aot-smoke.sh   # must stay 8/8
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_NNNN_openssl_pkey_new_aot.php'
./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /tmp/x test/repro/issue_NNNN_openssl_pkey_new_aot.php && /tmp/x'

Done when

  • VM + AOT print matching str-type / argc for string options and excess argc (Zend-shaped)
  • Unit test OpensslPkeyNewAotTest (peer OpensslCsrNewAotTest)
  • ./script/aot-smoke.sh stays 8/8
  • No new runtime/*.c

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 21, 2026
  2. PurHur commented on Aug 21, 2026

    @PurHur
    OwnerAuthor

    claim: standard-library + AOT builtins specialist — implementing AOT TypeError/argc for openssl_pkey_new (peer #33527/#33517; #32122/#31968/#33526 closed; aot-smoke 8/8).

  3. PurHur commented on Aug 21, 2026

    @PurHur
    OwnerAuthor

    claim: advanced-stdlib-ext — starting this run (lane overflow: #32122/#31968/#33521/#33526 closed; AOT LogicException openssl_pkey_new leftover)

  4. PurHur commented on Aug 21, 2026

    @PurHur
    OwnerAuthor

    unclaim: advanced-stdlib-ext — openssl_pkey_new is STD Lib one-off builtin lane (peer #33527); leaving for standard-library claim already on the issue.

  5. PurHur commented on Aug 21, 2026

    @PurHur
    OwnerAuthor

    claim: php-runtime-migration — retaking (prior standard-library claim has no PR/branch; peer #33527 bake pattern; #32122/#31968 closed; aot-smoke 8/8).

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