Category
Regression · Pillar 1 (Trust) · follow-up of #33234 · HELPER_RUNTIME_O=0 thin AOT
Problem
#33234 dropped the Type always-on __compiler_trigger_error empty decl/register. Ownership is StringTriggerError / JitTriggerErrorKernel, but Type::register() still calls SessionStartOptionsRuntime::ensureLinked() before any StringTriggerError::ensureLinked.
With PHP_COMPILER_HELPER_RUNTIME_O=0 (honest thin path used by DOM AOT unit tests), NestedJIT of session helpers lowers scalar coerce warnings via JitScalarEnumCoerce::emitObjectScalarWarning → lookupFunction('__compiler_trigger_error') and throws:
Unable to lookup non-existing function __compiler_trigger_error
Measured on master @ f0f17ca3a9 after ./script/aot-smoke.sh 8/8 (helper-cache path still green):
| Repro |
helper cache |
HELPER_RUNTIME_O=0 |
<?php echo "hi\n"; |
links + prints hi |
compile fail (lookup) |
DOM createElement+setAttribute |
ok |
compile fail (lookup) |
Type::initialize() early-returns for STANDALONE/EMBED before the late StringTriggerError::ensureLinked at the bottom of initialize — so thin AOT never got the late link either during Context construct.
Root cause
Stack (HELPER_O=0 hello):
Type::register → SessionStartOptionsRuntime::ensureLinked → NestedJIT → JitZendScalarCast → JitScalarEnumCoerce::emitObjectScalarWarning → Context::lookupFunction('__compiler_trigger_error')
Previously Type's always-on empty shell satisfied lookup; after #33234 the module-local owner must be linked before any NestedJIT in register().
PHP implementation target
lib/JIT/Builtin/Type.php — StringTriggerError::ensureLinked($this->context) before SessionStartOptionsRuntime::ensureLinked in register() (keep initialize ensureLinked; no Type empty addFunction/registerFunction for the ABI)
- Unit guard in
TypeDeadTriggerErrorAbiRuntimeShrinkTest (or sibling) asserting register order
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && TMP=$(mktemp -d) && printf "%s\n" "<?php echo \"hi\\n\";" > "$TMP/h.php" && PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o "$TMP/h.bin" "$TMP/h.php"'
Done when
Parent
Category
Regression· Pillar 1 (Trust) · follow-up of #33234 · HELPER_RUNTIME_O=0 thin AOTProblem
#33234 dropped the Type always-on
__compiler_trigger_errorempty decl/register. Ownership isStringTriggerError/JitTriggerErrorKernel, butType::register()still callsSessionStartOptionsRuntime::ensureLinked()before anyStringTriggerError::ensureLinked.With
PHP_COMPILER_HELPER_RUNTIME_O=0(honest thin path used by DOM AOT unit tests), NestedJIT of session helpers lowers scalar coerce warnings viaJitScalarEnumCoerce::emitObjectScalarWarning→lookupFunction('__compiler_trigger_error')and throws:Measured on
master@f0f17ca3a9after./script/aot-smoke.sh8/8 (helper-cache path still green):HELPER_RUNTIME_O=0<?php echo "hi\n";hicreateElement+setAttributeType::initialize()early-returns for STANDALONE/EMBED before the lateStringTriggerError::ensureLinkedat the bottom of initialize — so thin AOT never got the late link either during Context construct.Root cause
Stack (HELPER_O=0 hello):
Type::register→SessionStartOptionsRuntime::ensureLinked→ NestedJIT →JitZendScalarCast→JitScalarEnumCoerce::emitObjectScalarWarning→Context::lookupFunction('__compiler_trigger_error')Previously Type's always-on empty shell satisfied lookup; after #33234 the module-local owner must be linked before any NestedJIT in
register().PHP implementation target
lib/JIT/Builtin/Type.php—StringTriggerError::ensureLinked($this->context)beforeSessionStartOptionsRuntime::ensureLinkedinregister()(keep initialize ensureLinked; no Type emptyaddFunction/registerFunctionfor the ABI)TypeDeadTriggerErrorAbiRuntimeShrinkTest(or sibling) asserting register orderruntime/*.cRepro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && TMP=$(mktemp -d) && printf "%s\n" "<?php echo \"hi\\n\";" > "$TMP/h.php" && PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o "$TMP/h.bin" "$TMP/h.php"'Done when
PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.phpon hello-world exits 0 and binary printshicreateElement/setAttributescript./script/aot-smoke.shstays 8/8__compiler_trigger_errorempty decl restoredParent
.1ABI drift class)