Skip to content

Regression: AOT quotemeta() segfaults after build — VM/JIT match Zend (ext/standard/string.c) #27011

Description

@PurHur

Category

bug · php-src-strict · AOT · pillar 4

Problem

quotemeta() matches Zend on VM and JIT (a\.b), but the AOT binary builds then segfaults before printing.

Repro Zend / VM / JIT (2026-08-02, 712a1e64a) AOT bin/compile.php
echo quotemeta("a.b") a\.b builds; run → phpc: fatal signal (segfault) after c:main_before_php (exit 139)

Prior routing work (#21589) closed; this is a fresh AOT runtime crash on master.

php-src reference

PHP implementation target

  • ext/standard string helpers + AOT/JIT call path in lib/JIT — PHP-in-PHP
  • Fix the standalone/AOT value/string ABI; do not paper over with new C

Repro

./script/docker-exec.sh -- bash -lc '
cat > /tmp/aot_quotemeta.php <<'"'"'PHP'"'"'
<?php
echo quotemeta("a.b"), "\n";
PHP
echo -n "zend="; php /tmp/aot_quotemeta.php
echo -n "vm="; php bin/vm.php /tmp/aot_quotemeta.php 2>/dev/null
echo -n "jit="; php bin/jit.php /tmp/aot_quotemeta.php 2>/dev/null | grep -v Deprecated
php bin/compile.php -o /tmp/aot_quotemeta /tmp/aot_quotemeta.php && /tmp/aot_quotemeta
'

Done when

  • AOT binary prints a\.b matching Zend/VM/JIT
  • Prefer --repeat 10 on the built binary before claiming fixed (heap crashes are intermittent)
  • Compliance or test/repro/ guard
  • php-src-strict; no php-compiler-strict shortcut

Activity

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