Fix hash AOT PROFILE=8.4 compile SIGSEGV and pack(null) compile crash - #36123
Merged
Merged
Conversation
…compile crash. Explicit PHP_COMPILER_PROFILE during user-script AOT compile breaks StringHashCrypto helper ABI; exclude it from compile env (runtime PROFILE still applies). Coerce pack() null value operands to empty string per Zend (#21209). Align hash null-algo fixture with Zend 8.4 ValueError. Closes #21557, #21209, #21490. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
added a commit
that referenced
this pull request
Sep 1, 2026
…e clear (#34379). (#36140) #36123 cleared PHP_COMPILER_PROFILE during user-script AOT compile for hash helper ABI, but supportsMbTrimFunctions() only read getenv('PHP_COMPILER_PROFILE') and skipped registration. Route forward-profile gates through languageProfileVersion() so PHP_COMPILER_AOT_COMPILE_PROFILE (already snapshotted in compile.php) applies. Co-authored-by: PurHur <PurHur@users.noreply.github.com> 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
hash()/hash_hmac()/md5()/sha1()SIGSEGV at AOT runtime whenPHP_COMPILER_PROFILE=8.4is set in the compile environment. Root cause: explicit PROFILE changes compile-time NestedJIT helper ABI forStringHashCryptoprelinked helpers; the default unset profile (8.4.0-dev) does not hit the broken path. Fix: excludePHP_COMPILER_PROFILEfrom user-script AOT compile env inbin/compile.phpandAotTest::COMPILE_EXCLUDED_ENV(runtime PROFILE still applies).pack("a*", null)with a compile-time null literal SIGSEGV'd duringbin/compile.php. Fix:JitPack::writeArg()coerces null value operands to empty string (Zend quiet null→'' perext/standard/pack.c).hash_null_algo_forward84AOT fixture with Zend 8.4 — null$algothrowsValueErrorafter deprecation, not soft-null.php-src refs:
ext/hash/hash.c(Z_PARAM_STR),ext/standard/pack.c(null coerce).Test plan
Closes #21557, #21209, #21490.
Made with Cursor