Repository navigation
Stdlib: openssl_pbkdf2() JIT/AOT compile-time bake (#32410) - #32429
Merged
Merged
Conversation
VM already matched Zend; call() threw LogicException so AOT could not compile PBKDF2. Bake literal keys via VmHashNative (php-src openssl.c PKCS5_PBKDF2_HMAC) because JitHash::hashPbkdf2 SIGSEGVs under AOT on this tree. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openssl_pbkdf2()no longer throwsnot implemented for JIT(Stdlib: openssl_pbkdf2() JIT/AOT lowering missing — VM path only (ext/openssl/openssl.c) #32410 leftover of Stdlib: openssl_pbkdf2()/openssl_pbkdf2_scrypt() — OpenSSL KDF API missing (ext/openssl/kdf.c) #6488). Literal calls bake the raw key viaVmHashNative::hashPbkdf2(php-srcext/openssl/openssl.cPHP_FUNCTION(openssl_pbkdf2)/PKCS5_PBKDF2_HMAC).key_length <= 0is a catchableValueError;iterations <= 0and unknown digest arefalse, matching Zend/VM.JitHash::hashPbkdf2SIGSEGVs under AOT on this tree (hash_pbkdf2itself); this path does not use it. Dynamic (non-literal) args stillLogicException.bin2hex()AOT also SIGSEGVs for'hello', so the AOT fixture compares raw key bytes.Closes #32410
Test plan
./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh'→ 8 passed, 0 failed./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_openssl_pbkdf2_aot.php'→ Zend hex + false + ValueError./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/pbkdf2.bin test/repro/issue_openssl_pbkdf2_aot.php && /tmp/pbkdf2.bin'→ same as VM./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php -d memory_limit=1536M vendor/bin/phpunit --filter OpensslPbkdf2JitTest'→ OK (1 test, 6 assertions)php script/bootstrap-inventory.php --check→ OK 7624/7624php script/check-selfhost-spine-coverage-sync.php→ OKnorth-star5-verify --strict, fullmake test-harness, AOTbin2hex(pre-existing SIGSEGV)Made with Cursor