Skip to content

Regression: AOT preg_match_all() aborts after build — VM/JIT match Zend (ext/pcre/php_pcre.c) #27195

Closed

Description

@PurHur

Category

Regression · php-src-strict · AOT

Problem

preg_match_all() matches Zend on VM and JIT, but the thin AOT binary aborts (SIGABRT / exit 134) immediately after phpc build succeeds (2026-08-03, Docker php-compiler:22.04-dev).

Repro Zend 8.2 VM / JIT AOT
preg_match_all('/\w+/', 'a b c', $m); echo implode(',', $m[0]); a,b,c a,b,c abort exit 134 (phpc: fatal signal / core dump)

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/pma.php <<'\''PHP'\''
<?php
preg_match_all("/\w+/", "a b c", $m);
echo implode(",", $m[0] ?? []), "\n";
PHP
php /tmp/pma.php
php bin/vm.php /tmp/pma.php
php bin/jit.php /tmp/pma.php
PHP_COMPILER_HELPER_RUNTIME_O=0 ./phpc build -o /tmp/pma.bin /tmp/pma.php && /tmp/pma.bin; echo exit:$?'

Done when

  • AOT binary prints a,b,c matching Zend/VM/JIT
  • Compliance .phpt or test/repro/ guard under PCRE
  • php-src-strict; no php-compiler-strict shortcut
  • Re-run binary ≥5× (heap/abort class) before closing

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 3, 2026
  2. PurHur commented on Aug 3, 2026

    @PurHur
    OwnerAuthor

    Maintainer gate snapshot (2026-08-03) — #10533 comments locked

    Could not post to #10533 (commenting disabled at 2500+). Local Docker gates:

    Gate Result
    php script/bootstrap-inventory.php --check green OK 6866/6866
    ./script/release-readiness.sh --json user_release_ready: no
    First failing north-star5-fast — 4f-m gen-0 manifest/driver mismatch (#8713)
    VM driver execute probe / gen0 functional smoke green
    gen-0 provenance stale — 6 lowering commits since 0fa60f12e

    Parity batch filed: #27195 (this), #27196 (finfo_file AOT), #27197 (iconv_substr AOT), #27198 (getservbyname AOT vs Zend false).

  3. PurHur commented on Aug 3, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-A — starting this run

    Lane A (27195 % 3 == 0). Scope is ext/pcre + lib/JIT AOT execute abort for preg_match_all (not ext/standard STD Lib ownership; not Dom/XML or I/O&Crypto extension lists). No open PR; no prior claim.

    TRY_FIRST (this workspace):

    Proceeding with Pillar 4 AOT parity (#27195); gen-0 rebuild is multi-hour bootstrap work, not this ticket.

  4. PurHur commented on Aug 3, 2026

    @PurHur
    OwnerAuthor

    merged via #27378

    Verification

    • PHP_COMPILER_HELPER_RUNTIME_O=0 php bin/compile.php -o /tmp/pma test/repro/issue_27195_aot_preg_match_all.php && /tmp/pma → a,b,c (exit 0 ×5)
    • vendor/bin/phpunit --filter 'PregAotFastPathTest|PregMatchRuntimeShrinkTest' — 14 OK
    • Thin AOT now builds $matches[0] as array of full matches via matchAllStore + thinMatchAllPart* (no more implode abort)
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