Repository navigation
Regression: AOT DOMXPath::query() segfaults after length — VM/JIT match Zend (ext/dom/xpath.c) #27275
Copy link
Copy link
Closed
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITbugSomething isn't workingSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Description
Activity
- addedbugSomething isn't workingSomething isn't workingphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsarea:compilerCompiler / CFG / JITCompiler / CFG / JITimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claim
on Aug 3, 2026 Maintainer TRY_FIRST (2026-08-03,
cd7a55db7) — also intended for #10533 (comments locked at 2500+)Gates
Gate Result bootstrap-inventory --checkok 6884/6884release-readiness --jsonuser_release_ready: **no**helper-runtime-prelink --strictFAIL — STALE ext_standard_RoundJitHelper_php(RoundJitHelper.php); 351 fresh / 1 stalenorth-star5-verify --fastFAIL — step 4f-mgen-0 manifest/driver mismatch (#8713)vm-driver-execute-probe / gen0-functional-smoke / cold-build / spine ok gen-0 provenance stale — driver cc035ed55(0d); 1 lowering commit sinceFirst fail: stale RoundJitHelper prelink → then north-star5-fast gen-0 mismatch. Pillar 1 red; no open PRs this run.
Merged via PR #27372.
Fix: User-script AOT
DOMXPath::query('//tag')now records the tag and materializesNodeList::item(N)from compile-time XML with Attr-cache seeding, sogetAttributeworks instead of falling through to the DomRegistry ABI (segfault).Verification:
php bin/vm.php test/repro/aot_domxpath_query_segfault.php # 2\n2 php bin/jit.php test/repro/aot_domxpath_query_segfault.php # 2\n2 PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/x test/repro/aot_domxpath_query_segfault.php /tmp/x # 2\n2 ×3 runs, exit 0 vendor/bin/phpunit --filter xpath_query_item test/aot/AotTest.php # OK- added a commit that references this issue
on Aug 3, 2026 - added a commit that references this issue
on Aug 27, 2026
Metadata
Metadata
Assignees
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITbugSomething isn't workingSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsPhase 4 – stdlib for web appsstdlib
Category
bug· php-src-strict · AOT / ext/domProblem
DOMXPath::query('//a')then->length/->item(1)->getAttribute('id')matches Zend on VM and JIT. AOT builds succeed but the binary prints the length then segfaults (exit 139) on every run before printing the attribute — liveDOMNodeList/ node access after XPath.PHP_COMPILER_HELPER_RUNTIME_O=0)query('//a')+length+item(1)->getAttribute('id')2\n22\n22then segfault (3/3runs)Verified on master
cd7a55db7. Related open AOT DOM: #27260 (normalizeDocument); this is XPath/DOMNodeListafter query.php-src reference
ext/dom/xpath.c—DOMXPath::queryext/dom/nodelist.c— live node listPHP implementation target
ext/dom/+ JIT — PHP-in-PHP; no newruntime/*.clogicRepro
Inline (if repro file not on branch yet):
Done when
2\n2matching Zend/VM/JIT (no segfault; verify 3× runs)test/repro/guard for DOMXPath::query + item attribute